Linux添加原路返回路由 解决 服务器电信+网通双线双网卡双IP访问 问题。
TEL="eth0" TEL_IP="114.80.66.145" TEL_GW="114.80.66.1" CNC="eth1" CNC_IP="60.29.231.160" CNC_GW="60.29.231.1" echo "252 TEL" >> /etc/iproute2/rt_tables echo "251 CNC" >> /etc/iproute2/rt_tables echo "ip route replace default via $TEL_GW dev $TEL" >> /etc/rc.d/rc.local echo "ip route flush table TEL" >> /etc/rc.d/rc.local echo "ip route add default via $TEL_GW dev $TEL src $TEL_IP table TEL" >> /etc/rc.d/rc.local echo "ip rule add from $TEL_IP table TEL" >> /etc/rc.d/rc.local echo "ip route flush table CNC" >> /etc/rc.d/rc.local echo "ip route add default via $CNC_GW dev $CNC src $CNC_IP table CNC" >> /etc/rc.d/rc.local echo "ip rule add from $CNC_IP table CNC" >> /etc/rc.d/rc.local
收藏此文章 打印 更新 编辑此文章 『关闭窗口』