Skip to contentSkip to conversation

ipt_ROUTE for kernel 2.6.21.5

PATCH In review Ludovic 5 participants 14 messages Jul 30, 2007 – Aug 30, 2007 netfilter

lore
Share & tools
lore

Ludovic

author
#0 lore raw

PATCH 1/1 ipt_ROUTE for kernel 2.6.21.5

Hi guys,

sorry if there is already some patches about this but i've searched one week how to make the ROUTE target work well.

Here are two patches (one for ipv4 and one for ipv6) which change ipt_register and ipt_unregister to xt_register and xt_unregister and which add .family = AF_INET in the xt_target structure declaration.

Best regards.
Ludovic.

#1 lore raw
Quoted 8 lines · Ludovic

Hi guys,

sorry if there is already some patches about this but i've searched one week how to make the ROUTE target work well.

Here are two patches (one for ipv4 and one for ipv6) which change ipt_register and ipt_unregister to xt_register and xt_unregister and which add .family = AF_INET in the xt_target structure declaration.

Somehow this feels like déjà-vu. ipt_ROUTE is, well, a hack and the proper solution to it is policy routing; e.g. based on fwmark.

Jan

#2 lore raw
Quoted 5 lines · Jan Engelhardt
Quoted 3 lines · Ludovic

sorry if there is already some patches about this but i've searched one week how to make the ROUTE target work well.

Quoted 7 lines
Quoted 3 lines

Here are two patches (one for ipv4 and one for ipv6) which change ipt_register and ipt_unregister to xt_register and xt_unregister and which add .family = AF_INET in the xt_target structure declaration.

Somehow this feels like déjà-vu. ipt_ROUTE is, well, a hack and the proper solution to it is policy routing; e.g. based on fwmark.

Fully agreed (well, I made that argument for ages), I think we should simply remove it from pomng to avoid misleading users into thinking it would be the proper way to do things.

#3 lore raw
Quoted 11 lines · Patrick McHardy
Quoted 10 lines · Jan Engelhardt
Quoted 6 lines · Ludovic

sorry if there is already some patches about this but i've searched one week how to make the ROUTE target work well.

Here are two patches (one for ipv4 and one for ipv6) which change ipt_register and ipt_unregister to xt_register and xt_unregister and which add .family = AF_INET in the xt_target structure declaration.

Quoted 8 lines
Quoted 2 lines

Somehow this feels like déjà-vu. ipt_ROUTE is, well, a hack and the proper solution to it is policy routing; e.g. based on fwmark.

Fully agreed (well, I made that argument for ages), I think we should simply remove it from pomng to avoid misleading users into thinking it would be the proper way to do things.

I second that idea.

Jan

#4 lore raw
Quoted 8 lines · Jan Engelhardt
Quoted 4 lines · Patrick McHardy

Fully agreed (well, I made that argument for ages), I think we should simply remove it from pomng to avoid misleading users into thinking it would be the proper way to do things.

I second that idea.

Its gone now ..

#5 lore raw
Quoted 8 lines · Patrick McHardy
Quoted 7 lines · Jan Engelhardt
Quoted 4 lines · Patrick McHardy

Fully agreed (well, I made that argument for ages), I think we should simply remove it from pomng to avoid misleading users into thinking it would be the proper way to do things.

Quoted 4 lines
Quoted 1 line

I second that idea.

Its gone now ..

1. ROUTE has a very usefull option --tee. AFAIK it is not possible to do it other way.
2. Policy routing based on fwmark is not always an option if you use marks for other purposes.

So, if it is going to be removed from pom-ng I would like to keep it in my external pomng-repository.

Best regards,

Krzysztof Olędzki

#6 lore raw
Quoted 2 lines · Krzysztof Oledzki

1. ROUTE has a very usefull option --tee. AFAIK it is not possible to do it other way.

Thats true. Not sure in what practical situation it is used though.

Quoted 2 lines

2. Policy routing based on fwmark is not always an option if you use marks for other purposes.

Maybe (trying to avoid getting into discussion about too small mark values again :)).

Quoted 2 lines

So, if it is going to be removed from pom-ng I would like to keep it in my external pomng-repository.

Please go ahead.

Just FYI: One more reason for removing it is that its broken wrt. IPsec handling and the duplicated functions from ip_output are out of sync (and I think there were a few smaller problems as well). If there really is a need for something like the tee functionality I'm not opposed to considering merging a clean patch without these problems for that.

#7 lore raw
Quoted 4 lines
Quoted 2 lines

