X86-64 with 6 lan ports switch config

Hi There,

I finally got my mini pc with 6 lan ports and would use it instead of my DIR 806B router

I installed OpenWrt 19.07.2 on it.

I would like the following diagram.

ISP <--> X86-64 <--> 24 port switch <--> (NAS, CAM, Doorbird, etc)
                <--> PC1
                <--> PC2
                <--> PC3
                <--> PC4

This is my /etc/config/network

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd80:cd6b:a5b3::/48'

config interface 'lan'
	option type 'bridge'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	Ioption ifname 'eth1 eth2 eth3 eth4 eth5'

config interface 'wan'
	option ifname 'eth0'
	option proto 'dhcp'

config interface 'wan6'
	option ifname 'eth0'
	option proto 'dhcpv6'

This is the output of ls -l /sys/class/net

root@OpenWrt:~# ls -l /sys/class/net
lrwxrwxrwx    1 root     root             0 May  7 19:32 br-eth2 -> ../../devices/virtual/net/br-eth2
lrwxrwxrwx    1 root     root             0 May  7 19:30 br-lan -> ../../devices/virtual/net/br-lan
lrwxrwxrwx    1 root     root             0 May  7 19:30 eth0 -> ../../devices/pci0000:00/0000:00:1c.0/0000:01:00.0/net/eth0
lrwxrwxrwx    1 root     root             0 May  7 19:30 eth1 -> ../../devices/pci0000:00/0000:00:1c.1/0000:02:00.0/net/eth1
lrwxrwxrwx    1 root     root             0 May  7 19:30 eth2 -> ../../devices/pci0000:00/0000:00:1c.2/0000:03:00.0/net/eth2
lrwxrwxrwx    1 root     root             0 May  7 19:30 eth3 -> ../../devices/pci0000:00/0000:00:1c.3/0000:04:00.0/net/eth3
lrwxrwxrwx    1 root     root             0 May  7 19:30 eth4 -> ../../devices/pci0000:00/0000:00:1c.4/0000:05:00.0/net/eth4
lrwxrwxrwx    1 root     root             0 May  7 19:30 eth5 -> ../../devices/pci0000:00/0000:00:1c.5/0000:06:00.0/net/eth5
lrwxrwxrwx    1 root     root             0 May  7 19:30 lo -> ../../devices/virtual/net/lo

This is dmesg outputting...

 6.490461] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
