Skip to content

Avoid direct connections between NATed hosts

Eric Leblond netfilter-devel 1 version Applied

Status from this message: Queued for 2.6.21, thanks Eric.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 11 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2Avoid direct connections between NATed hostsinclude/linux/netfilter_ipv4/ip_nat.h include/net/netfilter/nf_nat.h net/ipv4/netfilter/ip_nat_core.c +5 more+44 -40 replies
2/2iptables: add random option to SNATlibipt_SNAT.c+51 -350 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Patch 0/2] Avoid direct connections between NATed hosts

Hi,

Some algorithms can be used to established direct connections between NATed hosts. Skype is one of the programs using this kind of "feature".

Some details can be found here :

	http://www.heise-security.co.uk/articles/print/82481

It uses the fact that port is usually sequentially increased and is thus predictable.

This patches against kernel and iptables add the capability to randomize the source port used when doing SNAT.

Tests have been done and have show that Skype is no more able to established a direct connection between NATed hosts.

Randomization of the source port can be activated on a per-rule basis with the following syntax:

iptables -A POSTROUTING -t nat -o eth0 -j SNAT --to 192.168.1.3:random

or

iptables -A POSTROUTING -t nat -o eth0 -j SNAT --to 192.168.1.3:1234-3456:random

BR,

Signature · 3 lines
Éric Leblond, [email protected]
Téléphone : 01 44 89 46 39, Fax : 01 44 89 45 01
INL, http://www.inl.fr