issues - Raspberry PI 3 as a router with 4 additional USB network cards

Hi, I have problems there.

System: FreeBSD 12
Hardware: Raspberry PI 3
+ 4x USB Ethernet AX88179

I have the problem that with each reboot all UE USB network adapters are remixing and therefore are no longer useful. I can not always change the config for the entire network and rearrange all 5 networks.

Is there a possibility to define the MAC addresses or the serial number of the adapters on startup on a UE alias?

How do I do it that always have the same order as UE0 to UE4

Code:
usbconfig
ugen0.1: <DWCOTG OTG Root HUB> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.2: <vendor 0x0424 product 0x9514> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (2mA)
ugen0.3: <vendor 0x0424 product 0xec00> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (2mA)
ugen0.4: <ASIX Elec. Corp. AX88179> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (248mA)
ugen0.5: <ASIX Elec. Corp. AX88179> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (248mA)
ugen0.6: <ASIX Elec. Corp. AX88179> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (248mA)
ugen0.7: <ASIX Elec. Corp. AX88179> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (248mA)

before the reboot

Code:
ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80009<RXCSUM,VLAN_MTU,LINKSTATE>
        ether b8:27:eb:c1:ec:56
        inet 192.168.113.44 netmask 0xffffff00 broadcast 192.168.113.255
        inet6 fe80::ba27:ebff:fec1:ec56%ue0 prefixlen 64 scopeid 0x2
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ue1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE>
        ether 00:23:56:6c:37:88
        media: Ethernet autoselect (none)
        status: no carrier
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ue2: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE>
        ether 00:23:56:6c:25:88
        media: Ethernet autoselect (none)
        status: no carrier
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ue3: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE>
        ether 00:23:56:6c:31:44
        media: Ethernet autoselect (none)
        status: no carrier
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ue4: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE>
        ether 00:23:56:1c:67:58
        media: Ethernet autoselect (none)
        status: no carrier
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

after the restart

Code:
ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80009<RXCSUM,VLAN_MTU,LINKSTATE>
        ether b8:27:eb:c1:ec:56
        inet 192.168.113.44 netmask 0xffffff00 broadcast 192.168.113.255
        inet6 fe80::ba27:ebff:fec1:ec56%ue0 prefixlen 64 scopeid 0x2
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ue1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE>
        ether 00:23:56:6c:37:88
        media: Ethernet autoselect (none)
        status: no carrier
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ue2: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE>
        ether 00:23:56:1c:67:58
        media: Ethernet autoselect (none)
        status: no carrier
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ue3: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE>
        ether 00:23:56:6c:31:44
        media: Ethernet autoselect (none)
        status: no carrier
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ue4: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE>
        ether 00:23:56:6c:25:88
        media: Ethernet autoselect (none)
        status: no carrier
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
 
It works with a trick

rc.conf
Code:
ethname_enable="YES"
ethname_devices="ue0 ue1 ue2 ue3 ue4"
ethname_map="b8:27:eb:c1:ec:56 em0 00:23:56:6c:37:88 em1 00:23:56:6c:31:44 em2 00:23:56:6c:25:88 em3 00:23:56:1c:67:58 em4"

Now only ue0 works for ue1 ue2 ue3 ue4 we need a script

the Trick is run a Script on Boot
First, I need to include this script in the Cron:

nano /etc/crontab

And add the following to the end of the file:
Code:
@reboot root /script/myscript.sh

nano /script/myscript.sh
Code:
sh /usr/local/etc/rc.d/ethname restart
sh /etc/rc.d/netif restart
sh /etc/rc.d/routing restart

chmod 777 /script/myscript.sh

Reboot .... Now it Works ... Have a nice day
 
i have make a change on the ethname add on for faster boot

nano /usr/local/etc/rc.d/ethname

Code:
load_rc_config $name
: ${ethname_devices:=""}
: ${ethname_enable:=no}
: ${ethname_map:=""}
: ${ethname_timeout:="30"}

change time out from 30 to 5 s

Code:
load_rc_config $name
: ${ethname_devices:=""}
: ${ethname_enable:=no}
: ${ethname_map:=""}
: ${ethname_timeout:="5"}
 
It works with a trick

rc.conf
Code:
ethname_map="b8:27:eb:c1:ec:56 em0 00:23:56:6c:37:88 em1 00:23:56:6c:31:44 em2 00:23:56:6c:25:88 em3 00:23:56:1c:67:58 em4"
Why did you put em0, em1, em2, and em4 as interface name? It should be ue0...4. Is it a copy paste error?
 
I have a PC System as router withe Intel Ethernet PCIe Cards and i have copy the Configuration to the PI.
And Intel Ethernet PCIe Cards call in the system as em*
 
Back
Top