NAT not working

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
milasch
DD-WRT Novice


Joined: 17 Feb 2014
Posts: 2

PostPosted: Mon Feb 17, 2014 3:38    Post subject: NAT not working Reply with quote
I have the following

"ISP Router" - LAN IP 192.168.0.1 - WIFI enabled

^^
^^

"WIFI Booster" - LAN IP 192.168.0.254

^^
^^

"DD-WRT router" - LAN IP 192.168.1.1 - WAN IP 192.168.0.2

^^
^^

"Server 1" - LAN IP 192.168.1.100

DD-WRT router is in Gateway mode, Server 1 can get to the internet no problem. However NAT doesn't seem to work. I want a particular port on Server 1 to be exposed to LAN 192.168.0.0 and subsequently to the internet.

This is the output of:
# iptables -t nat -vnL PREROUTING
Chain PREROUTING (policy ACCEPT 3800 packets, 703K bytes)
pkts bytes target prot opt in out source destination
0 0 DNAT icmp -- * * 0.0.0.0/0 192.168.0.2 to:192.168.1.1
0 0 DNAT tcp -- * * 0.0.0.0/0 192.168.0.2 tcp dpt:9022 to:192.168.1.100:22
11 1297 TRIGGER 0 -- * * 0.0.0.0/0 192.168.0.2 TRIGGER type:dnat match:0 relate:0

And of:
# iptables -vnL FORWARD
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT 0 -- br0 br0 0.0.0.0/0 0.0.0.0/0
1502 77784 TCPMSS tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x06/0x02 TCPMSS clamp to PMTU
17525 7010K lan2wan 0 -- * * 0.0.0.0/0 0.0.0.0/0
15474 6835K ACCEPT 0 -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
0 0 ACCEPT tcp -- * * 0.0.0.0/0 192.168.1.100 tcp dpt:22
0 0 TRIGGER 0 -- vlan1 br0 0.0.0.0/0 0.0.0.0/0 TRIGGER type:in match:0 relate:0
2051 176K trigger_out 0 -- br0 * 0.0.0.0/0 0.0.0.0/0
2051 176K ACCEPT 0 -- br0 * 0.0.0.0/0 0.0.0.0/0 state NEW

Spent so many hours trying to make this work and things I've attempted but didn't work:

- Changing routing mode to Router
- Entering "Source IP" a combination of 0.0.0.0, 192.168.0.0, blank, etc
- Upgrading DD-WRT firmware

It's time to try posting here, perhaps someone can help.

Thanks in advance
Sponsor
LOM
DD-WRT Guru


Joined: 28 Dec 2008
Posts: 7647

PostPosted: Mon Feb 17, 2014 14:05    Post subject: Reply with quote
Your iptables listings shows 0 incoming packets for 192.168.1.100:22

Did you forward the port in the ISP router?
It must know where to forward incoming port 22 packets, if there is no port forward specified then it will drop those packets.
milasch
DD-WRT Novice


Joined: 17 Feb 2014
Posts: 2

PostPosted: Mon Feb 17, 2014 20:56    Post subject: Reply with quote
LOM wrote:
Your iptables listings shows 0 incoming packets for 192.168.1.100:22

Did you forward the port in the ISP router?
It must know where to forward incoming port 22 packets, if there is no port forward specified then it will drop those packets.


I'm actually trying to connect within the network behind the ISP router. The packets count goes up once I try to connect, eventually it does get reset though (I can't make much sense of that counter).

Of course if I can't connect from within 192.168.0.0 network, from the internet would be even more pointless, right?

EDIT: and by the way, I have set ISP router's DMZ to 192.168.0.2.
LOM
DD-WRT Guru


Joined: 28 Dec 2008
Posts: 7647

PostPosted: Tue Feb 18, 2014 2:13    Post subject: Reply with quote
When you are a client in the 192.168.0 subnet then you should be able to connect to 192.168.0.2:9022 and reach 192.168.1.100:22, is that what you did?
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum