Vlan of WAN on ipq40xx (AVM 4040)[solved]

Hello,
there are numerous posts about vlan tagging for this device, but after hours of reading I am confused.

My AVM 4040 router is behind a VMG1312 that acts as modem. The ISP requires internet traffic being tagged with vlan 7, and this is currently dealt with by the VMG1312. I would like to transfer vlan tagging to the router.

The approach would be to change the /etc/config/network file to

config interface 'wan'
	option ifname 'eth1.7'
	option proto 'pppoe'
	... other pppoe options
config switch_vlan
	option device 'switch0'
	option vlan '7'
	option vid '7'
	option ports '0t 5t'

There is a bug report about "WAN interface VLAN not working on AVM FRITZ!Box 4040". Furthermore, in this thread @jeff reports 'Now, I need to trunk VLANs over the Internet port' with subsequent requirement for bridging WAN and LAN.

Before testing this on my system I would like to get advice first. In the past, bad settings have caused considerable pain :unamused:

Will this scheme work?
vlan-id......0 (CPU)...1-4 (LAN).....5 (WAN)
1&2*
7................... t...............u....................t

  • it has been strongly recommeded to leave vlan setting for 1&2 to default

Cheers
Oscar

I have a ipq40xx device running latest trunk and my ISP requires traffic tagged with vlan20.

Here is my network config that works perfect.

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 'fd16:3273:62af::/48'

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

config interface 'wan'
        option proto 'dhcp'
        option ifname 'eth1.20'
        option peerdns '0'
        list dns '8.8.4.4'
        list dns '8.8.8.8'
        list dns '9.9.9.9'

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

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

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

Thank you, I might give it a try tomorrow.
I hope, since your router apparently sits behind another router, this does not make a (the) difference. Is your WAN port number 5 and CPU number 1?

Yes, WAN port is 5 and CPU 1.

Couldn't wait until tomorrow ....
As soon as I set ports 0&5 to vlan7 tagged and wan port to eth1.7 I was disconnected from the internet. The computer connected through ethernet cable could not reach the router.

I was lucky that I still could access the router via wlan and reset changes.

What am I missing?

Try my exact config and only change all the 20's to 7's

My fault, did in in a hurry and made typos. It is the config in the initial post and as proposed by @Gingernut.

One important note though: tagging with vlan 7 had been handled by the modem device. Addtionally setting vlan 7 by the router resulted in failure to connect to the internet. I had to turn it off on the modem.

Thank you @Gingernut

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.