一、处理经过
[idctest@guangzhou_1 ~]$ sudo /sbin/ip rule list [sudo] password for idctest: Sorry, try again. [idctest@guangzhou_1 ~]$ sudo /sbin/ip rule list [sudo] password for idctest: Sorry, try again. [sudo] password for idctest: 0: from all lookup 255 32758: from 163.177.181.110 lookup uni 32759: from 120.31.132.223 lookup tel 32760: from 163.177.181.110 lookup uni 32761: from 120.31.132.223 lookup tel 32762: from 163.177.181.110 lookup uni 32763: from 120.31.132.223 lookup tel 32764: from 163.177.181.110 lookup uni 32765: from 120.31.132.223 lookup tel 32766: from all lookup main 32767: from all lookup default
[idctest@guangzhou_1 ~]$ sudo /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
120.31.132.128 0.0.0.0 255.255.255.128 U 0 0 0 eth0
163.177.181.0 0.0.0.0 255.255.255.128 U 0 0 0 eth1
192.168.7.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
192.168.6.0 0.0.0.0 255.255.255.0 U 0 0 0 eth3
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth3
0.0.0.0 120.31.132.129 0.0.0.0 UG 0 0 0 eth0
[idctest@guangzhou_1 etc]$ sudo /sbin/service network restart Shutting down interface eth0: [ OK ] Shutting down interface eth1: [ OK ] Shutting down interface eth2: [ OK ] Shutting down interface eth3: [ OK ] Shutting down loopback interface: [ OK ] Disabling IPv4 packet forwarding: net.ipv4.ip_forward = 0 [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: [ OK ] Bringing up interface eth1: [ OK ] Bringing up interface eth2: [ OK ] Bringing up interface eth3: [ OK ] [idctest@guangzhou_1 etc]$ sudo echo 1 >/proc/sys/net/ipv4/ip_forward -bash: /proc/sys/net/ipv4/ip_forward: Permission denied
左边正常双网卡双ip,单网关策略路由,不同vlan 右边一条上联口,vlan1是客户的交换机,双网卡双ip,单网关策略路由,相同vlan 右边网络不刷策略路由不刷路由表,可以通 正常所有都走电信网关
当刷策略路由或者刷路由表的时候,不能通 因为eth1网卡不能转发ipv4数据,所以不能从联通的ip走联通网关出去 [idctest@guangzhou_1 ~]$ sudo /sbin/service network restart Shutting down interface eth0: [ OK ] Shutting down interface eth1: [ OK ] Shutting down interface eth2: [ OK ] Shutting down interface eth3: [ OK ] Shutting down loopback interface: [ OK ] Disabling IPv4 packet forwarding: net.ipv4.ip_forward = 0 [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: [ OK ] Bringing up interface eth1: [ OK ] Bringing up interface eth2: [ OK ] Bringing up interface eth3: [ OK ] [idctest@guangzhou_1 ~]$ sudo /sbin/ip route add default via 163.177.181.1 dev eth1 src 163.177.181.110 table uni [idctest@guangzhou_1 ~]$ sudo /sbin/ip rule add from 163.177.181.110 table uni
[idctest@guangzhou_1 ~]$ sudo /sbin/route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 120.31.132.128 0.0.0.0 255.255.255.128 U 0 0 0 eth0 163.177.181.0 0.0.0.0 255.255.255.128 U 0 0 0 eth1 192.168.7.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2 192.168.6.0 0.0.0.0 255.255.255.0 U 0 0 0 eth3 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth3 0.0.0.0 120.31.132.129 0.0.0.0 UG 0 0 0 eth0
由睿江云运维人员提供,想了解更多,请登陆www.eflycloud.com