R8000 - which hardware devices do eth0 eth1 eth2 actually represent?


#1

I'm doing my first dabble into splitting radios and management on my R8000, and finding that I'm limited by lack of certainty about the router's networking design. I need better understanding of the ethernet/wlan ports detected, and especially, what the 3 "eth" and 3 "wlan" ports actually represent in physical hardware.

(Note: The R8000 is behind a primary router so it doesn't have a "WAN". I've deleted the WAN definitions and will reuse that port as a 5th "ordinary" port, which has affected the ifconfig data)

A quick look at ifconfig suggests that my R8000 has the following "real" network devices. But what does each represent?

  • br-lan HWaddr E8:FC:AF:FD:2B:BE inet addr:10.0.0.1 Bcast:10.255.255.255 Mask:255.0.0.0 UP RUNNING - this is obviously the default LAN if that OpenWRT creates, with the IP/subnet changed for my LAN. But it's presumably a bridge of some kind from the name - can I safely delete this if I don't need multiple RJ45 ports/VLAN interfaces to be bridged?

  • eth0 HWaddr 0E:D4:62:3D:58:DC UP RUNNING - is this an ASIC switch covering all 4 or 5 of the RJ45's? +CPU? Or what else?

  • eth0.1 HWaddr E8:FC:AF:FD:2B:BE UP RUNNING - Some VLAN created by the default setup, but representing what physical item? Is it safe to modify/delete?

  • eth1 HWaddr 26:14:8D:FD:DC:C1 No idea what this represents

  • eth2 HWaddr E8:FC:AF:FD:2B:BE No idea what this represents

  • wlan0 HWaddr E8:FC:AF:FD:2B:BE Presumably the HW IF for one of the 3 radios?

  • wlan1 HWaddr E8:FC:AF:FD:2B:BD Presumably the HW IF for one of the 3 radios?

  • wlan2 HWaddr E8:FC:AF:FD:2B:BC Presumably the HW IF for one of the 3 radios?

What exactly do these devices really signify, in terms of their actual hardware connections? That would be enough to figure out which I need, which I bridge, and which I need to connect via VLAN vs. via directly using the port?

Also, to what extent I will need to use VLANs to connect and manage the individual 3 radios and 5 RJ45 ports?

Thanks very much!


#2
brctl show
swconfig list
swconfig dev switch0 show

#3

Output:

# brctl show

bridge name   bridge id             STP enabled    interfaces
br-lan        7fff.e8fcaffd2bbe     no             eth0.1
                                                   wlan1

# swconfig list

Found: switch0 - bcm53011

# swconfig dev switch0 show

Global attributes:
    enable_vlan:              1
    ports:               0x01bf
    reset_mib:              ???
    enable_jumbo:             0
    allow_vid_4095:           0

Port 0:
    mib:
    TxOctets:           3153111
    TxDropPkts:               0
    TxBroadcastPkts:         47
    TxMulticastPkts:        156
    TxUnicastPkts:        20789
    TxCollisions:             0
    RxOctets:           8462181
    RxJumboPkts:              0
    RxSymbolErrors:           0
    RxDiscarded:              0
        pvid: 1
        link: port:0 link:up speed:1000baseT full-duplex auto

Port 1:
    mib:
    [All zero data]
        pvid: 1
        link: port:1 link:down

Port 2:
    mib:
    [All zero data]
        pvid: 1
        link: port:2 link:down

Port 3:
    mib:
    [All zero data]
        pvid: 1
        link: port:3 link:down
Port 4:
    mib:
    [All zero data]
        pvid: 1
        link: port:4 link:down

Port 5:
    mib:
    TxOctets:           8542637
    TxDropPkts:               0
    TxBroadcastPkts:         20
    TxMulticastPkts:          0
    TxUnicastPkts:        19950
    TxCollisions:             0
    TxSingleCollision:        0
    RxGoodOctets:       3240005
    RxSAChanges:            588
    RxFragments:              0
    RxJumboPkts:              0
    RxSymbolErrors:           0
    RxDiscarded:             12
        pvid: 0
        link: port:5 link:up speed:1000baseT full-duplex

Port 6:
    mib:                    ???
        pvid: 0
        link: port:6 link:down

Port 7:
    mib:
    [All zero data]
        pvid: 0
        link: port:7 link:down

