Help needed with trunked VLAN on ISP's WAN port

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
pingdrive
DD-WRT Novice


Joined: 27 Jan 2019
Posts: 4

PostPosted: Wed Jan 30, 2019 5:40    Post subject: Help needed with trunked VLAN on ISP's WAN port Reply with quote
I've upgraded the firmware on my Netgear R7000 from stock to DD-WRT (v3.0-r37015M (09/23/1Cool), such that I can enjoy the additional features this brings (DNS, SSH, webserver, proper firewall, etc.). If somebody can help with my VLAN problem below I would be very grateful Smile.

I originally posted this in the Advanced Networking Forum, but they pointed me to this forum as I have a Broadcom chipset.

VLAN tagging problem
Unfortunately, I cannot get internet to work yet, as I'm not sure how to implement VLAN tagging.

My ISP provides internet and IPTV trunked over one line as follows:

Quote:
Ethernet VLAN Priority/ VLAN ID: 1/34
IPTV_Ethernet VLAN Priority/ VLAN ID: 5/4


On the stock Netgear firmware, I solved this by adding VLAN ID 34 at prio 1 to all LAN and WAN portsin the Advanced -> VLAN settings:

Quote:


However I don't know how to do this in DD WRT. Does anyone know how to replicate this in DD-WRT?

Similar issues

  1. I found this post that seems to solve my problem for an Atheros-based router, but that does not work for me as I don’t have swconfig:

    Quote:
    Does not work for me:
    swconfig dev eth0 vlan 2 set vid 500
    swconfig dev eth0 vlan 2 set ports '0t 5t'
    swconfig dev eth0 vlan 1 set ports '0t 1 2 3 4 5t'
    swconfig dev eth0 set apply
    vconfig add eth0 500
    ifconfig vlan500 up
    nvram set pppoe_wan_ifname=“vlan500"


  2. I also found a possible solution via OpenWRT using /etc/config/network, but that file does not exist on DD-WRT (different architecture?).

  3. This post is similar, alas without solution.

  4. I read the Switched Ports wiki article, but the example there does not work for me (see below).

  5. I’ve also read this post, but afraid I don’t fully understand it.


My attempts
Attempt 1
Based on the above and some more, I made the following attempts. My default config is as follows:

Quote:
root@R7000:~# nvram show | grep vlan.*ports | sort
size: 38284 bytes (27252 left)
vlan1ports=4 3 2 1 5*
vlan2ports=0 5u
root@R7000:~# nvram show | grep port.*vlans | sort
size: 38284 bytes (27252 left)
port0vlans=2 18 19 21
port1vlans=1 18 19 21
port2vlans=1 18 19 21
port3vlans=1 18 19 21
port4vlans=1 18 19 21
port5vlans=1 2 16
root@R7000:~# nvram show | grep vlan.*hwname | sort
size: 38284 bytes (27252 left)
vlan1hwname=et0
vlan2hwname=et0


Such that I thought this would solve it:

Quote:
# Set up VLAN 34
nvram set vlan34hwname=et0
# Set tagging on 0 (WAN port)
nvram set vlan34ports="0t 5u"
# Set reciprocal values on port* variables
nvram set port0vlans="34 18 19 21"
nvram set port5vlans="1 34 16"
# Unset the old VLAN 2
nvram unset vlan2ports
nvram unset vlan2hwname

# Not sure if this is necessary, the startup script doesn’t work either with or without
/sbin/ifconfig vlan2 down
/sbin/vconfig rem vlan2
/sbin/vconfig add eth0 34
/sbin/ifconfig vlan34 up
/sbin/ifconfig vlan34 txqueuelen 0

# Use newly created VLAN34 for WAN as well.
nvram set wan_default="vlan34"
nvram set wan_ifname2="vlan34"
nvram set wan_ifname="vlan34"
nvram set wan_ifnames=“vlan34"

nvram commit


However, after I nvram commit & reboot, DD-WRT resets itself completely, including the username & password.

Attempt 2
I also tried a solution based on this solution, but translating this and using it as a startup script also doesn’t work for me:

Quote:
# Based on https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=86919&start=133
# Clear VLAN 2
echo "" > /proc/switch/eth0/vlan/2/ports
# Configure VLAN 34 with WAN port (tagged) and CPU port (untagged)
echo "0t 5u" > /proc/switch/eth0/vlan/34/ports


Furthermore, the settings are not stored literally, which makes me think I set something wrong:

Quote:
root@DD-WRT:~# cat /proc/switch/eth0/vlan/34/ports
0t 5t*


And somehow nvram does not show the /proc settings at all:

Quote:
root@DD-WRT:~# nvram show | grep vlan34
size: 35524 bytes (30012 left)


Attempt 3
I’ve also tried yet another solution proposed, and translated that to my situation as follows:

Quote:

# Remove old VLAN
/bin/echo "" > /proc/switch/eth0/vlan/2/ports

# Add new VLAN. Neither “0 5t” nor “0t 5t” work
/bin/echo "0t 5t" > /proc/switch/eth0/vlan/34/ports

# remove and add interface, with exciting new parameter set_name_type
/sbin/vconfig rem vlan2
/sbin/vconfig set_name_type VLAN_PLUS_VID_NO_PAD
/sbin/vconfig add eth0 34
/sbin/ifconfig vlan34 up


And finally enable WAN on vlan34 manually via the web interface, alas also without success, but at least DD-WRT did not reset itself.

Some things I'm confused about:

  1. What is the difference between the "VLAN Tagging" settings on Setup -> Networking and the "Tagged" option on Setup -> VLANs? In the Atheros example above, VLAN #2 is tagged with ID 500, so this means these are two different parameters? Possible answer (source) is that these two settings are for Broadcom/Atheros chipsets. However this conflicts with answers where VLAN number != VLAN TAG ID, i.e. that vlan2 can be tagged with vlan ID 34.
  2. Why is swconfig not available on all routers? Can I replicate all swconfig commands with nvram equivalents?
  3. Why does DD-WRT reset all settings after I update settings via nvram? Is this a fail-safe to protect against bad settings?
  4. Do I need all VLAN settings shown in nvram or not? Why do nvram settings not show up in /proc/switch/eth0/vlan/34 and vice versa?


Does anyone have an idea how to solve this? Thanks in advance!
Sponsor
Display posts from previous:    Page 1 of 1
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