[    6.494827] random: crng init done
[    6.498701] e1000: Copyright (c) 1999-2006 Intel Corporation.
[    6.511572] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.4.0-k
[    6.520183] igb: Copyright (c) 2007-2014 Intel Corporation.
[    6.757087] pps pps0: new PPS source ptp0
[    6.763180] igb 0000:01:00.0: added PHC on eth0
[    6.769467] igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
[    6.778262] igb 0000:01:00.0: eth0: (PCIe:2.5Gb/s:Width x1) 00:e0:6c:68:11:87
[    6.787209] igb 0000:01:00.0: eth0: PBA No: 000300-000
[    6.793650] igb 0000:01:00.0: Using MSI-X interrupts. 4 rx queue(s), 4 tx queue(s)
[    7.030612] pps pps1: new PPS source ptp1
[    7.036501] igb 0000:02:00.0: added PHC on eth1
[    7.042814] igb 0000:02:00.0: Intel(R) Gigabit Ethernet Network Connection
[    7.052075] igb 0000:02:00.0: eth1: (PCIe:2.5Gb/s:Width x1) 00:e0:6c:68:11:88
[    7.061510] igb 0000:02:00.0: eth1: PBA No: 000300-000
[    7.067904] igb 0000:02:00.0: Using MSI-X interrupts. 4 rx queue(s), 4 tx queue(s)
[    7.307066] pps pps2: new PPS source ptp2
[    7.312985] igb 0000:03:00.0: added PHC on eth2
[    7.319274] igb 0000:03:00.0: Intel(R) Gigabit Ethernet Network Connection
[    7.328219] igb 0000:03:00.0: eth2: (PCIe:2.5Gb/s:Width x1) 00:e0:6c:68:11:89
[    7.337092] igb 0000:03:00.0: eth2: PBA No: 000300-000
[    7.343771] igb 0000:03:00.0: Using MSI-X interrupts. 4 rx queue(s), 4 tx queue(s)
[    7.582884] pps pps3: new PPS source ptp3
[    7.588688] igb 0000:04:00.0: added PHC on eth3
[    7.595459] igb 0000:04:00.0: Intel(R) Gigabit Ethernet Network Connection
[    7.604596] igb 0000:04:00.0: eth3: (PCIe:2.5Gb/s:Width x1) 00:e0:6c:68:11:8a
[    7.613660] igb 0000:04:00.0: eth3: PBA No: 000300-000
[    7.620446] igb 0000:04:00.0: Using MSI-X interrupts. 4 rx queue(s), 4 tx queue(s)
[    7.858833] pps pps4: new PPS source ptp4
[    7.864612] igb 0000:05:00.0: added PHC on eth4
[    7.870890] igb 0000:05:00.0: Intel(R) Gigabit Ethernet Network Connection
[    7.879481] igb 0000:05:00.0: eth4: (PCIe:2.5Gb/s:Width x1) 00:e0:6c:68:11:8b
[    7.888320] igb 0000:05:00.0: eth4: PBA No: 000300-000
[    7.895036] igb 0000:05:00.0: Using MSI-X interrupts. 4 rx queue(s), 4 tx queue(s)
[    8.132925] pps pps5: new PPS source ptp5
[    8.138691] igb 0000:06:00.0: added PHC on eth5
[    8.144901] igb 0000:06:00.0: Intel(R) Gigabit Ethernet Network Connection
[    8.153954] igb 0000:06:00.0: eth5: (PCIe:2.5Gb/s:Width x1) 00:e0:6c:68:11:8c
[    8.163051] igb 0000:06:00.0: eth5: PBA No: 000300-000
[    8.169694] igb 0000:06:00.0: Using MSI-X interrupts. 4 rx queue(s), 4 tx queue(s)
[    8.179252] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    8.186608] i2c /dev entries driver
[    8.193510] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[    8.200320] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    8.207552] ip_tables: (C) 2000-2006 Netfilter Core Team
[    8.214767] nf_conntrack version 0.5.0 (65536 buckets, 262144 max)
[    8.225437] xt_time: kernel timezone is -0000
[    8.231786] PPP generic driver version 2.4.2
[    8.237165] NET: Registered protocol family 24
[    8.242929] kmodloader: done loading kernel modules from /etc/modules.d/*
[    9.514874] 8021q: adding VLAN 0 to HW filter on device eth1
[    9.522080] br-lan: port 1(eth1) entered blocking state
[    9.528253] br-lan: port 1(eth1) entered disabled state
[    9.534456] device eth1 entered promiscuous mode
[    9.540174] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[    9.593297] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    9.600156] 8021q: adding VLAN 0 to HW filter on device eth0
[   12.350562] igb 0000:02:00.0 eth1: igb: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX
[   12.361336] br-lan: port 1(eth1) entered blocking state
[   12.367535] br-lan: port 1(eth1) entered forwarding state
[   12.374021] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   12.540567] igb 0000:01:00.0 eth0: igb: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
[   12.551771] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

The thing is I have no switch part in my config and was wondering how to configure this part.
If been reading this but the first thing you read is FixMe
I also found this

But I'm a little baffled, Is there a swith?
How do I enable the switch part in luci?

I changed

option ifname 'eth1'

to

option ifname 'eth1 eth2 eth3 eth4 eth5'

I have internet now on the other ports, but was this the correct way to do it?

Kind regards and keep safe,
Guy Forssman

If you want to create a bridge with the ports then that's the way to do it if the hardware doesn't have a built in switch. Another way is to connect one or more ports (possibly using bonding) to an external switch.

Thanks for this ultra fast reply...I have a limited nowledge of router/switches..

The main goal is that I get a following topology:

ISP <--> X86-64 <--> 24 port switch <--> (NAS, CAM, Doorbird, etc)
                <--> PC1
                <--> PC2
                <--> PC3
                <--> PC4

Which solution is preferred?

Thanks for reading

Switches are much faster for LAN-LAN traffic. So I'd encourage you to put the NAS and any machines that use the NAS onto the external switch together. Use the internal ethernet ports for low-bandwidth devices, or devices that need to be in a DMZ or things like that.

Using a hardware switch will allow LAN to LAN traffic to bypass the CPU entirely, thus in a large network with lots of file sharing etc it would be preferable.

Though the software bridges aren't going to burden an x86 much. It's not worth involving more hardware if you can just connect everything to the box you have.

Hi,

The first time I boot the device I just copied a saved config from my DIR-860 over.
I didn't work but I remember that I read somewhere that port 1 and 2 sometimes get's mixed.

When I switched cables 1 and 2 there where it worked I had internet. I adapted the /etc/config/network and I thought I was settled.

When I hooked up the PC2 and PC3 I noticed that even the lights on the ports didn't came on and indeed no Internet.

I then installed pciutils and did a lspci

root@OpenWrt:~# lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Iris Plus Graphics 650 (rev 06)
00:08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model
00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21)
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21)
00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI #1 (rev 21)
00:17.0 SATA controller: Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode] (rev 21)
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #1 (rev f1)
00:1c.1 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #2 (rev f1)
00:1c.2 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #3 (rev f1)
00:1c.3 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #4 (rev f1)
00:1c.4 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #5 (rev f1)
00:1c.5 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #6 (rev f1)
00:1f.0 ISA bridge: Intel Corporation Sunrise Point LPC Controller/eSPI Controller (rev 21)
00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21)
00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21)
01:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
02:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
03:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
04:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
05:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
06:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)

ls /proc/net/ gives

root@OpenWrt:~# ls /proc/net
anycast6             icmp6                ip6_tables_matches   ip_tables_targets    nf_conntrack_expect  rt6_stats            udp6
arp                  if_inet6             ip6_tables_names     ipv6_route           packet               snmp6                udplite
connector            igmp                 ip6_tables_targets   mcfilter             pppoe                sockstat6            udplite6
dev                  igmp6                ip_mr_cache          mcfilter6            psched               stat                 unix
dev_mcast            ip6_flowlabel        ip_mr_vif            netfilter            raw                  tcp                  wireless
dev_snmp6            ip6_mr_cache         ip_tables_matches    netlink              raw6                 tcp6
icmp                 ip6_mr_vif           ip_tables_names      nf_conntrack         route                udp

and then I can do a cat /proc/net/ but which to choose to get info if it is here at al?

The question is how can I see that I have a switch in this device?

When reading this howto:

Example: The following ALIX.2D13 has 3 real network interfaces: eth0, eth1 and eth2. Each leads to a single non-switched physical network jack. If needed, you have to use OS-software based VLAN configuration:

So I did the ls -l /sys/class/net and output was similar:

root@OpenWrt:~# ls -l /sys/class/net
lrwxrwxrwx    1 root     root             0 May  7 19:32 br-eth2 -> ../../devices/virtual/net/br-eth2
lrwxrwxrwx    1 root     root             0 May  7 19:30 br-lan -> ../../devices/virtual/net/br-lan
lrwxrwxrwx    1 root     root             0 May  7 19:30 eth0 -> ../../devices/pci0000:00/0000:00:1c.0/0000:01:00.0/net/eth0
lrwxrwxrwx    1 root     root             0 May  7 19:30 eth1 -> ../../devices/pci0000:00/0000:00:1c.1/0000:02:00.0/net/eth1
lrwxrwxrwx    1 root     root             0 May  7 19:30 eth2 -> ../../devices/pci0000:00/0000:00:1c.2/0000:03:00.0/net/eth2
lrwxrwxrwx    1 root     root             0 May  7 19:30 eth3 -> ../../devices/pci0000:00/0000:00:1c.3/0000:04:00.0/net/eth3
lrwxrwxrwx    1 root     root             0 May  7 19:30 eth4 -> ../../devices/pci0000:00/0000:00:1c.4/0000:05:00.0/net/eth4
lrwxrwxrwx    1 root     root             0 May  7 19:30 eth5 -> ../../devices/pci0000:00/0000:00:1c.5/0000:06:00.0/net/eth5
lrwxrwxrwx    1 root     root             0 May  7 19:30 lo -> ../../devices/virtual/net/lo

So I started to play with the switch section in /etc/config/network , soon only 1 port was lit.

In Luci I noticed that in "Network- Interfaces-LAN-Physical settings-Interface I could add eth1,eth2,eth3,eth4, and eth5. which I did and I had network.

So I stumbled upon a good solution?
Or can I improve and tax the cpu even less.

Kind regards,
Guy Forssman

There is no hardware switching there. Each port has its own independent chip and a dedicated path through the PCIe bus to the CPU. There is no way to forward packets from port to port without involving the CPU.

Adding switch configuration stanzas to /etc/config/network won't do anything, but it should not break anything either.

The command brctl show will show the member ports of the kernel software bridges.