Hi folks - a new OpenWRT user here. Working through the documentation and trying to understand the configuration paradigm.
I have an ASUS RT-N66U flashed with 24.10. I DO NOT intend to use the WiFi for obvious reasons. I believe that this router does not have support for DSA and requires "swconfig." To be honest, I'm not 100% sure what the swconfig part means.
I am trying to configure this router with and inbound internet connection on the WAN port and then each of the four physical ports being the internet feed to separate networks. DHCP servers should be associated with each port. Therefore, four separate DHCP server configs.
As I am understanding the general config process, network interfaces must first be defined with an assigned IP, network, and subnet mask. These parameter are then used to inform the range of the dhcp servers. ifname set the association with the physical port. Please correct me if any of these assertions are incorrect.
Below is a script I've been trying to use to configure the system, but with no success. The usual result after a restart is that I can't get a dhcp lease from any of the ports. The script is posted below for reference. It's a combination of ChatGPT, reading the doco, and trial and error. Firewall rules have been left out to simplify things.
Questions are:
for this configuration, are VLANs required? The outputs will be connected to a switch for VLANs
How do I find the correct naming for the physical interfaces? The ubus command does not show me what I would expect.
I'm assuming the switch config is required to associate with each interface. Is this correct? And, is enabling VLAN required?
Lastly, any thoughts on why it doesn't work?
Appreciate any assistance!
#!/bin/sh
# === NETWORK CONFIGURATION ===
# Remove default LAN/WAN
uci delete network.lan
uci delete network.wan
uci delete network.wan6
# VLAN setup via swconfig (old model)
uci set network.switch0=switch
uci set network.switch0.name='switch0'
uci set network.switch0.reset='1'
uci set network.switch0.enable_vlan='1'
# VLAN 10: Suite (port 1)
uci set network.vlan10=switch_vlan
uci set network.vlan10.device='switch0'
uci set network.vlan10.vlan='10'
uci set network.vlan10.ports='0t 1'
uci set network.suite=interface
uci set network.suite.proto='static'
uci set network.suite.ipaddr='192.168.10.1'
uci set network.suite.netmask='255.255.255.0'
uci set network.suite.ifname='eth0.10'
# VLAN 20: IoT (port 2)
uci set network.vlan20=switch_vlan
uci set network.vlan20.device='switch0'
uci set network.vlan20.vlan='20'
uci set network.vlan20.ports='0t 2'
uci set network.iot=interface
uci set network.iot.proto='static'
uci set network.iot.ipaddr='192.168.20.1'
uci set network.iot.netmask='255.255.255.0'
uci set network.iot.ifname='eth0.20'
# VLAN 30: Internal (port 3)
uci set network.vlan30=switch_vlan
uci set network.vlan30.device='switch0'
uci set network.vlan30.vlan='30'
uci set network.vlan30.ports='0t 3'
uci set network.internal=interface
uci set network.internal.proto='static'
uci set network.internal.ipaddr='192.168.30.1'
uci set network.internal.netmask='255.255.255.0'
uci set network.internal.ifname='eth0.30'
# VLAN 1: Monitor (port 4)
uci set network.vlan1=switch_vlan
uci set network.vlan1.device='switch0'
uci set network.vlan1.vlan='1'
uci set network.vlan1.ports='0t 4'
uci set network.monitor=interface
uci set network.monitor.proto='static'
uci set network.monitor.ipaddr='192.168.1.1'
uci set network.monitor.netmask='255.255.255.0'
uci set network.monitor.ifname='eth0.1'
# WAN port
uci set network.wan=interface
uci set network.wan.proto='dhcp'
uci set network.wan.ifname='eth0.2'
# === DHCP CONFIG ===
for net in suite iot internal monitor; do
uci set dhcp.${net}=dhcp
uci set dhcp.${net}.interface="${net}"
uci set dhcp.${net}.start='100'
uci set dhcp.${net}.limit='150'
uci set dhcp.${net}.leasetime='12h'
uci set dhcp.${net}.dhcp4="server"
uci set dhcp.${net}.dhcp6="server"
done
# === APPLY CHANGES ===
uci commit network
uci commit dhcp
/etc/init.d/network restart
/etc/init.d/dnsmasq restart
Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have: