Migrating `swconfig` to DSA

My new router has support only via snapshots right now so need to migrate my old swconfig to DSA.
It's a rather simple setup prescribed by my ISP for PPOE and IPTV.

And this network configuration with the relevant bits.

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'

config interface 'wan'
        option proto 'pppoe'
        option ifname 'eth0.6'

config interface 'wan6'
        option proto 'dhcpv6'
        option auto '0'
        option ifname 'eth0.6'

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 '2 3 6t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '1t 6t'
        option vid '6'

config switch_vlan
        option device 'switch0'
        option vlan '3'
        option ports '1t 6t'
        option vid '4'

config switch_vlan
        option device 'switch0'
        option vlan '4'
        option ports '1 6t'
        option vid '2'

Based on reading up a little, this is what I have understood is that you need to add/etc/hotplug.d/iface/21-lan with the relevant rules.
I am a bit lost with how to assign the WAN port in my case. Do note that I am not really interested in setting up IPTV, so I don't really need anything on my LAN ports.

#!/bin/sh
[ $INTERFACE = lan -a $ACTION = ifup ] || exit 0

#Ethernet 1
bridge vlan add dev ethernet1 vid 1 untagged

#Ethernet 2
bridge vlan add dev ethernet2 vid 1 untagged

#BR-LAN (CPU)
bridge vlan add dev br-lan self vid 1 tagged
bridge vlan add dev br-lan self vid 2 tagged
bridge vlan add dev br-lan self vid 4 tagged
bridge vlan add dev br-lan self vid 6 tagged

Am I in the heading in the right direction?

See also, which is probably where the GUI will head as per PR4307, Supposedly the requisite bits are in place in snapshot, but I ran into issues.

1 Like