Skip to main content

Thread: IPTABLES - nat with multiple translated sources


hello,

iptables, have following topology 2 physical interfaces: eth0(wan) , eth1(lan). added virtual interfaces support additional ip addresses.


wan ---- eth0 (110.120.130.140/24) ---- eth1 (10.20.30.40/24) ---- 1.2.3.4/24
---- eth0:1 (110.120.130.141/24) ---- eth1:1 (10.20.30.41/24)
---- eth0:2 (110.120.130.142/24) ---- eth1:2 (10.20.30.42/24)



have following iptables translation path taken.

-a prerouting -d 110.120.130.140 -p tcp -m tcp --dport 80 -j dnat --to-destination 1.2.3.4:80
-a prerouting -d 110.120.130.141 -p tcp -m tcp --dport 80 -j dnat --to-destination 1.2.3.4:80
-a prerouting -d 110.120.130.142 -p tcp -m tcp --dport 80 -j dnat --to-destination 1.2.3.4:80
-a postrouting -d 1.2.3.4 -j masquerade

110.120.130.140 -> 10.20.30.40 -> 1.2.3.4
110.120.130.141 -> 10.20.30.40 -> 1.2.3.4
110.120.130.142 -> 10.20.30.40 -> 1.2.3.4


want nat based on below paths instead, device (1.2.3.4) see packets coming different source ip.

110.120.130.140 -> 10.20.30.40 -> 1.2.3.4
110.120.130.141 -> 10.20.30.41 -> 1.2.3.4
110.120.130.142 -> 10.20.30.42 -> 1.2.3.4


else should added iptables?



Forum The Ubuntu Forum Community Ubuntu Official Flavours Support Networking & Wireless [ubuntu] IPTABLES - nat with multiple translated sources


Ubuntu

Comments

Popular posts from this blog

Thread: Can not create raid array: mdadm: no raid-devices specified.

Thread: HOW TO: Package and theme GTK+ / Gtkmm apps in Linux for Windows

Thread: Twinview issues