Interface number for merging WAN to LAN on TP-link c59v2

hi guys.

I have tplink c59v2 running 21.02.3. I merged wan (eth1) no LAN (eth0)

config interface 'lan'                           
        option type 'bridge'                     
# bridge vlan10 (eth0.10 and wan (eth1) together)
        option ifname 'eth0.10 eth1'            
        option proto 'static'

but how to configure switch to vlan part? Currently I have config bellow:

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

Where 1 to 4 - ethernet switch ports (eth0 LAN).0 is CPU, but how to specify WAN (eth1)

My goal is. I'd like to setup eth1(WAN) intetrface as dot1q trunk and create multiple eth1.X subinterfaces for vlans.

Could you please suggest?

If I understand correctly, you just assign the other port - which is likely 5.

after implementing config bellow

config switch_vlan             
        option device 'switch0'
        option vlan '10'       
        option ports '1 2 3 4 0t 5' <--- t or w/o t 

followed by restarting network all LAN and WAN interfaces (eth0 and eth1) switch is not reachable at all.
interface eth1 is routed one, but not switchport interface. Looks like need to change mode from routed to switchport mode and than setup trunk.

or you guys has better idea?

Thank you.

Based on the device info page, you have eth0 for the WAN port and eth1 for LAN. This means that you need to remove eth0 from the wan network interface, and put eth0 into br-lan.

The default configuration for your device probably looks something like this:

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

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

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth1.1'

You need to remove eth0 from both wan and wan6 (or delete those interfaces entirely) and then make the br-lan definition look like this:

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth1.1'
	list ports 'eth0'

NOTE: it is possible that this could result in lower than expected throughput between eth0 (WAN port) and any of the ports on the switch (LAN 1 - 4). This is because the bridge is effectively a software based switch, meaning that the CPU is typically required to actually move data between those physical interfaces. The CPU itself my have limited bandwidth for this type of task (unlike the purpose built switch chips), thereby causing a bottleneck. As an example, the Ubiquiti ER-X has a 5-port switch which has a cool feature that the ports can included on the switch or removed from the switch and used as individually routed ports. When switching data between any of the ports on the switch, data can move at full gigabit speeds in each direction. However, when a routed port is bridged to the switch, the bandwidth is limited to approximately 250Mbps.

Hi Peter.

first at all thank you for explanations. Current config bellow:

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

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0.10 eth1'
	option proto 'static'
	option ipaddr '192.168.172.8'
	option netmask '255.255.255.240'
	option gateway '192.168.172.1'
	option broadcast '192.168.172.15'
#	option dns '192.168.172.2 192.168.172.4'
	option dns '127.0.0.1'

#-------------------- vlan config

#config interface 'vlan10'
#	option type 'bridge'
#	ption proto 'none'
#	ption ifname 'eth1.10'
#	ption ipv6 '0 

config interface 'vlan11'
	option type 'bridge'
	option proto 'none'
	option ifname 'eth0.11'
	option ipv6 '0'

config interface 'vlan12'
	option type 'bridge'
	option proto 'none'
	option ifname 'eth0.12'
	option ipv6 '0'

config interface 'vlan13'
	option type 'bridge'
	option proto 'none'
	option ifname 'eth0.13'
	option ipv6 '0'


config interface 'vlan14'
	option type 'bridge'
	option proto 'none'
	option ifname 'eth0.14'
	option ipv6 '0'

#config interface 'wan'
#	option ifname 'eth1.10'
##	option proto 'dhcp'
#	option ipv6 '0'

#---------------- shitch config

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

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

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

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

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

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

This tplink c59v2 ao has 1gb WAN and 4x 100/10 mbps LAN ports.
this is dump L2 access point L3 router in fron of it holds SVIs for VLAN 10-14. Connection between AP and router is .1q trunk (port 2 from access point side)
router in front of AP has all interfaces in 1gb speed.

idea is: Move trunk currently connected to 100/10 mbps LAN switch port #2 (AP side) to 1GB WAN port, but WAN port is routed port not switchport . Idea to just create 10-14 not holding IPs eth1 (WAN) subinterfaces from AP side doesn't work as per eth1 atill in access mode even it has 5 subinterfaces for vlans, but router interface reconnected to AP's WAN port in dot1q ytunk mode. so mismatch here...

Any idea how to force/configure 802.1q encapsulation for WAN eth1 interface?

thx.

IMO, there is little or no value in moving the trunk to the physical 1GBps WAN port unless you absolutely need the extra physical port. Because of the bridging, you might end up with slower throughput than simply putting everything on the switch and ignoring the WAN port entirely.

However, if you want to create additional VLANs on the WAN port, you would do it with dot notation (eth0.x where x is the VLAN ID).

So if you want to create a bridge for VLAN 11, as an example, it would look like this:

config device
	option name 'br-vlan11'
	option type 'bridge'
	list device 'eth1.11'
	list device 'eth0.11'

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

config interface 'vlan11'
	option proto 'none'
	option device 'br-vlan11'

i see. Thank you Peter.