OpenWrt Forum Archive

Topic: WAN VLAN tagged with ID=201

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

I have On Networks N150R with OpenWrt openwrt-15.05.1-ar71xx-generic-n150r-squashfs-factory.img from jchau’s Google drive (found via a thread referenced on the OpenWrt N150 page) – and apparently working. For use with CenturyLink GPON (fiber optic) Internet for the WAN I need VLAN autodetect, tagged, ID 201. Can I do this? I’m not finding it in the web-based setup interface. (I did find the PPOE login setting in the setup interface).

Possible clue: jchau says that image has "•enabled CONFIG_LUCI_SRCDIET, which "Minify Lua sources".

(Last edited by donparda on 23 Oct 2016, 07:28)

VLAN functionality is built in.
Edit "wan" interface and go to "physical settings".
Look which physical device assigned. If its "eth1", select "custom interface" and write there "eth1.201"
If its "eth0.<something>" then you need additional switch configuration.

Looks like I need additional switch configuration. I still find myself wondering if there is something that got left out of this "compressed-to-use-less-memory" build that eliminated an easy way to setup VLAN tagging on the WAN. Or am I just ignorant about the simple way to add the additional switch configuration? Or does the modem not support VLAN tagging on the WAN?

The WAN is shown as etho.
Interfaces - WAN
Ethernet Adapter: "eth0" (wan, wan6) <<< this one is checked
Ethernet Adapter: "eth1" (lan)
VLAN Interface: "eth1.1"
Wireless Network: Master "OpenWrt" (lan)
Custom Interface

Under network switch I find the following, which leaves me confused where WAN fits in the picture.

VLAN ID       CPU         Port 1           Port 2    Port 3    Port 4    
Port status:1000baseTno link      no link    no link    no link   
                   full-duplex   

I've figured out that Port 1 and Port 2 are the two LAN ports on the router. CPU always shows 1000baseT. I connected the WAN port of the N150R router to a LAN output of the existing router connected to the modem, and I could access the Internet through the N150R router but I saw no change (WAN didn't show up) on the network switch page of the N150R web interface.

Everything is there.
Usually routers have 1 or 2 ethernet adapters.
When router has 2 adapters, usually eth0 is connected to switch and serves as LAN, eth1 connected to WAN without switch.
Determine which physical adapter connects to WAN. You pretend it to be eth0. Are you sure ?

1) If you receive tagged traffic from eth not connected to switch - just change "ethx" to "ethx.y" and you get there only tagged traffic with vlan tag "y".
2) If you receive tagged traffic from eth connected to switch then create switch_vlan with required id and make sure CPU and inbound ports are both configured as tagged for that VLAN and do the same as in 1)

example of connecting ISP with tagged traffic thru one of the switch ports :

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config interface 'wan'
        option proto 'dhcp'
        option ifname 'eth0.201'

config switch_vlan
        option device 'switch0'
        option vlan '201'
# 2 - inbound port, 5 - cpu port
        option ports '2t 5t'

Also configure additional vlan for LAN and configure its network interface properly or you cut yourself from the router.
Thats all the magic. But if you have 2 eth then use the one not connected to switch for WAN !

(Last edited by bolvan on 24 Oct 2016, 08:59)

I edited (Network, Interfaces, WAN) to set custom interface eth0.201. After the edit WAN showed "unsupported protocol type. Install protocol extensions." and there was not response to the edit button for WAN. I recovered by reloading the firmware without saving the configuration after failing to figure out an easy way to return to default settings.

As best as I can tell WAN is on etho and LAN is on eth1. From Network, Interfaces, LAN I see
General
     static
     192.168.1.1
      255.255.255.0
Physical
      Bridge Interface - checked
      Interface
          Ethernet Adapter eth1 (lan) - checked
          Wireless Network Master "OpenWRT" (lan) - checked

Network, Interfaces, Physical for both WAN and WAN6 show "Ethernet Adapter "eth0" (wan, wan6)". Must admit, I don't understand how WAN6 fits into the picture.

