add 增加路由
del 刪除路由
via 網關出口 IP地址
dev 網關出口 物理設備名
ip route add 192.168.0.0/24 via 192.168.0.1
ip route add 192.168.1.1 dev 192.168.0.1
ip route del 192.168.0.0/24 via 192.168.0.1
[root@router ~]# ip route
192.168.5.0/24 dev eth0 proto kernel scope link src 192.168.5.47
192.168.3.0/24 dev eth0 proto kernel scope link src 192.168.3.47
default via 192.168.3.1 dev eth0
[root@router ~]# ip route change default via 192.168.5.1 dev eth0
[root@router ~]# ip route list
192.168.5.0/24 dev eth0 proto kernel scope link src 192.168.5.47
192.168.3.0/24 dev eth0 proto kernel scope link src 192.168.3.47
default via 192.168.5.1 dev eth0
192.168.0.1 是我的預設路由器
ip route add default via 192.168.0.1 dev eth0