Need suggestion -- how to troubleshoot vlan trunking

Greetings, I am an old programmer trying to learn a new trick. I could use some suggestions on how to troubleshoot.

I have two routers, both running LEDE. The router nearest my ISP is a tplink Archer C2600. I have it set up for 3 vlans, and also for a trunk on one of the ports. Each vlan has both a physical lan port and a wifi. Everything seems to be working great on this router. So, now I am trying to send its 'trunk' to my 2nd router, which is the edgerouter ERX, also running LEDE. The C2600 is downstairs, the ERX is upstairs via some cat6 cabling.

But so far, I have not been able to receive any packets into the trunk port on the ERX. I suspect something is wrong with my config/network settings but I am not sure.

I am fairly sure that the trunk leaving the first router is working -- I connected it to a Ubuntu system (instead of the ERX) and monitored the trunk data with wireshark, and I also manually set up vlans on ubuntu for each of the 3 vlans and that worked OK.

So how to troubleshoot on the ERX end of things? thank you for any suggestions.

Here is my network config.

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 'fdf1:6833:c6bf::/48'

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

config device 'lan_dev'
	option name 'eth0.1'
	option macaddr '80:2a:a8:9e:3d:0e'

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

config device 'wan_dev'
	option name 'eth0.2'
	option macaddr '80:2a:a8:9e:3d:0f'

config interface 'wan6'
	option ifname 'eth0.2'
	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 vid '1'
	option ports '3 6t'

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

config switch_vlan
	option device 'switch0'
	option vlan '3'
	option vid '10'
	option ports '1 4t 6t'

config switch_vlan
	option device 'switch0'
	option vlan '4'
	option vid '20'
	option ports '2 4t 6t'

config switch_vlan
	option device 'switch0'
	option vlan '5'
	option vid '30'
	option ports '4t 6t'

config interface 'callisto'
	option proto 'none'
	option ifname 'eth0.10'

config interface 'ganymede'
	option proto 'none'
	option ifname 'eth0.20'

config interface 'europa'
	option proto 'none'
	option ifname 'eth0.30'

William

The config does not look right.
(I'm on my phone, so can't check atm)

But your using 'vlan' & 'vid' options for specifying VLAN numbers.
I think only one field of the 2 is correct.

But, for debugging what's on the switch chip, always refer to swconfig.
That util is the one that converts the switch config sections to config on the chip.

General usage:
swconfig dev switch0 help

You may be interested in
swconfig dev switch0 vlan get ports
to see VLAN memberships.

I recently also found that some cheap chips support only a limited number of VLANs.
Example: VLAN ids 1 to 15 (sounds very 4 bit-y)
So you may want to check if that's working on your chip to.

Again, swconfig will help here.
On a router of mine
swconfig dev switch0 vlan 16 get ports
will error.

Greetings,

Thank you very much for your insights -- yes I removed the 'vid' lines and used only the 'vlan' lines and the trunk is working! I still have more things that I hope to achieve but at least at this point I could move the ERX upstairs, and plug in 3 different PCs, each on their own subnet. By the way they will get their dhcp address from the first router downstairs via the trunk.

I have a couple more things I hope to do:

  1. turn the 'WAN' port into a 2nd trunk port ( erx port 4 connects to first lede router's trunk port downstairs), this 2nd trunk port would allow me to pass the trunked vlans along to another router or a ubuntu server that is set up for vlans.
  2. add some sort of interface to the the ERX itself which is reachable from downstairs via/thru the trunk. so I can remotely administer the erx lede software.

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 'fd9c:035e:78c1::/48'

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

config device 'lan_dev'
option name 'eth0.1'
option macaddr '80:2a:a8:9e:3d:0e'

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

config device 'wan_dev'
option name 'eth0.2'
option macaddr '80:2a:a8:9e:3d:0f'

config interface 'wan6'
option ifname 'eth0.2'
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 '6t'

config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0 6t'

config switch_vlan
option device 'switch0'
option vlan '10'
option ports '1 4t 6t'

config switch_vlan
option device 'switch0'
option vlan '20'
option ports '2 4t 6t'

config switch_vlan
option device 'switch0'
option vlan '30'
option ports '3 4t 6t'

config interface 'callisto'
option proto 'none'
option ifname 'eth0.10'

config interface 'ganymede'
option proto 'none'
option ifname 'eth0.20'

config interface 'europa'
option proto 'none'
option ifname 'eth0.30'

...................

output from swconfig:

VLAN 1:
vid: 0
ports: 6t
VLAN 2:
vid: 0
ports: 0 6t
VLAN 10:
vid: 0
ports: 1 4t 6t
VLAN 20:
vid: 0
ports: 2 4t 6t
VLAN 30:
vid: 0
ports: 3 4t 6t

thank you,

William

Glad it worked :slight_smile:

Cheers
Alex