- 论坛徽章:
- 0
|
已经搞定了!可能还有问题,但是解决了目前的问题.
更正一下rc.local内容
在rc.local中添加了以下一段:
route add -net 0.0.0.0/0 netmask 0.0.0.0 dev eth0
route add -net 0.0.0.0/0 netmask 0.0.0.0 dev eth1
route add -net 0.0.0.0/0 netmask 0.0.0.0 dev eth2
route add -net 0.0.0.0/0 netmask 0.0.0.0 dev eth3
ip route add to 0.0.0.0/0 dev eth0 table 10
ip rule add from 192.168.2.1/32 table 10
ip route add to 0.0.0.0/0 dev eth1 table 20
ip rule add from 192.168.2.2/32 table 20
ip route add to 0.0.0.0/0 dev eth2 table 30
ip rule add from 192.168.2.3/32 table 30
ip route add to 0.0.0.0/0 dev eth3 table 40
ip rule add from 192.168.2.4/32 table 40
这样可以通过ping 命令ping通各个口,在程序处理中,需要注意的是建立tcp客户端时,需要bind一个网卡的ip。
我的QQ:1176479828 |
|