IPTables NAT: Strange behaviour: bug?

Pedro Gonçalves pedro.pandre at gmail.com
Tue Apr 24 10:40:00 CEST 2007

Hi everyone

I'm using IPTables to provide me a Port Restricted Cone NAT.
According to STUN RFC, in a Port Restricted Cone NAT
"all requests from the same internal IP address and port are mapped to
the same IP address and port"
(using all policies set to ACCEPT and the following rule:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE)

My scenario is the following:
-Client behind NAT: IP =
-NAT public addr =

This client will talk with two different destination addresses:
- (Stun server)
- (Other NAT's public addr)

In attachment you can find an capture made at the machine with IPTables,
in which you can see:
-packets 1 and 2: Packet going from the client behind NAT
( to Stun Server ( -> Client's
public address is
-packets 21 e 22: Packet going from the client behind NAT
( to the other NAT's public addr
(> Client's public address is

Why is the client getting different NAT mappings?
Why is the mapping changing from ->
to ->

Best Regards

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nat_strange_behaviour_.pcap
Type: application/octet-stream
Size: 5252 bytes
Desc: not available
Url : /pipermail/netfilter/attachments/20070424/566bd043/nat_strange_behaviour_-0001.obj

More information about the netfilter mailing list