|
|
我在一张网卡上绑定两个IP
inet 172.31.0.1/24 brd 172.31.255.255 scope global eth1
inet 172.31.1.1/24 brd 172.31.255.255 scope global eth1:1
接口下面连接一太交换机,把1口和2口分别打tag,然后在LINUX下做以下设置:
#vconfig add eth1 1
#vconfig add eth1 2
#ip address add 172.31.0.1 dev eth1.1
#ip address add 172.31.1.1 dev eth1.2
#ip link set dev eth1.1 up
#ip link set dev eth1.2 up
编辑/etc/iproute2/rt_tables文件,在文件的尾部加入下面的两行:
100 one (将编号为100 的路由策略命名为one)
110 two(将编号为110的路由策略命名为two)
#ip route add 172.31.0.0/24 dev eth1.1 table one
#ip route add 172.31.1.0/24 dev eth1.2 table two
但是重下面的PC走不到我的机器上来,高手指点指点,谢谢~~ |
|