Main router : RT-AC3200 with FreshTomato 2021.7
192.168.10.1/24 : for main network (VLAN ID : 1) with DHCP server
192.168.20.1/24 : for guest network (VLAN ID : 3) with DHCP server
----
AP1 = RT-AC68U (AsusWRT-Merlin 386.7_2)
Set as AP with IP = 192.168.10.2
WAN Port = Trunk port to main router (RT-AC3200)
LAN 1 = member of VLAN 3, wired guest.
LAN 2, 3, 4 = member of VLAN1, wired main network.
Above code is perfectly fine for AC-68U running AsusWRT-Merlin.
Now the wifi chip is dead (2.4GHz), I have bought AC-86U to replace it.
The purpose is similar to AC-68U, WAN port as trunk port and LAN port 1 for wired guest.
problem is :
LAN port #2, #3, #4 can't get IP address (192.168.10.x) from DHCP server.
While LAN port #1 has no problem get IP address (192.168.20.x).
@Yota @LeandroBR @Jack Yaz
192.168.10.1/24 : for main network (VLAN ID : 1) with DHCP server
192.168.20.1/24 : for guest network (VLAN ID : 3) with DHCP server
----
AP1 = RT-AC68U (AsusWRT-Merlin 386.7_2)
Set as AP with IP = 192.168.10.2
WAN Port = Trunk port to main router (RT-AC3200)
LAN 1 = member of VLAN 3, wired guest.
LAN 2, 3, 4 = member of VLAN1, wired main network.
Code:
#!/bin/sh
# WAN Port as Trunk Port
robocfg vlan 1 ports "0 2 3 4 5t" <<-- remove LAN port #1 from native VLAN
robocfg vlan 3 ports "0t 1 5t" <<<-- LAN Port #1 for wired Guest (VLAN 3)
vconfig add eth0 3
ifconfig vlan3 up
brctl addbr br1
brctl addif br1 vlan3
ifconfig br1 192.168.20.2 netmask 255.255.255.0
ifconfig br1 up
nvram set lan_ifnames="vlan1 eth1 eth2"
nvram set lan_ifname="br0"
nvram set lan1_ifnames="vlan3"
nvram set lan1_ifname="br1"
killall eapd
eapd
Above code is perfectly fine for AC-68U running AsusWRT-Merlin.
Now the wifi chip is dead (2.4GHz), I have bought AC-86U to replace it.
The purpose is similar to AC-68U, WAN port as trunk port and LAN port 1 for wired guest.
Code:
# Physical port to interface map:
# eth0 WAN
# eth1 LAN 4
# eth2 LAN 3
# eth3 LAN 2
# eth4 LAN 1
# eth5 2.4 GHz Radio
# eth6 5 GHz Radio
vlanctl --mcast --if-create eth0 3
vlanctl --if eth0 --rx --tags 1 --filter-vid 3 0 --pop-tag --set-rxif eth0.v3 --rule-append
vlanctl --if eth0 --tx --tags 0 --filter-txif eth0.v3 --push-tag --set-vid 3 0 --rule-append
ifconfig eth0.v3 up
brctl delif br0 eth4 <<-- remove LAN port #1 from native VLAN
brctl addbr br1 <<-- create br1 for VLAN 3
brctl addif br1 eth4 <<-- add LAN port #1 to br1
brctl addif br1 eth0.v3 <<-- add WAN port with tagged to VLAN 3
ifconfig br1 192.168.20.2 netmask 255.255.255.0
ifconfig br1 up
nvram set lan_ifnames="eth0 eth1 eth2 eth3 eth5 eth6"
nvram set br0_ifnames="eth0 eth1 eth2 eth3 eth5 eth6"
nvram set br1_ifname=br1
nvram set br1_ifnames="eth0.v3 eth4"
nvram set lan1_ifname=br1
nvram set lan1_ifnames="eth0.v3 eth4"
ethswctl -c hw-switching -o disable
killall eapd
eapd
problem is :
LAN port #2, #3, #4 can't get IP address (192.168.10.x) from DHCP server.
While LAN port #1 has no problem get IP address (192.168.20.x).
@Yota @LeandroBR @Jack Yaz