Understanding 21.02 network device configs

The following is the firstboot defaults for a Netgear wndr3800 (ath79)

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 'fd94:bcbf:fc59::/48'

config interface 'wan'
        option device 'eth1'
        option proto 'dhcp'

config interface 'wan6'
        option device 'eth1'
        option proto 'dhcpv6'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'

config device
        option name 'eth0'
        option macaddr '86:1b:5e:7a:80:0d'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.2.1'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'
        option blinkrate '2'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 1 2 3 5'

config switch_port
        option device 'switch0'
        option port '1'
        option led '6'

config switch_port
        option device 'switch0'
        option port '2'
        option led '9'

config switch_port
        option device 'switch0'
        option port '5'
        option led '2'

I understand eth0 and how it is tied into the bridge br-lan.
Question 1: Why doesn't eth1 have a similar definition? Is it because we don't want to put it into a bridge so we can just use it as it is? Essentially, why doesn't it look like the example on the wiki.
Question 2: If i want to change my WAN mac address, would i create a config device section for it and then specify the macaddr, or do i just specify it on the interface wan as it was done previously?
Question 3: I never had a device that had this, but i assume the new device sections replace things like this

config device 'wan_eth0_2_dev'
	option name 'eth0.2'
	option macaddr 'XX:XX:XX:XX:XX:XX'

Thanks

  1. Your configuration is 'old-style', wiki refers to 'modern' DSA configuration.
  2. Add 'macadrr' option to interface, if explicit device section is not present.
  3. Refer to 2)

So it would appear it's valid to define my own device section for eth1 (like eth0) and set the macaddr there.

So DSA or not doesn't seem to be the answer.
Either way, looks like I can approach it in a standard manner and that's what I wanted to know/do.

correct... further more... it's recommended... macaddr honouring under interface section currently is a product of legacy support code...

ultimately L2 properties are defined within dedicated device sections...

not quite accurate... the presented config is;

  • the NEW config-network-device format
  • without dsa migration

the two are not mutually inclusive...

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.