Should I normally be able to setup VLAN 201 on WAN using only the graphical interface, or do I have to get in to Linux? Which graphical interface screens would I use - I'm thinking I'm not seeing all of the screens on my installation, which as mentioned earlier involves a compression to solve a not-enough-memory problem.

(Last edited by donparda on 26 Oct 2016, 18:09)

Yes, you can setup any custom name for physical interface. Type there "eth0.201"
Unknown protocol type must be caused by absense of "proto" option or invalid value there

(Last edited by bolvan on 26 Oct 2016, 19:53)

I'm moving in the direction of thinking that my router hardware does not support VLAN tagging on the WAN. I think the problem might be that my WAN does not show up on my switch. I found a blog by Scott R McClure where he uses OpenWrt for CenturyLink fiber but it appears his WAN shows on his switch.

Don't know if this might help understand my router. I backed up my config using the web interface. Below is the contents of the network file. On my router I have a WAN port and 2 LAN ports. I think the router internally has 2 additional LAN ports that are not brought out for connection. The OpenWrt web interface for the switch shows a CPU and 4 ports. By experimenting I have been able to trace ports 1 and 2 to the LAN connectors on the router, and no change showing on any of the ports as I connect and disconnect to the WAN port.

config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config globals 'globals'
    option ula_prefix 'fd4a:89ce:330c::/48'

config interface 'lan'
    option ifname 'eth1'
    option force_link '1'
    option type 'bridge'
    option proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'
    option ip6assign '60'

config interface 'wan'
    option ifname 'eth0'
    option proto 'dhcp'

config interface 'wan6'
    option ifname 'eth0'
    option proto 'dhcpv6'

config switch
    option name 'switch0'
    option reset '1'
    option enable_vlan '1'

config switch_vlan
    option device 'switch0'
    option vlan '1'
    option ports '0 1 2 3 4'

Old thread, have you solved this? Background: I am trying to achieve a similar thing on a WRT1900ACS v1.

I don't think your WAN port is not showing, but you'll have to find out which of the 5 (0..4) ports actually belongs to WAN. Assuming it is port 0, try this...

config switch
    option name 'switch0'
    option reset '1'
    option enable_vlan '1'

config switch_vlan
    option device 'switch0'
    option vlan '1'
    option ports '1 2 3 4'
    option vid '1'

config switch_vlan
    option device 'switch0'
    option vlan '2'
    option ports '0t'
    option vid '201'

Difference to your config is the "vid" line and the  "t" so the WAN port will be tagged. Also, the LAN ports have been moved to a different VLAN (but they remain untagged).

Then also set the WAN interface to physical adapter eth0.201.

Note that probably WAN uses two ports (e.g. 0 and 3, one internal, one external) and LAN uses three ports (e.g. 1, 2 and 4, one internal, two external). Unfortunately I couldn't find a layout of how your hardware is mapped internally.

(Last edited by floydburgermcdahm on 26 Jan 2017, 23:13)

I never solved it. I'll probably try again sometime in the future, but the priority dropped as my 30 days to return the Century Link modem I was hoping to replace was running out, plus I read the fine print and decided I was authorized to return the Century Link modem within 30 days only if it was not working or I was quitting the Century Link Internet service.

The next thing I going to try was to edit a copy of the existing configuration file using a text editor, then replace the existing configuration file with the edited configuration file. I was going to try this in case my problem was the "reduced-memory" configuration of OpenWrt I was using didn't have a full-capability user interface and that was why I wasn't seeing the options to set up ID=201. If somebody has solved this, I would appreciate a post of the configuration file.

Ok, I'll let you know once I have successfully tried the above lines in the network config file plus this:

config interface 'wan'
    option ifname 'eth0.201'

Will be some time in March. I can confirm right now that applying all those settings when your modem does not expect VLAN tagging will definitely cut your WAN connection off. wink

By the way, the standard stable OpenWRT build LuCI interface for my device did not show switch configuration either after installation. However, after I added the lines to the config file, it did show up in the user interface under Network -> Switch.

The discussion might have continued from here.