linux双线路由,双线机房双IP linux设置路由

vi /etc/iproute2/rt_tables## reserved values#255     local254     main253     default0       unspec252     ct

251     cnc## local##1      inr.ruhepip route flush table ctip route add default via 电信网关IP dev 网卡号(比如:eth0) src 电信IP table ctip rule add from 电信IP table ctip route flush table cncip route add default via 网通网关IP dev 网卡号(比如:eth1) src 网通IP table cncip rule add from 网通IP table cnc以上脚本  做成 .sh脚本后  增加到服务器启动项查看路由ip route115.238.229.160/27 dev eth0  proto kernel  scope link  src 115.238.229.175101.64.237.0/26 dev eth1  proto kernel  scope link  src 101.64.237.43169.254.0.0/16 dev eth1  scope linkdefault via 115.238.229.161 dev eth0查看网关:route添加默认路由:route add �net 0.0.0.0 netmask 0.0.0.0 gw 192.168.0.1[root@localhost ~]# routeKernel IP routing tableDestination     Gateway         Genmask         Flags Metric Ref    Use Iface101.226.249.192 *               255.255.255.240 U     0      0        0 eth1210.51.47.128   *               255.255.255.128 U     0      0        0 eth0default         101.226.249.193 0.0.0.0         UG    0      0        0 eth1default         210.51.47.129   0.0.0.0         UG    0      0        0 eth0查看机器所有路由表详细情况ip route show table all查看表252的路由情况ip route list table 252查看简洁路由表信息ip route show allip route list刷新路由表ip route flush table 252

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值