Network Infrastructure configuration

Source: Internet
Author: User


1. Network BasicsIf a host can connect to the public network, such as Access www.baidu.com then this host will inevitably have Ipaddressgateway DNS host domain name converted to IP server
########### #ipaddress ############# #tcp/ipipv42 32-bit 254.254.254.254/ 255.255.255.011111110.11111110.11111110.11111110/11111111.11111111.11111111.00000000 254.254.0.254/ 255.255.255.0254.254.0.254/255.255.0.0

2.ip settings
Ifconfig # # #查看或者临时设定主机ip的工具ip addr Show Ifconfig network interface # #查看这个接口上的 IP ifconfig network interface IP netmask Subnet Mask # # # #临时设定ipifco Nfig eth0 172.25.254.100 netmask 255.255.255.0

Systemctl Restart Network # # #重新启动网络基本服务systemctl Restart NetworkManager # # #网络智能管理服务

How to configure the graphics networkNm-connection-editor # #图形中的网络设定工具 (set Ip,getway,dns) Nmtui # #文本中的网络设定工具
command how to set IP
NMCLINMCLI connection Down/up Connection name # #开关nmcli Connection Delete     Connection name    ## #删除此连接nmcli Connection add Con-name WESTOS ifname eth0 type Ethernet AutoConnect  yes     # # # #添加动态网络nmcli connection Add con-name Wes TOS ifname eth0 type Ethernet IP4 ip/24         # #静态网络nmcli connection add con-name Westos ifname ETH 0 Type Ethernet IP4 ip/24  gw4 IP        ## #添加网关      modify change IP. Getway. Dns. Static and dynamic state. NMCLI device SHOWNMCLI device statusnmcli device disconnect ETH0NMCLI device connect eth0nmcli connection edit "System Wes TOS1 "NMCLI Connection Modify" System Westos1 " ipv4.addresses 172.25.254.101/24NMCLI connection Modify" system WESTOS1 " ipv4.dns 172.25.254.1nmcli connection Modify  " System westos1 "Ipv4.method autonmcli Connection Modify "System Westos1" Ipv4.method MANUALNMCLI Connection Delete "System WESTOS1" NMCLI connection add con-name eth0 Ifnam e eth0  type Ethernet IP4 172.25.254.100 gw4 172.25.254.254nmcli Connection modify eth0 Ipv4.dns 172.25.254.254

4. Network Port Detection
Ss|netstat
-A All
-N Do not parse
-T TCP protocol
-U UDP protocol
-L Listen
-E Port Details
/etc/services system service uses port information by default
5. Network configuration file/etc/sysconfig/network-scripts/# # #网络配置目录

5.1 Dynamic Network Configuration
Vim ifcfg-xxx # # #网络配置文件格式DEVICE =eth0 # #指定文件管理的设备名称BOOTPROTO =dhcp # #dhcp动态获取, none and Static Network Onboot=yes # #开机自动激活设备NAME =hello # #指定网络链接的名字为hello

5.2 Static Network configurationVim ifcfg-xxx # # #网络配置文件格式DEVICE =eth0 # #指定文件管理的设备名称BOOTPROTO =static|none # #dhcp动态获取, none and static represent static network Onboot=yes # #开机自动激活设备NAME =hello # #指定链接名字IPADDR # =172.25.254.100 # #设定ip For 172.25.254.100netmask=255.255.255.0 # #子网掩码为255.255.255.0#prefix=24 # #子网掩码为255.255.255.0gateway=
6. Gateways GatewayA gateway is the Ipvim/etc/sysconfig/network-scripts/ifcfg-xxxgateway= gateway address on the same network segment as our host on the router vim/etc/sysconfig/ Network-scripts/ifcfg-xxxdns1=172.25.254.254peerdns=yes|no # # #配置文件是否会修改/etc/resolv.conf no means no modificationrouting: doing address translation# route-n View route table route tracking

7. Domain Name resolution
7.1.ip Mapping File
/etc/hosts # # # #配置主机ip及对应的主机名ip Host Name
7.2.dns server pointing to fileVim/etc/resolv.confnameserver 172.25.254.254

the difference between hosts, host.conf and resolv.conf under 7.3LinuxLocated in the/etc/directory 1.hosts file. Similar to the file of host under Windows System, is a text file,
It contains some correspondence between IP and domain name. 2.nsswitch.conf #解析器查询顺序配置文件
Hosts:files DNS indicates that the local hosts file is queried first, and if there is no result, try
Locate the BIND DNS server. 3. resolv.conf Configure the configuration file for the Linux system DNS server: Vi/etc/resolv.confnameserver 192.168.0.1nameserver 202.99.96.68
8. Script Completion IP configuration#!/bin/bashadd=/etc/sysconfig/network-scriptssystemctl Stop network MV $ADD/IFCFG-LO/MNTRM-RF $ADD/ifcfg-*mv/mnt/ Ifcfg-lo $ADD/cat> $ADD/ifcfg-steven <<enddevice=eth0bootproto=noneonboot=yesname=stevenipaddr=$*netmask =255.255.255.0getway=172.25.254.250dns1=172.25.254.250end systemctl start networksystemctl restart NetworkManager
9.Ping
# Send ICMP echo_request to network hosts
-c-w c times w wait duration




This article from the "Technology life, Simple not simple" blog, please be sure to keep this source http://willis.blog.51cto.com/11907152/1846823

Network Infrastructure configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.