[Solved] RT-N16 Vlan Bridge problem when using PPPOE

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
TSS3000
DD-WRT Novice


Joined: 28 Jan 2011
Posts: 13

PostPosted: Fri Jan 28, 2011 23:00    Post subject: [Solved] RT-N16 Vlan Bridge problem when using PPPOE Reply with quote
I recently installed DD-WRT build 15962 (tested on older builds with same result) on a Asus RT-N16 router after upgrading from a WL-520GC.

The only thing i lost during the upgrade was the ability to bridge my wan port to the ports 3 and 4. Besides the internet connection i also use the local area for hi speed transfers and connect 2 cables from my PC to the router.

In the case of the RT-N16 if i click apply to the bellow configuration: http://img547.imageshack.us/img547/756/vlan.jpg the settings work ok for about 3 hours after witch the router restarts. On router reboot (intentional or not) port 3 and 4 become part of the LAN instead of getting bridged to the wan port.

After reading around the web i think the wan port on the router is separated from switch ports as a cpu connection. Not sure if this is the reason but i find it weird that each time i click apply the setting works fine for a few hours.


Last edited by TSS3000 on Tue Feb 01, 2011 11:21; edited 2 times in total
Sponsor
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Sat Jan 29, 2011 1:37    Post subject: Reply with quote
Post the output from this command to see if you're running out of nvram space.

nvram show >/dev/null

If you don't have much nvram space free then also list an overview of everything you've enabled.

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
TSS3000
DD-WRT Novice


Joined: 28 Jan 2011
Posts: 13

PostPosted: Sat Jan 29, 2011 10:53    Post subject: Reply with quote
nvram show >/dev/null
size: 26273 bytes (6495 left)

Seems nvram free space is ok and doesn't change while router is running. If you think it helps i can post my full "nvram show > nvram.txt" file.

I keep most of the settings to default. I set up pppoe, configure a few static leases for DHCP and set a firewall rule since my ISP is setting ttl to 1:

iptables -t mangle -A PREROUTING -i `nvram get wan_iface` -j TTL --ttl-inc 1
iptables -t mangle -A POSTROUTING -o `nvram get wan_iface` -j TTL --ttl-inc 1

I usually turn on jffs2 and ftpd but it doesn't really matter and i can reproduce with them being off.
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Sun Jan 30, 2011 0:12    Post subject: Re: RT-N16 Vlan Bridge problem Reply with quote
TSS3000 wrote:
In the case of the RT-N16 if i click apply to the bellow configuration: http://img547.imageshack.us/img547/756/vlan.jpg the settings work ok for about 3 hours after witch the router restarts. On router reboot (intentional or not) port 3 and 4 become part of the LAN instead of getting bridged to the wan port.

So you can reproduce it 100% by manually rebooting the router? Are you sure it's not temporarily reverting during the router boot process but then getting applied once the router is fully booted? If you can reproduce it, please get the output of this command both before and after it occurs.

nvram show | grep vlan | egrep port\|hwname | sort

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
TSS3000
DD-WRT Novice


Joined: 28 Jan 2011
Posts: 13

PostPosted: Sun Jan 30, 2011 0:22    Post subject: Reply with quote
I double checked nvram and it has same info before and after apply button and also after the router restart. The difference is that port 3 and 4 are part of LAN and not WAN. On clicking apply the settings get back in motion. On my WAN there is already a DHCP server giving IP's in the form of 10.22.X.X. while my local area has 192.168.1.X. After router restart my network card gets LOCAL IP. After apply and refresh i get WAN ip. Even setting manuals ip's and pinging WAN servers prove that its not bridge to the WAN.

Sorry about my rusty English and i hope i was as much descriptive as possible.

Edit:
I can reproduce by restarting the router in any way. (unplug power source, reboot command in ssh or web interface)

Edit2 (nvram results):
command: nvram show | grep vlan | egrep port\|hwname | sort

Tempoary settings (keep port 3 and 4 in lan 0 till i figure out whats wrong)
port0vlans=2 18 19
port1vlans=1 18 19
port2vlans=1 18 19
port3vlans=0 18 19
port4vlans=0 18 19
port5vlans=0 1 2 16
vlan0hwname=et0
vlan0ports=1 2 3 4 5*
vlan1hwname=et0
vlan1ports=4 3 2 1 8*
vlan2hwname=et0
vlan2ports=0 8

