linux路由

在默认路由表添加路由
ip route add 网络 via 网关 dev 网卡

在指定路由表添加路由
ip route add 网络 via 网关 dev 网卡 table 路由表

查看默认路由表路由
ip route

查看指定路由表路由
ip route show table 路由表
ip route list table 路由表


策略路由
ip rule add from IP table 100

查看策略路由
ip rule


建立特殊路由表
vi /etc/iproute2/rt_tables

例子:
ip route add 3.3.3.0/24 via 192.168.144.1 dev eth1 table 22
ip route show table 22

 

试试Linux下的ip命令,ifconfig已经过时了

posted on 2016-03-02 17:28  yilipika  阅读(179)  评论(0编辑  收藏  举报