OpenWrt Forum Archive

Topic: Port forwarding broken in client mode.

The content of this topic has been archived on 5 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I've set up a Linksys WTR54GL in bridged client mode using Kamikaze 7.09, but now the port forwarding I have set up on my main router isn't working for computers connected to the 54GL's LAN ports. Does anyone know why this would happen, or how to fix it?

network:

#### VLAN configuration
config switch eth0
        option vlan0    "0 1 2 3 5*"
        option vlan1    "4 5"

#### Loopback configuration
config interface loopback
        option ifname   "lo"
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0

#### LAN configuration
config interface lan
        option type     bridge
        option ifname   "eth0.0"
        option proto    static
        option ipaddr   192.168.0.254
        option netmask  255.255.255.0
        option gateway  192.168.0.1
        option dns      192.168.0.1

#### WAN configuration
config interface        wan
        option ifname   "eth0.1"
        option proto    dhcp

wireless:

config wifi-device  wl0
        option type     broadcom
        option channel 5
        option disabled 0

config wifi-iface
        option device   wl0
        option network  lan
        option mode     sta
        option ssid     'ssid removed'
        option encryption       'psk'
        option key      'key removed'

Post what you're using in firewall.user (or elsewhere) to forward the ports.

(Last edited by qwillio on 1 Aug 2008, 18:07)

I read somewhere that when using bridged client mode, you should disable the firewall, so I think iirc that i deleted the /etc/init.d/firewall file.

The /etc/config/firewall file is blank atm, but I have tried adding forwards, but I think deleting that other file wont help smile

Should I need the firewall for bridged client mode?

It might be helpful for me to reset all setting to default and start again, but I havnt been able to work out how to do that (I only started using kamikaze today).

Well, say your 'main' router is 192.168.1.1, and the 'WAN' side IP of your GL is 192.168.1.150, the 'LAN' side of your GL is 10.2.2.1, and one of your GL clients is 10.2.2.199.

main:  192.168.1.1
|
GL-WAN: 192.168.1.150
GL-LAN:  10.2.2.1
|
GL client: 10.2.2.199

You'd want to forward from 'main' to 192.168.150, and on the GL forward the same port(s) to 10.2.2.199.  If you're just forwarding from 'main' to your GL-WAN IP, then OpenWrt doesn't have a fux clue which client on your GL to send the packets to.

edit: Oh wait ... bridged ... hmmm ... I'm thinking routed ...

(Last edited by qwillio on 1 Aug 2008, 18:52)

i'm not using different subnets because i'm using bridged client mode, not routed client mode.

Main router 192.168.0.1
|
wireless
|
Kamikaze router 192.168.0.254
|
wire
|
PC 192.168.0.47

I hope that makes sense

so would you think that firewall rules would be required for this set up? I would have thought I wouldnt need them?

I have now tried with a fresh install of Kamikaze.

I tried adding these lines to /etc/firewall.user

ptables -t nat -A prerouting_wan -p tcp --dport 50047 -j DNAT --to 192.168.0.47:50047
ptables        -A forwarding_wan -p tcp --dport 50047 -d 192.168.0.47 -j ACCEPT

I have also tried adding this line to /etc/config/firewall

forward:proto=tcp dport=50047:192.168.0.47:50047

None of these have worked.

Does anyone have any ideas?

The discussion might have continued from here.