Random Mac adress on red0

Dear All,

I use an 4G USB modem as red0 interface. This is a Alcatel IK40 (also named L850V from lsusb). It works fine, just configuring the red0 interface as DHCP and everythings is ok.

Only problem, is at each reboot, the modem assign a new MAC adress so IPfire fails to detect it at startup.when connecting to the modem (192.168.1.1) the modem embled website don’t offer any option to disable this. also no ssh allowed.

Do I have any option to detect red0 with else than MAC adress? ex: USB device id ?

Cheers,
A

You have to manually edit /var/ipfire/ethernet/settings

if your device is detected as usb0 change
RED_DEV=red0 to RED_DEV=usb0
after this it should work.

6 Likes

thanks, it worked fine until the core 191 (or 190) update. Now, despite putting RED_DEV=usb0, it does not work.

any idea ?

Replace this?

I mean… it’s a 11 old year tech, supports CAT4 LTE and nowadays 5G is available on 100 euro routers…
FRrom 70 EUR a 4g+ CAT6 router with ethernet is available, so triple win (external antennas, ethernet connection, 4G capabilities upgrade) with some losses (reasonable price to spend, bigger size of the installation, one more device and bigger power consumption).

The only compelling value for this TCL adapter is the Qualcomm chipset.

assuming this… the change of the string survive a reboot?

does it show up here:
ip link show

or here:
lsblk

because usb0 is not a valid mount point anymore for a modem and should be ttyXXX mount point, problem is this name changes with vendors as it could be ttyUsb0 ttyAM0.

run this script so we can see what usb devices are connected where and what sys path they are mounted on:


#!/bin/bash

for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do
    (
        syspath="${sysdevpath%/dev}"
        devname="$(udevadm info -q name -p $syspath)"
        [[ "$devname" == "bus/"* ]] && exit
        eval "$(udevadm info -q property --export -p $syspath)"
        [[ -z "$ID_SERIAL" ]] && exit
        echo "/dev/$devname - $ID_SERIAL"
    )
done

Kernel 6.12 has changed the internal handling of ethernet devices with random mac addresses. The device should now called ethX depending how much ethernet devices your system has.

2 Likes

that is a different subject, however, we need to cover that in a different thread. Because the ip command ip show eth1 says not found, but is listed in the zone configuration along with the hardware mac address it has (and not altered). yes the system would start as eth1, but at the end of the boot its active system mount point is green0p1.

The above script displays what are usb devices connected and their current operational system mount point and text description.

The usb device starts at the mass storage mount points (like usb0) then if the firmware request mode change, then the mount goes to the firmware preferred mount (ttyAM0 for like a phone), otherwise if the entry is missing in firmware, then it defaults to a system mount of the mode type (ttyUSB0)

I would have to look, but the random mac is the wireless interfaces only. Or supposed to be. And the 4G modem would fall into this category of usb modem.

It is not. The kernel was internal changed so my advice to put usb0 instead of red0 now not work simply because the device is now called the device ethX instead of usb0. I run into the same issue…

On older kernels such modems get usb0 as network device name on kernel 6.12 it is ethX now.

That you cannot add such devices to bridges is a different problem but RED can never be a bridge.

2 Likes

I plugged in my Motorola phone on tether, yes it looks like they changed usbcore (again) but it is odd the way the mapping is resulting in Ipfire’s zone list. Because its mapping it to the last available interface tag, and the sys mount was moved for the other interfaces at boot (to redd0, green0, etc) it maps in the system as eth0, but in the zone list, ipfire mapped it as eth7.

dmseg:

[365757.781500] usbcore: registered new interface driver cdc_ether
[365757.786723] rndis_host 1-10:1.0 eth0: register 'rndis_host' at usb-0000:00:14.0-10, RNDIS device, 2a:26:7d:71:bc:9f

displaying ethernet system mounts:

[root@pwrtower /]# ll /sys/class/net
total 0
lrwxrwxrwx 1 root root 0 Feb 24 02:20 blue0 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:11.0/0000:06:00.0/net/blue0
lrwxrwxrwx 1 root root 0 Feb 28 07:56 eth0 -> ../../devices/pci0000:00/0000:00:14.0/usb1/1-10/1-10:1.0/net/eth0
lrwxrwxrwx 1 root root 0 Feb 24 02:20 green0 -> ../../devices/virtual/net/green0
lrwxrwxrwx 1 root root 0 Feb 24 02:20 green0p0 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:09.0/0000:04:00.0/net/green0p0
lrwxrwxrwx 1 root root 0 Feb 24 02:20 green0p1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:09.0/0000:04:00.1/net/green0p1
lrwxrwxrwx 1 root root 0 Feb 24 02:20 green0p2 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:10.0/0000:05:00.0/net/green0p2
lrwxrwxrwx 1 root root 0 Feb 24 02:20 green0p3 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:10.0/0000:05:00.1/net/green0p3
lrwxrwxrwx 1 root root 0 Feb 24 02:20 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx 1 root root 0 Feb 24 02:20 orange0 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:11.0/0000:06:00.1/net/orange0
lrwxrwxrwx 1 root root 0 Feb 24 02:20 red0 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:08.0/0000:03:00.0/net/red0

zone configuration:

Adding things to red can be done, but since I don’t do that, I would have to ask one of my techs at the isp I have part ownership with how that is done. But I will call them and have a talk with them about it when they get into work today.

EDIT:
Just got off the phone with one of the techs.

He told me the reson why I would be seeing this the way it is is because ipfire is displaying the virtual mounts derived from iproute2, and what I see in /sys/class/net is the system hardware mounts.

He also told me that it is possible to run a bridge, but the isp would have to provide them a static ip addresses to do that or register the mac address of the interfaces to the isp so the isp system would assign more than one ip into the cable modem. He said that most will only handle 1 ip to a customer by dhcp, but it would have to be configured differently at their end to hand out more than one ip by dhcp to a customer. The only use case would be forwarding for hosting on a 2nd ip with a different ip. Otherwise it would be just an added ip address to the interface since its communicating on the same networking media if both ip addresses are from the same isp.

In this application of a router/firewall, the only logical method to use more than one WAN with different isp would be a fallback. Looking at what he told me to do, I don’t see the directory, so I dug to see where the system pointer ‘network_devices’ is pointing to:

network_devices=/etc/sysconfig/network-devices

# End /etc/sysconfig/rc

so it looks like you have to create network-devices directory, then go into that, and set up bonds but the device profile is somewhere else, and you would have to find that.

but you would do be something like the two files,ifcfg-eth0 and ifcfg-red0 :

ifcfg-eth0 file:


DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond0
SLAVE=yes

ifcfg-red0 file:

DEVICE=red0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond0
SLAVE=yes 

Then add the modprobe file to auto mount the bond:

nano /etc/modprobe.d/bonding.conf

alias bond0 bonding
options bond0 mode=1 miimon=100 

then activate it and test it:

modprobe bonding 

/etc/init.d/network restart