1. ROUTE has a very usefull option --tee. AFAIK it is not possible to do it other way.

Thats true. Not sure in what practical situation it is used though.

iptables -A INPUT -p tcp --dport 25 -j ROUTE --tee --gw lawful.inspection.box

In other words: network traffic taps.

If the feature is removed from POM, I'll probably be forced by colleagues to maintain it in some other form. Sigh.

best regards
Patrick

#8 lore raw
Quoted 9 lines · Patrick Schaaf
Quoted 4 lines
Quoted 2 lines

1. ROUTE has a very usefull option --tee. AFAIK it is not possible to do it other way.

Thats true. Not sure in what practical situation it is used though.

iptables -A INPUT -p tcp --dport 25 -j ROUTE --tee --gw lawful.inspection.box

In other words: network traffic taps.

Yeah, I was already thinking of that, but bonding allows to do that on a per-device base. Not sure if that helps ..

Quoted 2 lines

If the feature is removed from POM, I'll probably be forced by colleagues to maintain it in some other form. Sigh.

Krzysztof expressed interest in maintaining it ..

#9 lore raw
In reply to Patrick McHardy
Quoted 11 lines · Patrick McHardy
Quoted 2 lines · Krzysztof Oledzki

1. ROUTE has a very usefull option --tee. AFAIK it is not possible to do it other way.

Thats true. Not sure in what practical situation it is used though.

Quoted 2 lines

2. Policy routing based on fwmark is not always an option if you use marks for other purposes.

Quoted 8 lines

Maybe (trying to avoid getting into discussion about too small mark values again :)).

Quoted 2 lines

So, if it is going to be removed from pom-ng I would like to keep it in my external pomng-repository.

Please go ahead.

So I added it to my pom-ng repository for now, with fixes for 2.6.21/2.6.22.

Quoted 2 lines

Just FYI: One more reason for removing it is that its broken wrt. IPsec handling

Could you explain it a bit? What is wrong and maybe some clue how it should be fixed?

Quoted 2 lines

and the duplicated functions from ip_output are out of sync

OK, found it. This is a easy part to fix. :)

Quoted 1 line

(and I think there were a few smaller problems as well).

For example?

Quoted 3 lines

If there really is a need for something like the tee functionality I'm not opposed to considering merging a clean patch without these problems for that.

OK. I'll do my best. :)

Best regards,

Krzysztof Olędzki

#10 lore raw
Quoted 6 lines · Krzysztof Oledzki
Quoted 3 lines

Just FYI: One more reason for removing it is that its broken wrt. IPsec handling

Could you explain it a bit? What is wrong and maybe some clue how it should be fixed?

ip_direct_send does not do IPSEC IIRC.

Jan

#11 lore raw
Quoted 10 lines · Jan Engelhardt
Quoted 6 lines · Krzysztof Oledzki
Quoted 3 lines

Just FYI: One more reason for removing it is that its broken wrt. IPsec handling

Could you explain it a bit? What is wrong and maybe some clue how it should be fixed?

ip_direct_send does not do IPSEC IIRC.

Neither ip_finish_output2 which is a place from this code comes from. Anyway, I found that indeed ip_finish_output, which calls ip_finish_output2, contains xfrm code:

#if defined(CONFIG_NETFILTER) && defined(CONFIG_XFRM)
        /* Policy lookup after SNAT yielded a new policy */
        if (skb->dst->xfrm != NULL) {
                IPCB(skb)->flags |= IPSKB_REROUTED;
                return dst_output(skb);
        }

#endif

Is that all?

So, how it should work with ROUTE? I assume that teed packets shouldn't go via xfrm, neither directly (--gw, --oif) routed packets if there is no tee, right?

Best regards,

Krzysztof Olędzki

#12 lore raw
Quoted 8 lines · Krzysztof Oledzki
Quoted 6 lines · Jan Engelhardt
Quoted 4 lines · Krzysztof Oledzki
Quoted 3 lines

Just FYI: One more reason for removing it is that its broken wrt. IPsec handling

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Could you explain it a bit? What is wrong and maybe some clue how it should be fixed?

[...]

Is that all?

Can you point me to the latest source please?

#13 lore raw
Quoted 7 lines · Patrick McHardy
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

Just FYI: One more reason for removing it is that its broken wrt. IPsec handling

Could you explain it a bit? What is wrong and maybe some clue how it should be
fixed?

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

[...]

Is that all?

Can you point me to the latest source please?

See the xt_TEE thread; the mail with the plain files I sent.

Jan