Reply To: static NAT not working

Home Page Forums Network Management Networking static NAT not working Reply To: static NAT not working

#51179

mirza
Member

Hi ppalias, i’ve added the code iptables -t nat -L -v. but still it’s not natting.

here is my configuration:-

#for 1:1 natting

iptables -t nat -I PREROUTING 1 -d 87.101.232.36 -i ETH00 -j DNAT –to-destination 172.26.1.61
iptables -t nat -I PREROUTING 1 -d 87.101.232.37 -i ETH00 -j DNAT –to-destination 172.26.1.38

# for dhcp one to many

iptables -t nat -I PREROUTING 1 -d 87.101.232.34 -i ETH00 -j DNAT –to-destination 172.26.1.1

#for 1:1 natting

iptables -t nat -I POSTROUTING 1 -s 172.26.1.61 -o ETH00 -j SNAT –to-source 87.101.232.36
iptables -t nat -I POSTROUTING 1 -s 172.26.1.38 -o ETH00 -j SNAT –to-source 87.101.232.37

# for dhcp one to many
iptables -t nat -I POSTROUTING -s 172.26.1.0/24 -o ETH00 -j SNAT –to-source 87.101.232.34

iptables -t nat -L -v

my firewall settings:–

Chain: INPUT Policy Chain
Enabled
INPUT Rules
Seq Input Output Description Log Active
1 ETH01 * ACCEPT all opt — in ETH01 out * 0.0.0.0/0 -> 0.0.0.0/0 no
2 ETH02 * ACCEPT all opt — in ETH02 out * 0.0.0.0/0 -> 0.0.0.0/0 no
3 * * ACCEPT all opt — in * out * 0.0.0.0/0 -> 0.0.0.0/0 state RELATED,ESTABLISHED no

Chain: FORWARD Policy Chain
Enabled
FORWARD Rules
Seq Input Output Description Log Active
1 ETH01 * ACCEPT all opt — in ETH01 out * 0.0.0.0/0 -> 0.0.0.0/0 no
2 ETH02 * ACCEPT all opt — in ETH02 out * 0.0.0.0/0 -> 0.0.0.0/0 no
3 * * ACCEPT all opt — in * out * 0.0.0.0/0 -> 0.0.0.0/0 state RELATED,ESTABLISHED no

my WAN settings:-

ETH00 10Mb/s Half Duplex
Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10) UP

87.101.232.34 255.255.255.240
87.101.232.36 255.255.255.240
87.101.232.37 255.255.255.240

my LAN settings:–

ETH01 100Mb/s Full Duplex
Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10) UP

172.26.1.1 255.255.255.0

can you please help me where i am wrong.