Skip to contentSkip to conversation

rp_filter

DISCUSSION Stephen Frost 3 participants 5 messages Dec 27, 2002 – Jan 8, 2003 netfilter

lore
Share & tools
lore
#0 lore raw

Hey all,

Can we *please* move the rp_filter cruft into the firewalling code proper? I've had yet another friend come to me asking for help after fighting with his iptables setup for 6 hours trying to get it to work to discover the whole problem was rp_filter getting in the way. If rp_filter was part of the actual firewalling code where it should be people wouldn't run into this stupid problem.

rp_filter is an obscure option that only the poor souls who ran into it know about. I've met people who have implemented it all by hand in iptables because they didn't know it existed, and then didn't entirely trust it. The people who need the option (those who actually run routers or firewalls) know they need it and will take care of having it enabled in their firewalling code, for most people (desktop users and whatnot) it's useless anyway because they've only got one interface.

Stephen

#1 lore raw

Stephen,

Quoted 2 lines

Can we *please* move the rp_filter cruft into the firewalling code proper?

If that's not a joke, please take your cruisade to the linux-net mailing list. It is not up to netfilter / iptables developers to even think about removal of base network stack features, in my opinion. Convince Dave Miller and Alexey Kusnetsov (speling probably wrong, sorry).

I'll refrain from speaking against the idea itself, here.

best regards
Patrick

#3 lore raw
In reply to Stephen Frost

Stephen & all,

Quoted 2 lines

Can we *please* move the rp_filter cruft into the firewalling code proper?

Upon thinking a bit more about your request, there is one thing that annoys me about rp_filter, and where iptables may eventually
help: there was (and probably is) the idea of a DROP table, where you can LOG packets coming from all kinds of drop sites within the network stack. It would be great if I had a way to LOG packets rejected by rp_filter. IMHO the big problem to the unwary end-user, is the _invisibility_ of the drops caused by rp_filter.

A simple net_ratelimit()ed printk() in the appropriate place, would already help a lot. If you walk your request over to linux-net, maybe you could make that your fallback position :-)

best regards
Patrick

#2 lore raw
In reply to Patrick Schaaf
Quoted 11 lines · * Patrick Schaaf ([email protected]) wrote:

Stephen,

Quoted 2 lines

Can we *please* move the rp_filter cruft into the firewalling code proper?

If that's not a joke, please take your cruisade to the linux-net mailing list. It is not up to netfilter / iptables developers to even think about removal of base network stack features, in my opinion. Convince Dave Miller and Alexey Kusnetsov (speling probably wrong, sorry).

I'll refrain from speaking against the idea itself, here.

If we had the functionality in netfilter to do what rp_filter does now I think it'd make for a much better case to get rid of it as it exists. For that I think we'd need a match target that checked source IP and incoming interface and compared it against the routing table. Not something I'd expect to be very difficult...

I'll see about bringing it up on the linux-net list if this seems like a reasonable thing to add to netfilter. I certainly agree about one of the problems with rp_filter being that it's not noisy about things it drops (by default at least, I think there may be an option to turn on logging of it). It would seem reasonable to me to have the parts of the kernel that drop packets following some administrative rule be under the firewalling framework instead of elsewhere throughout the kernel.

Stephen

#4 lore raw
In reply to Patrick Schaaf
Quoted 2 lines
Quoted 2 lines

Can we *please* move the rp_filter cruft into the firewalling code proper?

I agree with Patrick on that it is not an intelligent idea to touch core network stuff in the netfilter code. Especially I seem to see more and more routing related POM patches for netfilter while I wonder what issues people really have with the current routing code which is where rp_filter belongs to?

Quoted 5 lines

Upon thinking a bit more about your request, there is one thing that annoys me about rp_filter, and where iptables may eventually
help: there was (and probably is) the idea of a DROP table, where you can LOG packets coming from all kinds of drop sites within the network stack. It would be great if I had a way to LOG packets

I've once started it but due to the network core's diversity in handling such cases I've stopped doing it. You get everything from silent drop via kfree over skb_free over return EINVAL over goto drop and so on ...

Quoted 2 lines

rejected by rp_filter. IMHO the big problem to the unwary end-user, is the _invisibility_ of the drops caused by rp_filter.

That is a general nuisance and setting verbose_route_log and log_martians already helps a bit but most of the FIB related errors don't get logged. I know what you're talking about, I've even once started to debug tcpdump because of a badly set rp_filter value while doing asymmetric routing in a load balanced environment. It sucks rocks!!

Quoted 3 lines

A simple net_ratelimit()ed printk() in the appropriate place, would already help a lot. If you walk your request over to linux-net, maybe you could make that your fallback position :-)

netdev or linux-net might be the best place to discuss it, yes. As a start you could patch ../linux/net/ipv4/fib_frontend.c:fib_validate_source(). Check for the rpf variable and follow it's invariants.

I don't agree with putting a net_ratelimit() on every network related place for logging. I took them out in my kernels because I rather have a system that can filter less packets but log the most packets than having a packet filter that can filter a lot but where syslogd doesn't get enough computing time anymore to read the printk ringbuffer.

Best regards,
Roberto Nibali, ratz

Signature · 1 line
echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq' | dc