0

If I connect two usb wireless adaptors (via a usb hub), only one of them gets assigned an ip address.

I want each to be assigned a different ip address to be able to use both wireless adapters at the same time, each from a separate network namespace.

The two devices have the same mac address and I think this is the reason. When the two usb adapters are different models (which have different mac addresses), they both get different ip addesses assigned automatically.

output of 'ip a':

48: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether 0c:5b:8f:27:9a:64 brd ff:ff:ff:ff:ff:ff
    inet 192.168.8.100/24 brd 192.168.8.255 scope global dynamic noprefixroute eth1
       valid_lft 86384sec preferred_lft 86384sec
    inet6 fe80::640:311a:de17:1163/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
49: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 0c:5b:8f:27:9a:64 brd ff:ff:ff:ff:ff:ff

UPDATE:

I changed the MacAddressPolicy as suggested which successfully gives a random mac address to each of these devices, meaning that now when two of these devices are connected, they have different mac addresses. However, the ip address still only gets assigned to one of them:

59: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether fe:ef:a8:28:41:df brd ff:ff:ff:ff:ff:ff
    inet 192.168.8.100/24 brd 192.168.8.255 scope global dynamic noprefixroute eth1
       valid_lft 86393sec preferred_lft 86393sec
    inet6 fe80::640:311a:de17:1163/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
60: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether ca:9e:d4:c1:61:b9 brd ff:ff:ff:ff:ff:ff

Is there a way to get an ip address assigned to both? (I can't give it a static ip because the internet doesnt work if I do that.)

Is this happening because both devices are telling the OS that it's ip is 192.168.8.100 and they can't both use the same ip? Or could it have anything to do with the fact that the mac address was assigned on the OS but the devices still have the same mac address on their chips?

  • Two devices from the same manufacturer of the same model should still have different MAC addresses... out of curiosity, what is the vendor, model, etc? – ivanivan Jan 13 at 16:39
  • Can you add the output of ip addr list (stripped down to the relevant lines of the problematic devices) to your question? Are you using network-manager? – Hermann Jan 13 at 16:45
  • The make and model is Huawei E3372. I have just added the out put of that to the question. I think the mac address is "0c:5b:8f:27:9a:64" for both, is that correct? – Jonny Shanahan Jan 13 at 18:05
  • 1
    No, each device should have its own MAC address. To fix, you have to change the linkMACAddressPolicy setting for these devices. – fpmurphy Jan 13 at 18:17
  • Thanks. How does that work? I thought the mac address was written on the device chip. Would changing MacAddressPolicy result in spoofing the mac address? Also, would this be the same as doing 'ifconfig eth1 hw ether <NEW_MAC_ADDRESS>'? which I tried already but the ip still wasn't getting automatically created. – Jonny Shanahan Jan 13 at 18:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.