This is the configuration of my Newifi D2:
config interface 'lan'
option type 'bridge'
option ifname 'eth0.1'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.100.1'
config device 'lan_dev'
option name 'eth0.1'
option macaddr '20:76:93:46:64:4f'
config interface 'wan'
option ifname 'eth0.2'
option proto 'dhcp'
option type 'bridge'
config device 'wan_dev'
option name 'eth0.2'
option macaddr '20:76:93:46:64:50'
config interface 'wan6'
option ifname '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 '0 1 2 3 6t'
option vid '1'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '4 6t'
option vid '2'
Basically, 4 LAN ports belong to 802.1q VLAN1, and the WAN port belong to VLAN2. The switch sends the data over the trunk interface (port 6t) to the internal computer (aka CPU), which receives all packets on its trunk port called eth0
, then separates the data to corresponding eth0.1
and eth0.2
interfaces. I have some questions:
- On the configuration above, what is the differences between
interface
anddevice
? The only difference I can see is that adevice
has MAC address, while aninterface
doesn't. Maybe we can create multipleinterfaces
on a singledevice
? But then, what is the purpose of it? - On LuCI, I can see the
lan
interface has the same MAC address withlan_dev
device (due to bridging?). But if I add anotherinterface
with same parameters:
config interface 'test-interface'
option type 'bridge'
option ifname 'eth0.1'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.100.123'
This test-interface
shows no MAC address on LuCI, unless I remove the option type 'bridge'
. I am very confused.