I. Introduction to the Environment
Version 1.linux: CentOS6.8, CentOS7.2 two hosts load two NICs, respectively, as two ports 2 of the router. Experiment completed in VMware Virtual Machine 3. There are two CentOS6.8 and CentOS7.2 as host two for 4 segments. Experiment Diagram:
650) this.width=650; "title=" 11.PNG "style=" height:434px;width:601px; "src=" http://s3.51cto.com/wyfs02/M02/86/FA/ Wkiol1fqfb-tr17yaaennw5fnca428.png "width=" 763 "height=" 477 "alt=" Wkiol1fqfb-tr17yaaennw5fnca428.png "/>
Two, routing 1 (left) and Routing 2 (right) settings
1. Routing 1 Configuration Information
Eth0 network card: Device=eth0 ipaddr=10.0.0.1 prefix=9eth1 network card: device=eth1 ipaddr=192.168.0.1 prefix=22
Icon:
650) this.width=650; "title=" 11.PNG "style=" HEIGHT:262PX;WIDTH:687PX; "src=" http://s1.51cto.com/wyfs02/M00/86/FA/ Wkiol1fqffrdgkznaafeodvyysg414.png "width=" 752 "height=" 281 "alt=" Wkiol1fqffrdgkznaafeodvyysg414.png "/>
650) this.width=650, "style=" Border-top: #ddd 1px solid;border-right: #ddd 1px solid;background:url ("/e/u261/lang/ Zh-cn/images/localimage.png ") no-repeat center;border-bottom: #ddd 1px solid;border-left: #ddd 1px solid;" alt= "image" Src= "/e/u261/themes/default/images/spacer.gif"/>2. Routing 2 configuration information
Eth0 network card: Device=eth0 ipaddr=10.0.0.2 prefix=9eth1 network card: device=eth1 ipaddr=172.16.0.1 prefix=23
Icon:
650) this.width=650, "style=" Border-top: #ddd 1px solid;border-right: #ddd 1px solid;background:url ("/e/u261/lang/ Zh-cn/images/localimage.png ") no-repeat center;border-bottom: #ddd 1px solid;border-left: #ddd 1px solid;" alt= "image" src= "/e/u261/themes/default/images/spacer.gif"/>
650) this.width=650; "title=" 11.PNG "style=" height:229px;width:715px; "src=" http://s5.51cto.com/wyfs02/M02/86/FA/ Wkiol1fqfjaasdgtaaf47mbj8_q613.png "width=" 744 "height=" 244 "alt=" Wkiol1fqfjaasdgtaaf47mbj8_q613.png "/>
3. Restart the network service and turn on the route forwarding function
This is a temporary start, if you want to permanently start the route forwarding feature you need to write to the/etc/sysctl.conf file to include: ipv_ipforward=1
650) this.width=650, "style=" Border-top: #ddd 1px solid;border-right: #ddd 1px solid;background:url ("/e/u261/lang/ Zh-cn/images/localimage.png ") no-repeat center;border-bottom: #ddd 1px solid;border-left: #ddd 1px solid;" alt= "image" Src= "/e/u261/themes/default/images/spacer.gif"/>650) this.width=650; style= border-top: #ddd 1px solid; Border-right: #ddd 1px solid;background:url ("/e/u261/lang/zh-cn/images/localimage.png") no-repeat Center; Border-bottom: #ddd 1px solid;border-left: #ddd 1px solid; "alt=" image "src="/e/u261/themes/default/images/spacer.gif " />
650) this.width=650; "title=" 11.PNG "style=" height:523px;width:718px; "src=" http://s5.51cto.com/wyfs02/M00/86/FB/ Wkiom1fqfnatvkxfaanfi_uzrzq428.png "width=" 739 "height=" 638 "alt=" Wkiom1fqfnatvkxfaanfi_uzrzq428.png "/>
650) this.width=650; "title=" 11.PNG "style=" height:430px;width:725px; "src=" http://s2.51cto.com/wyfs02/M01/86/FB/ Wkiom1fqfqzccx98aakmvirvls8401.png "width=" 732 "height=" 538 "alt=" Wkiom1fqfqzccx98aakmvirvls8401.png "/>
4. Setting the Routing gateway Information   650) this.width=650; style= border-top: #ddd 1px solid ; Border-right: #ddd 1px solid;background:url ("/e/u261/lang/zh-cn/images/localimage.png") no-repeat Center; Border-bottom: #ddd 1px solid;border-left: #ddd 1px solid; "alt=" image "src="/e/u261/themes/default/images/spacer.gif " />650) this.width=650, "style=" Border-top: #ddd 1px solid;border-right: #ddd 1px solid;background:url ("/e/u261/lang /zh-cn/images/localimage.png ") no-repeat center;border-bottom: #ddd 1px solid;border-left: #ddd 1px solid;" alt= "image" Src= "/e/u261/themes/default/images/spacer.gif"/>
650) this.width=650; "title=" 11.PNG "style=" height:480px;width:730px; "src=" http://s4.51cto.com/wyfs02/M02/86/FA/ Wkiol1fqfyjjn9fgaai-obqcl2q926.png "width=" "height=" 532 "alt=" Wkiol1fqfyjjn9fgaai-obqcl2q926.png "/>
Third, host settings
-
Left host network configuration and start
650) this.width=650; "title=" 11.PNG "style=" height:480px;width:670px; "src=" http://s2.51cto.com/wyfs02/M01/86/FC/ Wkiom1fqfcorf1zmaahu6401iig089.png "width=" 752 "height=" 452 "alt=" Wkiom1fqfcorf1zmaahu6401iig089.png "/>
650) this.width=650, "style=" Border-top: #ddd 1px solid;border-right: #ddd 1px solid;background:url ("/e/u261/lang/ Zh-cn/images/localimage.png ") no-repeat center;border-bottom: #ddd 1px solid;border-left: #ddd 1px solid;" alt= "image" src= "/e/u261/themes/default/images/spacer.gif"/>
2. Right-side Host network configuration and startup
650) this.width=650; "title=" 11.PNG "style=" height:390px;width:708px; "src=" http://s5.51cto.com/wyfs02/M00/86/FA/ Wkiol1fqfe6d4y6baaf6xxep4jg149.png "width=" 751 "height=" 354 "alt=" Wkiol1fqfe6d4y6baaf6xxep4jg149.png "/>
650) this.width=650, "style=" Border-top: #ddd 1px solid;border-right: #ddd 1px solid;background:url ("/e/u261/lang/ Zh-cn/images/localimage.png ") no-repeat center;border-bottom: #ddd 1px solid;border-left: #ddd 1px solid;" alt= "image" src= "/e/u261/themes/default/images/spacer.gif"/> Four, the test, Host 1 and host 2 ping each other and through the TTL information viewing through two routers. 650) this.width=650, "style=" Border-top: #ddd 1px solid;border-right: #ddd 1px solid;background:url ("/e/u261/lang/ Zh-cn/images/localimage.png ") no-repeat center;border-bottom: #ddd 1px solid;border-left: #ddd 1px solid;" alt= "image" Src= "/e/u261/themes/default/images/spacer.gif"/>650) this.width=650; style= border-top: #ddd 1px solid; Border-right: #ddd 1px solid;background:url ("/e/u261/lang/zh-cn/images/localimage.png") no-repeat Center; Border-bottom: #ddd 1px solid;border-left: #ddd 1px solid; "alt=" image "src="/e/u261/themes/default/images/spacer.gif " />650) this.width=650; "title=" 11.PNG "style=" height:393px;width:730px; "src=" http://s2.51cto.com/wyfs02/M01/86 /fa/wkiol1fqfhmwl-jgaaka8vjfgvg545.png "width=" "height=" 546 "alt=" Wkiol1fqfhmwl-jgaaka8vjfgvg545.png "/>
650) this.width=650; "title=" 11.PNG "style=" HEIGHT:393PX;WIDTH:727PX; "src=" http://s1.51cto.com/wyfs02/M02/86/FA/ Wkiol1fqfkzhq1ozaaj2il-x2ta786.png "width=" 744 "height=" 533 "alt=" Wkiol1fqfkzhq1ozaaj2il-x2ta786.png "/>
This article is from "vinegar with soy sauce bottles" blog, please be sure to keep this source http://sauce.blog.51cto.com/11880696/1847461
Linux for Routing and routing forwarding