OpenWrt 22.03.x TMNet UniFi Configurations | D-Link DIR-842 (swconfig)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
Switch configuration
Software vs hardware ports in OpenWrt
VLAN tagging
/etc/config/network
...
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 '0t 4 3 2'
option description 'LAN'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0t 5t'
option vid '500'
option description 'Internet'
config switch_vlan
option device 'switch0'
option vlan '3'
option ports '1 5t'
option vid '600'
option description 'IPTV'
VLAN tagging in LuCi
Example full network configuration
/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'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0.1'
config device
option name 'eth0.1'
option macaddr 'XX:XX:XX:XX:XX:XX' # LAN mac address
config interface 'lan'
option device 'br-lan'
option proto 'static'
option netmask '255.255.255.0' # Netmask
option ip6assign '64'
option ipaddr '192.168.0.1' # Gateway IP
config interface 'wan'
option proto 'pppoe'
option device 'eth0.500'
option username 'username@unifi' # The PPPoE username provided by TM
option password 'password' # The PPPoE password
option peerdns '0'
list dns '8.8.8.8'
list dns '1.1.1.1'
option ipv6 '1'
config interface 'wan6'
option proto 'dhcpv6'
option device '@wan'
option reqaddress 'try'
option peerdns '0'
list dns '2001:4860:4860::8888'
list dns '2606:4700:4700::1111'
option reqprefix 'auto'
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 '0t 4 3 2'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0t 5t'
option vid '500'
option description 'Internet'
config switch_vlan
option device 'switch0'
option vlan '3'
option ports '1 5t'
option vid '600'
option description 'IPTV'