The environment is as follows:
Host1 single NIC Eth0 172.24.100.15/16
Host2 dual nic eth0 172.24.100.14/16 eth1 192.168.122.214/24
Host3 single NIC Eth0 192.168.122.215/24
The entire environment such as:
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/86/33/wKioL1e3yZ6DIIxTAAGXBSD_-Gc165.png "title=" 1.png " alt= "Wkiol1e3yz6diixtaagxbsd_-gc165.png"/>
Requirements: Let host1 and HOST3 interoperability, that is, host1 can ping host3,host3 can ping through host1
Solve:
First, on the HOST2, ensure that you can ping host1 and host3 at the same time
Second, on the host1, add the following route
Route add default GW 172.24.100.14 #添加默认网关路由 to ensure that requests from host1 to 192.168.122.0/24 network segment arrive first Host2
Third, on the HOST2, add the following route
Route add-net 172.24.0.0 netmask 255.255.0.0 dev eth0 #添加路由, actually refers to the road, designated to the 172.24.0.0/16 network segment to go to the request through the ETH0 network card out of the route ad D-net 192.168.122.0 netmask 255.255.255.0 dev eth1 #添加路由, specify the request to the 192.168.122.0/24 network segment to go out with the ETH1 network card
Four, or on the Host2, turn on route forwarding as follows
Echo 1 >/proc/sys/net/ipv4/ip_forward
Five, on Host3, add the following route
Route add default GW 192.168.122.214 #添加默认网关路由 to ensure that requests from HOST3 to 172.24.0.0/16 network segment arrive first Host2
It's amazing how you can ping each other.
Linux environment, two different network segments of the machine interoperability