# # Router # #
1 . Router--The main function is to do NAT
Dant Destination Address Translation
Snat Source Address Translation
2 . Gateway--The IP on the router and itself on the same network segment
3 . Set the Gateway
Global Gateway
Systemctl Stop NetworkManager
Vim/etc/sysconfig/network
gateway= Gateway IP
Nic Interface Gateway
vim/etc/sysconfig/netw/work-scripts/ifcfg-NIC configuration file
gateway= Gateway IP
Systemctl Restart Network
Example: Setting up a gateway
Setting a global Gateway
A. Close the NetworkManager service
B. Modifying a configuration file
C.. Restart the network to view the gateway
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/89/13/wKiom1gG-s-RUT1dAAB5dQBnRNs370.png-wh_500x0-wm_3 -wmp_4-s_3656953339.png "style=" Float:none; "title=" 2.PNG "alt=" Wkiom1gg-s-rut1daab5dqbnrns370.png-wh_50 "/>
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/89/11/wKioL1gG_x7ScHXOAACPTPoT-S8948.png "title=" capture. PNG "alt=" Wkiol1gg_x7schxoaacptpot-s8948.png "/>
Setting the NIC interface Gateway
A. Modifying a configuration file
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/89/11/wKioL1gG-32CLlSIAAA1qJXd7Jg593.png-wh_500x0-wm_3 -wmp_4-s_192394684.png "style=" Float:none; "title=" 1.PNG "alt=" Wkiol1gg-32cllsiaaa1qjxd7jg593.png-wh_50 "/>
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/89/11/wKioL1gG-36TwvkVAABpuWzpLsY411.png-wh_500x0-wm_3 -wmp_4-s_2532218690.png "style=" Float:none; "title=" 3.PNG "alt=" Wkiol1gg-36twvkvaabpuwzplsy411.png-wh_50 "/>
B. Restart the network
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/89/13/wKiom1gG-3-TylsNAAAn7eleK2c805.png-wh_500x0-wm_3 -wmp_4-s_2220627493.png "style=" Float:none; "title=" 2.PNG "alt=" Wkiom1gg-3-tylsnaaan7elek2c805.png-wh_50 "/>
4 . View the Gateway
Route-n
## DNS Server # #
1 . dns--This server provides a function to answer the client hostname and IP correspondence
2 . Setting up DNS
Vim/etc/resolv.conf
NameServer DNS Server IP
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/89/11/wKioL1gG_YOhnoeZAAA-FkeI9Z8382.png-wh_500x0-wm_3 -wmp_4-s_1416368675.png "style=" Float:none; "title=" 1.PNG "alt=" Wkiol1gg_yohnoezaaa-fkei9z8382.png-wh_50 "/>
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/89/14/wKiom1gG_YPDt5gtAAApb0Bk5NA382.png-wh_500x0-wm_3 -wmp_4-s_2710688599.png "style=" Float:none; "title=" 2.PNG "alt=" Wkiom1gg_ypdt5gtaaapb0bk5na382.png-wh_50 "/>
vim/etc/sysconfig/network-scripts/ifcfg-NIC configuration file
Dns1=dns Server IP
3 . Local parsing file
Vim/etc/hosts
IP host Name
4 priority tuning of local parsing files and DNS reads
Vim/etc/nsswitch.conf
the : The Hosts files DNS files represent the local parsing file. DNS represents the DNS server, the one in front of that high priority
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/89/11/wKioL1gG_fqxlID7AAA2qiu3EHk777.png "style=" float: none; "Title=" Captures 2. PNG "alt=" Wkiol1gg_fqxlid7aaa2qiu3ehk777.png "/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/89/14/wKiom1gG_frAaT8DAAAbS05z9ag223.png "style=" float: none; "Title=" Captures 3. PNG "alt=" Wkiom1gg_fraat8daaabs05z9ag223.png "/>
## DHCP configuration file # #
Yum Install Dhcp-y
cp/usr/share/doc/dhcp-4.2.5/DHCPD.CONF.EXAMPLE/ETC/DHCP/DHCPD
<<< unit exercises >>
1 when executing set-ip-tool *) automatically displays the output of the ifconfig command
*) The system IP is set to: *) The system gateway is set to: 172.25.254.250
*) system DNS was set to: 172.25.254.250
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/89/14/wKiom1gG_uTymSDjAABuvBo524A563.png "title=" capture. PNG "alt=" Wkiom1gg_utymsdjaabuvbo524a563.png "/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/89/11/wKioL1gG_kLwHxMfAAERx_MbGCU001.png "title=" Capture 4. PNG "alt=" Wkiol1gg_klwhxmfaaerx_mbgcu001.png "/>
Linux note 10--Routers, DNS,DHCP configuration