前景提要
HDC调试需求开发(15万预算),能者速来!>>>
各位大侠,遇到一个恼人的问题,这样实现的策略路由怎么就不通了呢?
linux服务器有两块网卡,外网210.28.x.x,内网192.168.1.246,网关是192.168.1.254。
现在希望通过ipset+策略路由实现的分线路:访问42.159.28.168(ip.cn)时,从192.168.1.254(enp1s5)这条线路走。 echo "200 edu" >>/etc/iproute2/rt_tables ipset create edu hash:ip --hashsize 20000 --probes 2 iptables -t mangle -A PREROUTING -m set --match-set edu dst -j MARK --set-mark 200 iptables -t mangle -A PREROUTING -m set --match-set edu dst -j MARK --set-mark 0xc8 ip rule add fwmark 200 table edu ip route add default via 192.168.1.254 dev enp1s5 table edu ip route flush cache ipset -A edu 42.159.28.168 curl ip.cn 但结果,不管怎么设置,就是不成功。各路大侠,请不吝赐教啊![root@234 ~]# ip rule show 0: from all lookup local 32765: from all fwmark 0xc8 lookup edu 32766: from all lookup main 32767: from all lookup default [root@234 ~]# ip route show table edu default via 192.168.1.254 dev enp1s5
各位大侠,拜托看看啊