環境以下:linux
host1 單網卡 eth0 172.24.100.15/16bash
host2 雙網卡 eth0 172.24.100.14/16 eth1 192.168.122.214/24ide
host3 單網卡 eth0 192.168.122.215/24spa
整個環境以下圖:code
無圖blog
要求:讓host1和host3互通,也就是host1能ping通host3,host3也能ping通host1token
解決:ip
第一,在host2上,保證能同時ping通host1和host3路由
第二,在host1上,添加路由以下get
第三,在host2上,添加路由以下
第四,仍是在host2上,開啓路由轉發以下
第五,在host3上,添加路由以下
這樣相互就能ping通,是否是很神奇