# # # #1. Basic IP Knowledge # #
1.ipv4
2 binary 32-bit-----10-binary
172.25.0.10/255.255.255.0
172.25.0.10:ip Address
255.255.255.0: Subnet Mask
Subnet mask 255-bit corresponding IP bit for network bit
Subnet mask 0 corresponds to the IP bit master camera
# # # #2. Configuring ip####
<< Graphics >>
1. Graphical interface
Nm-connection-editor
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/9D/65/wKioL1l_ad-QPlb2AAB61IvffPk704.png "title=" Screenshot from 2017-08-01 01-32-38.png "alt=" Wkiol1l_ad-qplb2aab61ivffpk704.png "/>
2. Text Graphics
Nmtui
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/9D/65/wKioL1l_afaRpt3oAABQJMZQYl8486.png "title=" Screenshot from 2017-07-31 21-31-02.png "alt=" Wkiol1l_afarpt3oaabqjmzqyl8486.png "/>
<< commands >>
Ifconfig network card IP netmask # #临时设定
NMCLI Connection Add type Ethernet con-name WESTOS ifname eth0 AutoConnect Yes
NMCLI Connection Add type Ethernet con-name WESTOS ifname eth0 ip4 ip/24
NMCLI Connection Delete Westos
NMCLI Connection Show
NMCLI Connection down Westos
NMCLI Connection up Westos
NMCLI connection Modify "Westos" Ipv4.addresses newip/24
NMCLI connection Modify "Westos" Ipv4.method <auto|manual>
NMCLI Device Connect eth0
NMCLI Device Disconnect Eth0
NMCLI Device Show
NMCLI Device status
<< Files >>
DHCP # #动态获取
Vim/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0 # #接口使用设备
BOOTPROTO=DHCP # #网卡工作模式
Onboot=yes # #网络服务开启时自动激活
Name=eth0 # #网络接口名称
: Wq
Systemctl Restart Network
Static|none # #静态网络
Vim/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0 # #设备
Bootproto=static|none # #设备工作方式
Onboot=yes # #开启网络服务激活设备
Name=eth0 # #网络接口名称
IPADDR=172.25.0.100 # #IP
netmask=255.255.255.0 | PREFIX=24 # #子网掩码
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/65/wKiom1l_amzQHLe6AABXZOYW_6k879.png "title=" Screenshot from 2017-07-31 22-10-53.png "alt=" Wkiom1l_amzqhle6aabxzoyw_6k879.png "/>
# # # #3. Gateway Gateways # # #
1. Routers
The main function is to make NAT
Dnat Destination Address Translation
Snat Source Address Translation
2. Gateways
The IP on the router and itself in the same network segment
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/9D/65/wKiom1l_ap7CvsBzAACV2neclLw358.png "title=" Screenshot from 2017-08-01 01-36-05.png "alt=" Wkiom1l_ap7cvsbzaacv2necllw358.png "/>
3. Setting up the Gateway
Systemctl Stop Netwrokmanager
Vim/etc/sysconfig/network # #全局网关
gateway= Gateway IP
vim/etc/sysconfig/network-scripts/ifcfg-NIC configuration file # #网卡接口网关
gateway= Gateway IP
Systemctl Restart Netwrok
Route-n # #查询网关
Kernel IP Routing Table
Destination Gateway genmask Flags Metric Ref use Iface
0.0.0.0 (Gateway) 172.25.0.254 0.0.0.0 UG 0 0 0 eth0
172.25.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
# # # #5. dns####
1.dns
DNS is a single server
This server provides the ability to answer the client hostname and IP correspondence
2. Setting up DNS
Vim/etc/resolv.conf
NameServer DNS Server IP
vim/etc/sysconfig/network-scripts/ifcfg-NIC configuration file
Dns1=dns Server IP
3. Local parsing file
Vim/etc/hosts
IP host Name
4. Local resolution of file and DNS read priority tuning
/etc/nsswitch.conf
#hosts: DB Files Nisplus NIS DNS
Hosts:files DNS # #files代表本地解析文件, DNS on behalf of the DNS server, that priority in the front
Configuration of the 5.DHCP service
Using firewall policy and DHCP service to implement virtual machine network
Idea: 1.ifconfig view br0 IP and WLS3 IP
2. Turn on the firewall, write a spoofing policy, restart the Firewall service
3. Install the DHCP service, and edit the DHCP service's configuration file to restart the DHCP service
4. Set the IP acquisition mode for the virtual machine to DHCP and restart the network service
5. Use virtual machine test to see if you can surf the internet
Operation: 1.650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/9D/65/wKioL1l_buyzLxhBAABv1D297Io656.png "title=" Screenshot from 2017-08-01 01-38-29.png "alt=" Wkiol1l_buyzlxhbaabv1d297io656.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/9D/65/wKioL1l_bxTgT7Q2AACAzxz50i8568.png "title=" Screenshot from 2017-08-01 01-38-36.png "alt=" Wkiol1l_bxtgt7q2aacazxz50i8568.png "/>
2.
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/65/wKiom1l_bzayT2yaAADhOfH2fto568.png "style=" float : none; "title=" screenshot from 2017-08-01 01-39-17.png "alt=" Wkiom1l_bzayt2yaaadhofh2fto568.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/65/wKioL1l_bzaxBHYeAAFJv3vkleA731.png "style=" float : none; "title=" screenshot from 2017-08-01 01-47-22.png "alt=" Wkiol1l_bzaxbhyeaafjv3vklea731.png "/>
3.650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/9D/65/wKioL1l_b9OgT7tQAACpKviba8k753.png "title=" Screenshot from 2017-08-01 01-53-35.png "alt=" Wkiol1l_b9ogt7tqaacpkviba8k753.png "/>
4650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/77/wKioL1mAdBqyr7IjAAAxIjnYQIk637.png "title=" Screenshot from 2017-08-01 01-52-49.png "alt=" Wkiol1madbqyr7ijaaaxijnyqik637.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/9D/65/wKioL1l_cBvxl5lAAAAYNe4giXM749.png "style=" float : none; "title=" screenshot from 2017-08-01 01-52-45.png "alt=" Wkiol1l_cbvxl5laaaayne4gixm749.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/9D/77/wKiom1mAdDGRzohrAAG2zUSxP9o945.png "title=" Screenshot from 2017-08-01 20-12-21.png "alt=" Wkiom1maddgrzohraag2zusxp9o945.png "/>
This article is from the "13122425" blog, please be sure to keep this source http://13132425.blog.51cto.com/13122425/1952783
Linux Cloud Automation Operations Basics (IP network)