Transparent proxying patches, take six
Status from this message: Applied to net-next-2.6
Get series with b4
b4 am 20081001142431.4893.48078.stgit@esteVersions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/16 | Loosen source address check on IPv4 outputinclude/ net/ | +15 | 1 reply | |
| 2/16 | Implement IP_TRANSPARENT socket optioninclude/ include/ include/ +2 more | +20 | 1 reply | |
| 3/16 | Allow binding to non-local addresses if IP_TRANSPARENT is setnet/ | +1 | 1 reply | |
| 4/16 | Make inet_sock.h independent of route.hinclude/ include/ include/ +2 more | +8 | 1 reply | |
| 5/16 | Conditionally enable transparent flow flag when connectinginclude/ | +5 | 1 reply | |
| 6/16 | Handle TCP SYN+ACK/ACK/RST transparencyinclude/ net/ | +16 | 2 replies | |
| 7/16 | Make Netfilter's ip_route_me_harder() non-local address compatibleinclude/ net/ net/ +2 more | +18 | 1 reply | |
| 8/16 | Port redirection support for TCPinclude/ include/ net/ +2 more | +6 | 1 reply | |
| 9/16 | Export UDP socket lookup functioninclude/ net/ | +11 | 1 reply | |
| 10/16 | Don't lookup the socket if there's a socket attached to the skbnet/ | +9 | 17 replies | |
| 11/16 | Don't lookup the socket if there's a socket attached to the skbnet/ | +16 | 0 replies | |
| 12/16 | Split Netfilter IPv4 defragmentation into a separate moduleinclude/ net/ net/ +2 more | +113 | 1 reply | |
| 13/16 | iptables tproxy coreinclude/ net/ net/ +1 more | +146 | 1 reply | |
| 14/16 | iptables socket matchnet/ net/ net/ | +198 | 4 replies | |
| 15/16 | iptables TPROXY targetinclude/ net/ net/ +1 more | +142 | 1 reply | |
| 16/16 | Add documentationDocumentation/ | +85 | 11 replies |
Reviews trailers per patch
1 of 16 patches has a Reviewed-by or Acked-by.
| Patch | Arnaldo Carvalho de Melo |
|---|---|
| 1/16 | |
| 2/16 | |
| 3/16 | |
| 4/16 | |
| 5/16 | |
| 6/16 | |
| 7/16 | |
| 8/16 | |
| 9/16 | |
| 10/16 | A-b A-b |
| 11/16 | |
| 12/16 | |
| 13/16 | |
| 14/16 | |
| 15/16 | |
| 16/16 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [net-next PATCH 00/16] Transparent proxying patches, take six
Hi Dave,
This is the sixth round of transparent proxying patches recently discussed on the Netfilter Workshop. Since the last incarnation [1] we've added support for related ICMP packets in the socket match. Should apply cleanly on top of net-next-2.6. Could you please apply patches 1-11 (those touching core networking parts) and I'll ask Patrick McHardy to take care of patches 12-16 (the Netfilter parts).
The aim of the patchset is to make non-locally bound sockets work both for receiving and sending. The target is IPv4 TCP/UDP at the moment.
Speaking of the patches, there are two big parts:
* Output path (patches 1-7): these modifications make it possible to send IPv4 datagrams with non-local source IP address by:
- Introducing a new flowi flag (FLOWI_FLAG_ANYSRC) which disables source address checking in ip_route_output_slow(). This is also necessary for some of the tricks LVS does. [2]
- Adding the IP_TRANSPARENT socket option (setting this requires CAP_NET_ADMIN to prevent source address spoofing).
- Gluing these together across the TCP/UDP code.
* Input path (patches 8-15): these changes add redirection support for TCP along with an iptables target implementing NAT-less traffic interception, and an iptables match to make ahead-of-time socket lookups on PREROUTING. These combined with a set of iptables rules and policy routing make non-locally bound sockets work.
- IPv4 TCP and UDP input path is modified to use this stored socket reference if it's present.
- Netfilter IPv4 defragmentation is split into a separate module. (This could make sense independently of tproxy and conntrack, for example to have a stateless firewall which still does fragment reassembly.)
- The 'socket' iptables match does a socket lookup on the destination address and matches if a socket was found.
- The 'TPROXY' iptables target provides a way to intercept traffic without NAT -- it does an ahead-of-time socket lookup on the configured address and caches the socket reference in the skb.
The last patch adds a short intro on how to use it. A trivial patch for netcat demonstrating the necessary modifications for proxies is available separately at [3]. Squid has support for it in the 3.HEAD (3.1) branch.
References:
[1] http://lwn.net/Articles/254527/
[2] http://marc.info/?l=linux-netdev&m=118065358510836&...
[3] http://people.netfilter.org/hidden/tproxy/netcat-ip_trans...
Signature · 1 line
KOVACS Krisztian