我想将 Ubuntu 12.04 配置为路由器。这台 Ubuntu PC 有 3 个网卡
eth0:192.168.1.203 (LAN1)
eth1:172.16.30.21 (Internet)
eth2:10.216.1.107 (LAN2)
Run Code Online (Sandbox Code Playgroud)
和
$ route -n
Kernel IP routing table
Destination Gateway Genmask Indic Metric Ref Use Iface
0.0.0.0 172.16.30.1 0.0.0.0 UG 0 0 0 eth1
10.216.1.0 10.216.1.1 255.255.255.0 UG 0 0 0 eth2
10.216.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth2
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth2
172.16.30.0 0.0.0.0 255.255.255.0 U 1 0 0 eth1
192.168.0.0 192.168.1.3 255.255.0.0 UG 0 0 0 eth0
192.168.1.0 …Run Code Online (Sandbox Code Playgroud)