I frequently setup OpenWRT router as a AP, by disabling dhcp server in LAN ports and enable DHCP client in for LAN in config/network. Disable Firewall, and it works nicely as AP, just that uplink needs to be plugged into one of the LAN ports
However sometimes it would be practical if I could remotely change MODE without a need to replug uplink from WAN to LAN port, as well as I would have 1 extra port for wired clients.
It's probably quite straight forward setup within /etc/config/network where VLANs are defined.
This is a bit device specific, but for dsa based devices, you can often delete the wan and wan6 network interfaces and then add the wan port to br-lan. On swconfig based devices, you’ll find the vlan associated with the wan port and remove the logical port that is associated with the wan port from that vlan, then add it to the lan’s vlan.
We can be more specific if you post the network config file (/etc/config/network)
use relayd:
Thanks @psherman , TBH I'm not aware which are DSA or swconfig devices
my typical /etc/config/network (this one for Archer C6 v2)
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd91:12cd:fed8::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0.1'
config interface 'lan'
option device 'br-lan'
option proto 'dhcp'
option ip6assign '60'
config interface 'wan'
option device 'eth0.2'
option proto 'dhcp'
config interface 'wan6'
option device '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 '2 3 4 5 0t'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '1 0t'
In my setup, no need to care the network config file, all setup by Luci GUI.
relayd is not appropriate for this situation.
Your device is swconfig based.
Edit the two vlan stanzas such that logical port 1 is removed from vlan 2 and added to vlan 1. It will look like this when ou are done.
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '1 2 3 4 5 0t'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0t'
This will make the wan port “just another port” on the switch.
Thanks @psherman I have this Archer C6 v2 on different location and the one that I can play now in the office is Archer AX23 which have different /etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd59:4b32:13ab::/48'
option packet_steering '1'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
config interface 'lan'
option device 'br-lan'
option proto 'dhcp'
option ip6assign '60'
config interface 'wan'
option device 'wan'
option proto 'dhcp'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
Do I then add
list ports 'lan5' or 'lan0'?
and looks like other Archers C6 v3.20 also have same type of config as AX32. The C6 v2 where I copied config/network from happens to also have a bit older version of snapshot firmware, or is just a different hardware setup that reflects this change.
I do normally also install Luci, but it's much easier for me to change config via ssh for remote routers. I've checked your post and I remember I was trying to do same thing when I was still using WR741, WR941, WR1043, but it never worked as I wanted.
Not sure what "relayd" is suppose to be.
In the second case (a device with DSA), the physical wan port will always be called 'wan' even if you attach it to the lan bridge. Add list ports 'wan'
to the br-lan and remove option device 'wan'
from the wan and wan6 networks, which you aren't using.
here is my network config (generated by luci), for your reference:
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option packet_steering '1'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'wan'
option ipv6 '0'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.1.3'
option delegate '0'
config interface 'wan'
option device 'wan'
option proto 'dhcp'
config interface 'wwan'
option proto 'dhcp'
config interface 'relay_wwan'
option proto 'relay'
option ipaddr '192.168.1.3'
list network 'lan'
list network 'wwan'
config device
option name 'eth0'
option ipv6 '0'
config device
option name 'lan1'
option ipv6 '0'
config device
option name 'lan2'
option ipv6 '0'
config device
option name 'wan'
option ipv6 '0'
config device
option name 'wlan1'
option ipv6 '0'
Thanks @RadioOperator Do you have Xiaomi AC1200 router as it looks that are only 2 lan ports. BTW I've just bought 2x last week, as quick look in support showed they are supported, but it seems it's not so straight forward to put OpenWRT on them.
My Xiaomi 4A Gigabit also printed AC1200 on the packing box.
I use
to install openwrt. If you are the same model, please check if it's V2, different.
Just to confirm and thank @mk24 that your suggestion worked flawlessly. I did disabled firewall, and dhcp server on lan, and set LAN device to be have dhcp client active not fixed IP (though I forgot at first, but was still able to connect to fixed IP, buy adding another IP from same class to my laptop net card.)
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.