PDA

View Full Version : Port forwarding problem



Seveas
04-06-2004, 17:02
I've read other posts about my problem, but have not yet found a solution. So here is mine:

When I forward a port to a local IP-address, say port 21, the forwarding works from the outside. But i cannot use the external ip-adress from the inside.

Example:
ISP IP-address: 213.73.236.154
IP of server: 192.168.1.2
Random *external* IP: 146.50.9.20

146.50.9.20 -> 213.73.236.154 is forwarded correctly
192.168.1.* -> 213.73.236.154 is NOT forwarded. It gives me connection errors and port 80 shows the wl500g configuration page.

I am using Oleg's latest firmware and the router is in home gateway mode.

iptables -L -v -t nat says:

~ # iptables -L -v -t nat
Chain PREROUTING (policy ACCEPT 473 packets, 45986 bytes)
pkts bytes target prot opt in out source destination
0 0 REDIRECT tcp -- eth1 any anywhere 213.73.236.154 tcp dpt:8100 redir ports 80
0 0 REDIRECT tcp -- br0 any anywhere 213.73.236.154 tcp dpt:8100 redir ports 80
0 0 DNAT tcp -- eth1 any anywhere 213.73.236.154 tcp dpt:21 to:192.168.1.2
0 0 DNAT tcp -- eth1 any anywhere 213.73.236.154 tcp dpts:2000:2100 to:192.168.1.2
0 0 DNAT tcp -- eth1 any anywhere 213.73.236.154 tcp dpt:11900 to:192.168.1.2
0 0 DNAT tcp -- eth1 any anywhere 213.73.236.154 tcp dpt:2500 to:192.168.1.2
0 0 DNAT tcp -- eth1 any anywhere 213.73.236.154 tcp dpt:11000 to:192.168.1.2
0 0 DNAT tcp -- eth1 any anywhere 213.73.236.154 tcp dpt:3389 to:192.168.1.2
0 0 DNAT tcp -- eth1 any anywhere 213.73.236.154 tcp dpt:80 to:192.168.1.2
0 0 DNAT tcp -- eth1 any anywhere 213.73.236.154 tcp dpt:24837 to:192.168.1.2

Chain POSTROUTING (policy ACCEPT 40 packets, 2673 bytes)
pkts bytes target prot opt in out source destination
117 5741 MASQUERADE all -- any eth1 anywhere anywhere

Chain OUTPUT (policy ACCEPT 44 packets, 3457 bytes)
pkts bytes target prot opt in out source destination

What should i do to correct this?

Oleg
04-06-2004, 19:54
The feature you need is called "NAT of local connections" and is currently not compiled in to the linux kernel used by wl500g.

Seveas
04-06-2004, 20:04
Are you planning on compiling it into the kernel, it would be very useful. Just like lots of other things you already did :)

Oleg
04-06-2004, 20:48
There should be also changes in the firewall scripts, but nobody is interested in this... I'm too lazy to dig into this stuff deeper. Volunteers needed. :)

Oleg
05-06-2004, 15:40
Seems I was wrong: we don't need NAT of local connections. In fact ASUS 1.7.5.9 firmware has this feature already. :)

Seveas
06-06-2004, 09:11
Nice :)
But than I would have to give up the ssh server and bootcmd's which i use for my own ddns client, so when can we expect 1.7.5.9 based releases of your great firmware?