after apply button
port0vlans=2 18 19
port1vlans=1 18 19
port2vlans=1 18 19
port3vlans=2 18 19
port4vlans=2 18 19
port5vlans=1 2 16
vlan0hwname=et0
vlan0ports=1 2 3 4 5*
vlan1hwname=et0
vlan1ports=4 3 2 1 8*
vlan2hwname=et0
vlan2ports=0 8

after reboot
port0vlans=2 18 19
port1vlans=1 18 19
port2vlans=1 18 19
port3vlans=2 18 19
port4vlans=2 18 19
port5vlans=1 2 16
vlan0hwname=et0
vlan0ports=1 2 3 4 5*
vlan1hwname=et0
vlan1ports=4 3 2 1 8*
vlan2hwname=et0
vlan2ports=0 8



vlan.txt
 Description:
vlan.txt dump

Download
 Filename:  vlan.txt
 Filesize:  25.64 KB
 Downloaded:  562 Time(s)

phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Sun Jan 30, 2011 0:48    Post subject: Reply with quote
TSS3000 wrote:
After router restart my network card gets LOCAL IP. After apply and refresh i get WAN ip. Even setting manuals ip's and pinging WAN servers prove that its not bridge to the WAN.

So it's not temporary then and nothing in nvram is changing, very strange. You should be able to overcome the problem by manually setting the nvram variables. Run these commands and it should put port 3 and 4 into VLAN 2.

nvram set vlan1ports="4 3 8*"
nvram set vlan2ports="2 1 0 8"
nvram commit
reboot

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
TSS3000
DD-WRT Novice


Joined: 28 Jan 2011
Posts: 13

PostPosted: Sun Jan 30, 2011 1:21    Post subject: Reply with quote
nvram set vlan1ports="4 3 8*"
nvram set vlan2ports="2 1 0 8"
nvram commit
reboot


After running your commands to set manually vlan ports and rebooting i-am kicked out of the LAN (no more dhcp and no static ip can get me connected to 192.168.1.1).

Wireless still works fine and i can also restore router to default using the magic button.

I even tried deleting vlan0ports in case that brought nay confusion using nvram clear,
TSS3000
DD-WRT Novice


Joined: 28 Jan 2011
Posts: 13

PostPosted: Sun Jan 30, 2011 13:00    Post subject: Reply with quote
Found some more time to play with the router with the weekend and everything. I tried manually setting as you suggested so i came up with this script.

nvram set vlan0_mtu
nvram set vlan0_nat
nvram set vlan0ports
nvram set vlan0_bridged
nvram set vlan1_mtu=1500
nvram set vlan1_nat=1
nvram set vlan1ports="3 4 8*"
nvram set vlan1_bridged="1"
nvram set vlan2_mtu=1500
nvram set vlan2_nat=0
nvram set vlan2ports="0 1 2 8"
nvram set vlan2_bridged
nvram set port0vlans="2 18 19"
nvram set port1vlans="2 18 19"
nvram set port2vlans="2 18 19"
nvram set port3vlans="1 18 19"
nvram set port4vlans="1 18 19"
nvram set port5vlans
nvram set port8vlans="3 4 16"
nvram set vlan0hwname
nvram set vlan1hwname="et0"
nvram set vlan2hwname="et0"
nvram commit
reboot

After reboot bridge to WAN works fine but LAN doesn't work anymore.

Also the strangest thing happens when listing nvram after reboot i get vlan0ports=1 2 3 4 5* since i manually erased it. Even stranger is that 5* in the vlan0ports since this is a gigabit switch and it should be a 8* in the worst case.

Thanks for all your help and i hope my bug report helps in the development process. If there is anything else i can test for you leave a message.
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Mon Jan 31, 2011 0:14    Post subject: Reply with quote
TSS3000 wrote:
nvram set vlan1ports="4 3 8*"
nvram set vlan2ports="2 1 0 8"
nvram commit
reboot


After running your commands to set manually vlan ports and rebooting i-am kicked out of the LAN (no more dhcp and no static ip can get me connected to 192.168.1.1).

On all of the LAN ports? If you don't mind trying, hard resetting and then running those commands from a clean config should put ports 3-4 (as labeled on the case) into VLAN 2.

You don't need to worry about the other nvram variables for this but FYI there is no such port8vlans variable ever and even though the firmware creates vlan0ports it doesn't use it on gigabit models.

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
TSS3000
DD-WRT Novice


Joined: 28 Jan 2011
Posts: 13

PostPosted: Mon Jan 31, 2011 2:03    Post subject: Reply with quote
After some more digging the specific vlan configuration only work if i don't use PPPOE Connection Type. Once setting DHCP and rebooting router both my PC Network cards were getting proper IPs and comunication worked perfectly across each network. This doesn't not solve my problem since i need to authenticate on pppoe in order to get internet but it does pinpoint the culprit.