Port 8:
    mib:
    [All zero data exc
    RxOctets:                64
    RxGoodOctets:            64
        pvid: 0
        link: port:8 link:up speed:1000baseT full-duplex auto

VLAN 1:
    ports:         0 1 2 3 4 5t

#4

Bridges and VLANs are configured at "/etc/config/network". You can have a look there and see how they work.


#5

Connect/disconnect network cable and check link status, so you will know which which interface corresponds to the port.


#6

That helps a bit. I get these results:

  • "sw.0 ports 0,1,2,3,4" correspond to the 5 RJ45 ports at the rear
  • "sw.0 ports 5,8" always up (even with "wifi down"). Port 5 has substantial traffic (CPU??), port 8 shows almost none (64 octets, sounds like it's accessed once, maybe a port for switch management or something??)
  • "sw.0 ports 6,7" always down.

But this doesn't yet help, because I only know how sw.0 port IDs are mapped to physical RJ45s, but my question is about the logical interfaces eth* and what they cover.

In other words, while I now know that sw0 port 0-4 are the five rear RJ45s and maybe sw.0 port 5 is the CPU, I don't yet know which of eth0, eth1 and eth2 are which RJ45 ports, whether I can safely delete br-lan and directly connect to eth0/1/2/0.1 or some other ethXX instead (if I only need one RJ45 link), and whether it's safe to delete VLAN eth0.1 or what it represents.


#7

Described in /etc/config/network and /etc/config/wireless

See, for example, https://openwrt.org/docs/guide-user/base-system/basic-networking

A basic understanding of VLAN usage, especially in the context of a VLAN-aware switch, is needed.


#8

By R8000, I assume you are referring to the Netgear R8000?

You may want to take a look at the /etc/config/network file. It might provide you with some clarity as to what OpenWrt is calling various things. Also, refer to OpenWrt's Basic Networking and VLANs page, they provide a lot of useful descriptions of how OpenWrt treats these concepts.

br-lan is your LAN. It is a virtual interface that bridges a couple of things. The first thing contained in the bridge is VLAN 1, which by default is the VLAN that contains the four physical LAN ports on the back of the router. In the /etc/config/network file, it is specified in the stanza:

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

As you can see, VLAN 1 by default contains physical LAN ports 0, 1, 2, and 3. Ignore 5t for the moment, I'll get to that later.

Incidentally, if you go into the LuCI interface, and go to the Network > Interfaces tab, you can see this shown graphically. Look at the entry for LAN. You can see what the logical interface name is (LAN). You can see what the physical interface name is (br-lan). And you can see what the bridge contains. I believe the first icon means that this entry is a virtual interface. Then there are parentheses, which signify that it is a bridge. And what is it bridging? There is an icon for VLAN 1, and then there are three radio icons, representing wlan0, wlan1, and wlan2.

eth0 is the physical interface name given to the CPU. Please read through the VLAN doc, I believe this question is answered there.

eth0.1 represents VLAN 1. As stated above, by default it contains the four LAN ports on the back of the router.

By the way, if you are referring to a Netgear R8000, then you are missing an interface. By default, an interface called eth0.2 should have gotten created, which represents VLAN 2, and it should have gotten tied to the physical WAN port on the back, which is port number 4. In /etc/config/network, if should show up as:

config switch_vlan     
        option device 'switch0'
        option vlan '2'      
        option ports '4 5t'

When you deleted the WAN and turned it into a 5th "ordinary" port, it will have removed this eth0.2 physical interface.

Refer to the VLAN doc, especially where it talks about using ls -l /sys/class/net.

Yes. Take a look at the /etc/config/wireless file and the Network > Wireless tab in LuCI.

As I stated above, VLAN 1 and 2 are created automatically by default to manage the 5 RJ45 ports. The 3 radios aren't managed by any of the VLANs by default, which is why the br-lan bridge is created, so that there is a way to manage the radios and 4 LAN ports as one grouping. If you look in the /etc/config/firewall config file, you will see references to the logical interface lan, which is the name that has been given to br-lan.

You can certainly break apart and/or rejigger these default associations as you see fit. For example, if you want to take one of the three radios and use that exclusively for a guest wi-fi network, you would remove it from lan, create a new logical interface called guest, and add the radio to this new logical interface.

One note about OpenWrt's notion of a VLAN. You don't need a VLAN to be tied to any of the physical hardware ports. If you look at the Network > Switch tab in LuCI, you will see the VLANs on the router. Notice that one of the columns is labeled CPU (eth0). See how both VLAN 1 and VLAN 2 have the CPU as being tagged? This is the 5t from the /etc/config/network stanzas that I showed earlier. You can create a very simple VLAN that isn't tied to any hardware port by only having the CPU be tagged, and all other ports being set to Off.

HTH.


#9

EthX refers to physical ports on the CPU SOC.

Look at the device page for Netgear Wndr3700 as an example.

https://openwrt.org/toh/netgear/wndr3700

If you dig up some technical details for the SOC used in the R8000 that will help.

I'm not familiar with the R8000 details but I have seen implementations where two ethX physical interfaces are connected to the switch.

So from reading the above posts eth0 is connected to the switch port 5 giving you access to the RJ45 ports.

I'm guessing eth1/2 is connected to switch port 8 and not currently utilised.

Also guessing eth2/1 is dedicated to WAN