OpenWrt Forum Archive

Topic: Wan on a specific vlan (tl1043v2) [SOLVED]

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

Hello,

I have an internet connection from the french ISP "free" through fiber and an ethernet converter. The ethernet has two lans tagged 835 and 836, the first for TV and the second for internet.
On my desktop, if I want to connect I run the following commands with success:

vconfig add eth0 836
dhclient eth0.836

Now I’m confused with OpenWrt Barrier breaker r40526

I just tried the same thing using udhcpc but I got no ip.

I am somewhat lost. There are tons of documentations about vlan tagging, but are they even relevant for my situation? I don’t want to build a fancy network at home.
In /etc/config/network, I tried:

config interface 'wan'
    option ifname 'eth0.836' # instead of ifname 'eth0'
    option proto 'dhcp'

The interface eth0.836 was created, but no more luck to get an ip.

There is some discussions that the driver doesnot support more than 128 vlans, but you can set vid to anything arround 4k http://blog.philippklaus.de/2012/12/ope … ment-10334
Is this relevant to my case? So should I create a third vlan with vid 836 only on port 5 (the wan port: http://wiki.openwrt.org/toh/tp-link/tl- … for.vlans) I had little succes there either.

So: I’m not sure what is relevant relevant to my problem and I would appreciate links to a more specific documentation

(Last edited by tristramg on 20 Apr 2014, 11:58)

Hey there.

You skipped the most important part of your configuration: The switch.

Usually the WAN port of your switch is untagged, meaning:
* Incoming packages are treated as untagged.
* So they get tagged when joining the device.
* And tags get removed when packages leave the device.

Here is my vlan 2 switch configuration.

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

This is not what you want. You have two different vlans on the outside of your switch.
So you need to define your port not "1" but "1t".

This configuraiton is from my TP-Link 4900 v1, and my WAN port is numbered as "1" internally. Internal port "0" is for CPU, which needs to be "0t" as well in order to allow the OpenWRT linux to interact with that particular vlan. According to the wiki part "Switch Ports" you're right: You need to use 5 for WAN. But I don't want to adjust my working configuration fragment.

Tagged port means:
* The package on the outside of the switch is required to be tagged.
* It has to have the exact matching vlan id to join, other packages are dropped.


I guess your configuraiton should look somthing like:

config switch_vlan
        option device 'switch0'
        option vlan '835'
        option vid '835'
        option ports '0t 5t'

config switch_vlan
        option device 'switch0'
        option vlan '836'
        option vid '836'
        option ports '0t 5t'

That should give you virtual devices "eth.835" being responsible for vlan 835 and "eth.836" being responsible for vlan 836.
And since this is completely made up for you, I used the 5 here for your WAN port according to documentation.

The thing is: You need to make the switch port aware of your desired vlans. If you do your switchport wrong, it will either
* skip vlans and on the outside of your switch all packages appear as untagged in case you assing only "5" instead of "5t" or
* completely skip switching those packages if you don't assign the port 5 to that vlan at all.

Regards,
Stephan.

Hello Stephan,

Thanks a lot.
It worked and I appreciate the explanations.

For information for someone having troubles with the same hardware:
On my device (v2 of the 1043ND), there seem to be two "cpu" ports (0 used for the switch and 6 for the wan as suggested in the wiki)
So I had to use

option ports '5t 6t'

As

option ports '0t 5t'

would lock me out and I had to reset the configuration

The discussion might have continued from here.