Problem with SNAT
Greetings,
I have problems with the following setup:
A linux with two NICs. One with IP of 10.0.2.2 and one with 10.0.3.57.
I have DNAT-ed traffic coming in on the 10.0.2.2 that was originally sent to 10.0.2.1. (Another node doing the DNAT). I have problems on the route back so I decided to SNAT the backward udp traffic to soource 10.0.2.1 and send the SNATed packets back on another route.
I added the line to nat postrouting (-d target_net -s 10.0.2.2 -p udp -j SNAT --to-source 10.0.2.1) but the packages don't even seem to hit the nat postrouting chain. Let alone my SNAT rule.
Any ideas what could be wrong ?
Thanks
Bgs
Quoted 10 lines · Bgs
Greetings,
I have problems with the following setup:
A linux with two NICs. One with IP of 10.0.2.2 and one with 10.0.3.57. I have DNAT-ed traffic coming in on the 10.0.2.2 that was originally sent to 10.0.2.1. (Another node doing the DNAT). I have problems on the route back so I decided to SNAT the backward udp traffic to soource 10.0.2.1 and send the SNATed packets back on another route.
Quoted 8 lines
I added the line to nat postrouting (-d
target_net-s 10.0.2.2 -p udp -j SNAT --to-source 10.0.2.1) but the packages don't even seem to hit the nat postrouting chain. Let alone my SNAT rule.Any ideas what could be wrong ?
Thanks
Bgs
since i have to guess (hint: post your rules [1] if you want us to find the problem for you)...
i would say that your filter rules drop the packet before they ever get to the POSTROUTING chain of the nat table.
-j
[1] - iptables -vnL && iptables -t nat -vnL && iptables -t mangle -vnL
Signature · 1 line
Jason Opperisano <[email protected]>
Quoted 23 lines · Jason Opperisano
Quoted 10 lines · Bgs
Greetings,
I have problems with the following setup:
A linux with two NICs. One with IP of 10.0.2.2 and one with 10.0.3.57. I have DNAT-ed traffic coming in on the 10.0.2.2 that was originally sent to 10.0.2.1. (Another node doing the DNAT). I have problems on the route back so I decided to SNAT the backward udp traffic to soource 10.0.2.1 and send the SNATed packets back on another route.
Quoted 8 lines
I added the line to nat postrouting (-d
target_net-s 10.0.2.2 -p udp -j SNAT --to-source 10.0.2.1) but the packages don't even seem to hit the nat postrouting chain. Let alone my SNAT rule.Any ideas what could be wrong ?
Thanks
Bgssince i have to guess (hint: post your rules [1] if you want us to find the problem for you)...
Quoted 6 lines
i would say that your filter rules drop the packet before they ever get to the POSTROUTING chain of the nat table.
-j
[1] - iptables -vnL && iptables -t nat -vnL && iptables -t mangle -vnL
Furthermore we could use with the routing table on the box as well .
classically 10.x.x.x addressed networks have a mask of 255.0.0.0 which might not result in good routes.
Alistair.
Quoted 10 lines
Quoted 6 lines
A linux with two NICs. One with IP of 10.0.2.2 and one with 10.0.3.57.
I have DNAT-ed traffic coming in on the 10.0.2.2 that was originally sent to 10.0.2.1. (Another node doing the DNAT). I have problems on the route back so I decided to SNAT the backward udp traffic to soource 10.0.2.1 and send the SNATed packets back on another route.I added the line to nat postrouting (-d
target_net-s 10.0.2.2 -p udp -j SNAT --to-source 10.0.2.1) but the packages don't even seem to hit the nat postrouting chain. Let alone my SNAT rule.since i have to guess (hint: post your rules [1] if you want us to find the problem for you)...
Quoted 7 lines
i would say that your filter rules drop the packet before they ever get to the POSTROUTING chain of the nat table.
-j
[1] - iptables -vnL && iptables -t nat -vnL && iptables -t mangle -vnL
Greetings,
I don't have access right no to the box, but I dumped the traffic and the packets go out unSNATed :) The boxes ruleset is completely empty, it has only this one rule...
Netmasks are 24bits.
Incoming packet to 10.0.2.2 (originally sent to 10.0.2.1). Outbound udp traffic from 10.0.2.2 should be SNATed back to 10.0.2.1.
Bye
Bgs