iptables UDP SNAT rule is only applied to some traffic
Issue
- iptables UDP SNAT rule is only applied to some traffic
- Using Source NAT to change the local IP address of UDP traffic, only locally-generated traffic has the NAT rule applied, replies to traffic generated from remote sources do not have the NAT applied
- An example iptables rule may be:
iptables -t nat -I POSTROUTING -p udp -j SNAT --to 172.16.1.111
Environment
- Red Hat Enterprise Linux 7
- iptables with
SNAT
target to perform Source NAT (Network Address Translation) - UDP (User Datagram Protocol) though probably applies to other protocols as well
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.