This is the last script i used and i corrected the port8vlans (also read the wiki a bit more carefully this time):
nvram set vlan1ports="4 3 8*"
nvram set vlan2ports="2 1 0 8"
nvram set port0vlans="2 18 19"
nvram set port1vlans="2 18 19"
nvram set port2vlans="2 18 19"
nvram set port3vlans="1 18 19"
nvram set port4vlans="1 18 19"
nvram set port5vlans="1 2 16"
nvram commit
reboot

Edit:
I just noticed http://svn.dd-wrt.com:8000/dd-wrt/ticket/1932 and can confirm that the browser leads to a empty page after apply it in my case. I have to reopen base url to continue using the router but no hang here. Probably depends on the script being saved.
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Mon Jan 31, 2011 21:25    Post subject: Reply with quote
TSS3000 wrote:
After some more digging the specific vlan configuration only work if i don't use PPPOE Connection Type. Once setting DHCP and rebooting router both my PC Network cards were getting proper IPs and comunication worked perfectly across each network. This doesn't not solve my problem since i need to authenticate on pppoe in order to get internet but it does pinpoint the culprit.

You do realize that putting the ports into the WAN VLAN just makes them switched with the WAN port just as if you connected a switch between the modem and router. The clients connected to these ports are responsible for creating their own PPPoE tunnels to get internet access if your modem/ISP even allows it.

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
TSS3000
DD-WRT Novice


Joined: 28 Jan 2011
Posts: 13

PostPosted: Mon Jan 31, 2011 23:38    Post subject: Reply with quote
I don't you think you understand the problem.

Doing this in DD-WRT breaks the VLANS.

http://img59.imageshack.us/img59/2143/pppoe.jpg

Edit:
I-am interested in having my router provide internet from the PPPOE WAN and sharing it over the LAN (wireless + port 1 & 2) and also have a WAN bridge in port 3 & 4. I know very well that the bridge should simulate a network switch. I have been having the exact same setup on a Asus WL520GC.
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Tue Feb 01, 2011 1:47    Post subject: Reply with quote
I was just making sure you weren't expecting the router to still do PPPoE for them.

I tried switching the WAN type to PPPoE on my wrt320n which has similar internal hardware and sure enough the same thing happened. Luckily for you I came up with a quick solution. I was able to echo the port assignments to the /proc entries that control the live configuration of the switch. Add this to your startup script on the admin->commands page and it should force the port assignments every boot.

echo "4 3 8*" > /proc/switch/eth0/vlan/1/ports
echo "2 1 0 8" > /proc/switch/eth0/vlan/2/ports

It seems to work fine but I didn't test it much. There may be a small window when it boots before the startup script runs when the VLAN config will still be messed up that might cause problems. If there's any problems with this then try going back to the recommended 14929 build and using the nvram variables. I have a feeling that this is only occurring because of the VLAN GUI fixes for k2.6 builds.

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
TSS3000
DD-WRT Novice


Joined: 28 Jan 2011
Posts: 13

PostPosted: Tue Feb 01, 2011 11:20    Post subject: Reply with quote
VLans work perfectly now with the start-up script. I don't mind the minor delay between boot and start-up script execution since i don't intend to reboot router very often.

Thanks for all your help and didn't expect my problem to be solved without a firmware upgrade.
illiac4
DD-WRT User


Joined: 08 Jun 2006
Posts: 123

PostPosted: Fri Feb 11, 2011 10:48    Post subject: Reply with quote
Running command:
nvram show | grep vlan | egrep port\|hwname | sort


Gives me:
size: 28770 bytes (32670 left)
new_vlan1hwname=et0
new_vlan1ports=1 2 3 4 8*
new_vlan2hwname=et0
new_vlan2ports=0 8
ping_ip=nvram show | grep vlan | egrep port|hwname | sort
port0vlans=2 18 19
port1vlans=3 18 19
port2vlans=3 18 19
port3vlans=1 18 19
port4vlans=1 18 19
port5vlans=1 2 3 16
vlan1hwname=et0
vlan1ports=1 2 3 4 8*
vlan2hwname=et0
vlan2ports=0 8


I have vlan1, vlan2, vlan3
vlan1 = port 3,4
vlan2 = wan port
vlan3 = port 1,2

Can you please give me startup example like this one:

echo "4 3 8*" > /proc/switch/eth0/vlan/1/ports
echo "2 1 0 8" > /proc/switch/eth0/vlan/2/ports



TNX
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware 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