Set the second VLAN to number 7 instead of 2.
Make the WAN Ethernet port (1) tagged in that VLAN.
Leave the eth0 CPU port (switch port 6) untagged like in the default configuration. The switch hardware will handle adding and removing tags. Set up that way, the WAN network should be attached to eth0, not eth0.7.
Seems that this is the reason why I did not get it . @mk24 proposes to tag port WAN only (config switch_vlan option device 'switch0' option vlan '7' option ports '1t 6' I suppose)
@dlakelan implies I'd need to tag port eth0 as well
In your current settings, eth0 is tagged "option ports '1 6t'" this connects the WAN labeled physical port to the switch hardware untagged, but sends the packet to the CPU tagged (the switch tags it).
Instead you need the WAN port to send things tagged because that's what your ISP wants. and it wants them tagged with VLAN 7. One correct way to do this is:
option ports '1t 6t'
and then make the WAN "interface" connect to eth0.7
another option is to make port 6 (eth0) untagged, and make WAN interface connect to simply "eth0", since it only interacts with one VLAN and it's therefore unambiguous. The switch hardware will stick the tag on when it goes out the WAN port. But I don't recommend this, I generally used tagged interfaces on infrastructure equipment where possible (ie. routers, switches, APs etc)
Since your ISP is sending you tagged packets, they will come in port 1 tagged, and if you don't make eth0 also tagged, then the switch will actually strip the tag to send it to your router. And vice versa, you'll send untagged packets and the switch will add the tags. Not that this is a problem, but it seems to me like we're better off just having the whole path tagged.
Unfortunately, none of the suggestions worked. I always made the changes directly to the network file, but the physical connection to eth0.X in LuCI. Also rebooting did not help.
It was also stressfull to revert to the previous status. I did it in LuCI, but still no connection to the internet. Then I looked into the network file
i.e. removed the vid option lines (which I did not put in there, must be from LuCI), restarted network, and internet was back. I don't understand that.
It appears you were never running "1t". That is very important, that is the only way the packets will go out over the Ethernet cable to the modem with tags included.
I suggest resetting to a default configuration, make the only change to change the switch config vlan number from 2 to 7 and change port 1 from untagged to tagged. Then set up your pppoe WAN normally on eth0.
The vid option optional in many cases. It is the tag number that is actually in the packet. It has a possible range from 1 to 4094. The vlan option is an index into the switch's table of VLANs. Most consumer equipment has a table much smaller than 4094. I think the switch in the C7v2 can handle up to vlan=127. Many 10/100 SoCs only allow 16.
If you set a vlan but not a vid, it uses the same number for both. This is fine when the vlan numbers are smaller than the maximum table size supported.
You can run swconfig dev switch0 show to read what actually ended up loaded into the switch hardware.
Are you trying to get like a second "channel" on the WAN? (ie. for TV data or something)?
You say "internet was back" but if your ISP requires you to send vlan tag 7 then neither of your configs, nor the default config should ever have worked in the first place.
In any case, if you need vlan 7 then set it up like @mk24 says above. If you need vlan7 to be a second channel then please describe more fully what exactly you need to send and receive on the ISP side?
When you say modem, does the modem get removed from the circuit when you set up your router to tag packets? If it's feeding your router untagged packets and expecting untagged packets, then it will likely ignore your packets once they are tagged. I assume the tags are for some hardware farther upstream.
Sorry, I don't understand. The modem is actually a router, set into bridged mode. For the vdsl profile I can tick to use vlan and then specify the number. When I made the changes on the lede-router, I ticked off usage of vlan before.
I believe in bridged mode the modem either tag or not, depending on the setting. It should not strip tags off, whether they are on outbound data from the router or on inbound from the ISP.
I haven't seen you post a correct config and tell us whether it works or not. I can't really figure out if you tried a correct config, and it didn't work (say, because sending / receiving tagged packets isn't actually supported by your router/modem) or if you never actually configured it correctly and that's why it didn't work.
based on your description of what you need, you should have:
this does what you asked for: tag packets outgoing / incoming on WAN with VLAN 7. if that doesn't work it's because you're mistaken about what is needed, or haven't configured your ISP modem/router correctly.
I have to admit that I did not provide much data, I reckoned this would be a simple thing.
My Archer C7 is sitting behind a modem-router ('modem') that has been put into bridged mode. The modem can handle vlan tagging. Here is a screenshot:
There's no need for a VLAN tag here. If you have your public IP arriving at your router, and incoming connections pass through the modem, that is all that is possible.
VLAN tagging is for cases where the ISP does not let the customer configure the modem, and it is set up to use VLAN tags. Mostly this is done so the ISP has a separate VLAN for their IPTV boxes. When there is just Internet service, with one Ethernet cable from the modem to the router, it does not need to be tagged.
Sure, but on the connection between his router and his ISP equipment, he's turning off vlan tagging on the ISP device, and then sending tagged packets to it... and somehow being surprised that it doesn't work.
If he turns on vlan tagging on the ISP equipment and has tagging on his LEDE router, it may work, but it has basically zero benefit unless he wants a second channel on his WAN side. vlan tagging is explicitly used to multiplex/de-multiplex different "channels"
It does make sense to do the vlan tagging on the (OpenWrt-) router, instead of making the modem do it for the router - and for several configurations it's even necessary (e.g. 'internet' on vlan tag 7, IP-TV on vlan tag 8, keeping the modem management interface untagged, etc.). How that is about to be configured on the modem is another question, I'm personally doing exactly that (vlan tagging on the router, not the modem), but using a different VDSL modem - so I can't really help you with the vmg1312-b30a (your wan6 configuration should use option ifname '@wan' though).