Skip to contentSkip to conversation

ROUTE target and conntrack

DISCUSSION Torsten Luettgert 2 participants 2 messages Dec 11, 2006 netfilter

lore
Share & tools
lore
#0 lore raw

Hi Cédric,

I'm heavily using your excellent ROUTE target from the linux netfilter patch-o-matic-ng.

Recently, I noticed that outgoing packets routed out with ROUTE don't seem to trigger connection tracking. E.g. after

iptables -A INPUT -p udp -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -p udp -j DROP

iptables -t mangle -A POSTROUTING -s $NW1 -j ROUTE --gw $GW1

where NW1 contains my primary address on the uplink interface kills DNS lookups. I see the udp packets go out and in with tcpdump, but there's no entry in /proc/net/ip_conntrack, so the incoming answer is dropped.

If I use this instead, it works:

iptables -t mangle -A POSTROUTING -s $NW1 -j ROUTE --gw $GW1 --continue iptables -t mangle -A POSTROUTING -s $NW1 -j ACCEPT

Question: is what those 2 lines do (with respect to routing) identical to what the one line above does?

Is it possible to "fix" the ROUTE target so conntracking is not bypassed?

Thanks in advance,
Torsten

#1 lore raw
Quoted 8 lines

iptables -A INPUT -p udp -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -p udp -j DROP

iptables -t mangle -A POSTROUTING -s $NW1 -j ROUTE --gw $GW1

If I use this instead, it works:

Quoted 8 lines

iptables -t mangle -A POSTROUTING -s $NW1 -j ROUTE --gw $GW1 --continue iptables -t mangle -A POSTROUTING -s $NW1 -j ACCEPT

Question: is what those 2 lines do (with respect to routing) identical to what the one line above does?

Is it possible to "fix" the ROUTE target so conntracking is not bypassed?

Except from ipt_ROUTE.c, all looks normal to me:

                dev_put(dev_out);
                if (route_info->flags & IPT_ROUTE_CONTINUE)
                        return IPT_CONTINUE;

                ip_direct_send(skb);
                return NF_STOLEN;


	-`J'