openVPN and multiple external IP addresses
Try:
iptables -t nat -A POSTROUTING -s 10.19.88.0/24 -o eth0 -j SNAT --to 11.12.13.2
Or even better ;)
iptables -t nat -A POSTROUTING -s 10.19.88.0/24 -j SNAT --to 11.12.13.2
iptables -t nat -A POSTROUTING -i tun0 -j SNAT --to 11.12.13.2
The issue with rkthkr's response (besides the weird character in interface) is that it would only match packets coming in from the 10.19.88.0/24 subnet that are ALREADY going out eth0:0 and SNAT'ing them.
By using -i tun0
, you're identifying packets only by what interface they come in (I assume that's the only traffic coming in from tun0), and then SNAT'ing it to the proper outgoing IP.