Home > OS >  Iptables policy routing, return routing problem
Iptables policy routing, return routing problem

Time:11-10

Article is agent, centos do 20 broadband every article has a public IP, in through one of the IP connection, export is the default routing, I need to go according to the port in different lines, now my side do policy routing, don't know where I went wrong, hope big directions!
Currently set port 30001 in the data, finally walk ppp0 out,



 iptables -a PREROUTING -t mangle -p TCP -- dport 30001 - j MARK - set - MARK 8 
The iptables -a PREROUTING -t mangle - j CONNMARK - save - mark
The iptables -a PREROUTING -t mangle - j CONNMARK - restore - mark
IP add rule from all fwmark 8 table 9
IP route add 0/0 dev ppp0 scope link table 9
IP route to flush the cache

CodePudding user response:

Didn't match any iptables export routing, and learning
  • Related