Article 5N51F Route Traffic back to the same interface it came from

Route Traffic back to the same interface it came from

by
dr.x
from LinuxQuestions.org on (#5N51F)
To be clear , The traffic incident to the interface can be Established comming back traffic
OR
New traffic being generated and send to interface "koki"

############################################################

ip rule add from all fwmark 100 lookup koki
iptables -t mangle -A INPUT -i koki -j MARK --set-mark 100
iptables -t mangle -A PREROUTING -i koki -j MARK --set-mark 100
#######################################################

ip route show table koki
default via 10.219.203.2 dev koki
###################################

iptables -t mangle -L -n -v
Chain PREROUTING (policy ACCEPT 69M packets, 66G bytes)
pkts bytes target prot opt in out source destination
44053 2417K MARK all -- koki * 0.0.0.0/0 0.0.0.0/0 MARK set 0x64

Chain INPUT (policy ACCEPT 69M packets, 66G bytes)
pkts bytes target prot opt in out source destination
2715 2921K MARK all -- koki * 0.0.0.0/0 0.0.0.0/0 MARK set 0x64

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 74M packets, 72G bytes)
pkts bytes target prot opt in out source destination

Chain POSTROUTING (policy ACCEPT 74M packets, 72G bytes)
pkts bytes target prot opt in out source destination

#########################################

BASED ON above , i can see the traffic is marked to 0x64 and the rule 0x64 shoud have default route back over default via 10.219.203.2 dev koki

But in production , We cant see any traffic being routed based on the rule 0x64 .

So basically its matched in the mangle table , But for some reason i may be missing something somewhere else .

Hope to help.

Thankslatest?d=yIl2AUoC8zA latest?i=WI0wF4MWZaA:1L4_jVSPq7Q:F7zBnMy latest?i=WI0wF4MWZaA:1L4_jVSPq7Q:V_sGLiP latest?d=qj6IDK7rITs latest?i=WI0wF4MWZaA:1L4_jVSPq7Q:gIN9vFwWI0wF4MWZaA
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments