One, add the route under Linux
1. Add default gateway: Route add default GW 192.168.1.1 or route add default dev eth1
2. Add route: Route add-net 172.16.1.0 netmask 255.255.255.0 GW 172.16.1.1
Route add-net 172.16.1.0 netmask 255.255.255.0 Dev eth0
3. Add a host route: Route add-host 172.16.1.1 GW 172.16.1.10
Route add-host 172.16.1.1 Dev eth0
4. Delete: Route del [Default/-host/-net]
5. View route: Route-n or Netstat-rn
Destination Gateway genmask Flags Metric Ref use Iface
192.168.60.3 192.168.60.1 255.255.255.255 UGH 0 0 0 eth1
172.17.46.0 172.17.46.1 255.255.255.0 UG 0 0 0 eth0
172.17.46.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.60.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
0.0.0.0 172.17.46.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 192.168.60.2 0.0.0.0 UG 0 0 0 eth1
This article is from the "Laoyaowst" blog, make sure to keep this source http://laoyaowst.blog.51cto.com/6113216/1543566
Linux Network commands