I have CentOs and two external internet interfaces eth0(*.*.*.74) and eth1(*.*.*.106) with common gateway (*.*.*.126)
on eth0 port 1195 listen openvpn work via tun0 (10.10.254.0/24)
on eth1 port 1195 listen openvpn work via tun1 (10.10.255.0/24)
IPTABLES
*filter
-A FORWARD -i tun0 -o eth0 -j ACCEPT
-A FORWARD -i eth0 -o tun0 -j ACCEPT
-A FORWARD -i tun1 -o eth1 -j ACCEPT
-A FORWARD -i eth1 -o tun1 -j ACCEPT
*nat
-A POSTROUTING -o eth0 -s 10.10.254.0/24 -j MASQUERADE
-A POSTROUTING -o eth1 -s 10.10.255.0/24 -j MASQUERADE
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.254.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
10.10.255.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun1
*.*.*.64 0.0.0.0 255.255.255.192 U 0 0 0 eth0
*.*.*.64 0.0.0.0 255.255.255.192 U 0 0 0 eth1
10.10.254.0 10.10.254.2 255.255.255.0 UG 0 0 0 tun0
10.10.255.0 10.10.255.2 255.255.255.0 UG 0 0 0 tun1
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 eth1
0.0.0.0 *.*.*.126 0.0.0.0 UG 0 0 0 eth0
All works, but when I connected any IP(eth0 or eth1) from internet I've got the same ip address eth0.
I want connect to eth0 and get external eth0 address, to eth1 and get external eth1 address not the same.
How to do it?