I've a Linux box (CentOS 7) with one interface. Its IP is 10.10.0.2. I have an alias IP address too: 10.20.0.2. I'd like to call a webservice from the alias IP address. How can I achieve this? So add the default source address to a specific ip range?
Asked
Active
Viewed 50 times
1 Answers
0
you need to a SNAT
rule into you nat
table
iptables -t nat -A POSTROUTING -d DESTIP/PREXFIX -j SNAT --to-source 10.20.0.2
or more specific
iptables -t nat -A POSTROUTING -d DESTIP/PREXFIX -p tcp -m tcp --dport 80 -j SNAT --to-source 10.20.0.2

EchoMike444
- 449
- 1
- 3
- 6