OpenWrt Forum Archive

Topic: WAN and WIFI Client internet port.

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

I am trying to setup my WRT54GS to connect to a wireless AP and to also use the WAN/Internet port on my broadband connection so that I effectively have to internet connections going into my router. 

I have setup the firewall to forward all outgoing traffic in the upper TCP/UDP ports out the WIFI and the rest out the WAN. 

Everything I thought works fine until I went to plug the router into my cable modem... it is configured to get DHCP from my ISP, but when I call "ifup WAN", it doesnt get an IP. 

I have setup:
vlan0 to be ports "1 2 3 4 5*"
vlan1 to be ports "0 5"
set wan_ifname="vlan1"
set lan_ifname="br0"
set lan_ifnames="vlan0"
set wifi_ifname="eth1"

and the firewall should route between. 

I'm not exactly sure what the purpose of "br0" is?  What is the difference between a bridge and a vlan?  Should I just set lan_ifname="vlan0" and leave ifnames blank?

I can connect to the wireless and route traffic between it and my LAN, but I cannot connect the WAN (port 0).  I assume on this router, port 0 is the "Internet/WAN" port right?

Its like it just doesn't want to get an ip from my cable mode.

I imagine many people have done this before so if anyone has, please help.

br0 - bridge together interfaces set up in *_ifnames variable since you have just one interface vlan0 there is no use for it and yes you should set lan_ifname="vlan0" and leave ifnames blank smile

Thanks for the reply.  It turns out my problem was that on my WRT54GS Version 4.0, ports "0 1 2 3" are the 4 LAN ports on the back of the router, and port "4" is the WAN/Internet port.  That means the default configuration that the OpenWRT documentation provides with vlan0="1 2 3 4 5*" and vlan1="0 5"  makes the physical WAN port the port labeled 4.  So my guess is that...   

VLAN/Swith Port 3 = Labeled port 1
VLAN/Swith Port 2 = Labeled port 2
VLAN/Swith Port 1 = Labeled port 3
VLAN/Swith Port 0 = Labeled port 4
VLAN/Swith Port 4 = Labeled WAN port

Although the only one I can verify right now is that the WAN port is actually VLAN PORT 4 and I think that VLAN PORT 0 is the Labeled LAN port 4.

I discovered this after verifying everything again and again and looking through all the scripts and seeing nothing wrong.  Then it just dawned on me the most logical reason I couldnt get an address from the DHCP is that it is not plugged in.  I tried every othter LAN port, and when i plugged in port 4 (I think it was) I got an IP from my cable modem.  Before that, I saw that when I plugged in to my WAN port I could still connect to the router and get an IP from the routers DHCP.  So when I switched the vlans so that
vlan0ports="0 1 2 3 5*" and vlan1ports="4 5", everything worked as labeled and expected. 

Oh well... maybe it will help someone else out.  I did just  buy the router new less than a week ago so maybe something physical has changed... or maybe I'm just a dipshit and misread somewhere that port 0 is supposed to be the WAN port.

(Last edited by jkhax0r on 2 Dec 2005, 17:54)

It turns out my problem was that on my WRT54GS Version 4.0, ports "0 1 2 3" are the 4 LAN ports on the back of the router, and port "4" is the WAN/Internet port.

http://forum.openwrt.org/viewtopic.php?id=2711

- DL

The discussion might have continued from here.