FreeBSD mixes names of similar USB to ethernet adapters

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite
1












I have two Asix USB to ethernet adapters. The FreeBSD determines those as ue1 and ue2 adapters.



The problem is, that on reboot, sometimes the interface ue1 become ue2 and viceversa, which pretty much screws my network configuration.
The both adapters have the very similar MAC, and might be the issue when system tries to recognize it.



On the Linux systems, I previously sorted this out by setting static udev rules by adapters mac address.
How I can achieve the similar in Freebsd? I know it is related to devd but I'm not sure how to manage it, so the adapters get 'static' name.



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)


usbconfig -d ugen0.5 dump_device_desc
ugen0.5: <ASIX Elec. Corp. AX88179> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (248mA)

bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0210
bDeviceClass = 0x00ff <Vendor specific>
bDeviceSubClass = 0x00ff
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0040
idVendor = 0x0b95
idProduct = 0x1790
bcdDevice = 0x0100
iManufacturer = 0x0001 <ASIX Elec. Corp.>
iProduct = 0x0002 <AX88179>
iSerialNumber = 0x0003 <00000000000114>
bNumConfigurations = 0x0001

ugen0.4: <ASIX Elec. Corp. AX88179> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (248mA)

bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0210
bDeviceClass = 0x00ff <Vendor specific>
bDeviceSubClass = 0x00ff
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0040
idVendor = 0x0b95
idProduct = 0x1790
bcdDevice = 0x0100
iManufacturer = 0x0001 <ASIX Elec. Corp.>
iProduct = 0x0002 <AX88179>
iSerialNumber = 0x0003 <00000000000013>
bNumConfigurations = 0x0001






share|improve this question
















  • 1




    I don't know the answer to your question, but it isn't the similarity of the MAC addresses that causes the issue. It is the fact that are the same "kind" of device (ue) coupled with the fact that the USB probe isn't guaranteed to see the devices in the same order
    – Fox
    Jan 16 at 8:03










  • That was my blind guess. And yes, you are correct.
    – fugitive
    Jan 16 at 11:14














up vote
4
down vote

favorite
1












I have two Asix USB to ethernet adapters. The FreeBSD determines those as ue1 and ue2 adapters.



The problem is, that on reboot, sometimes the interface ue1 become ue2 and viceversa, which pretty much screws my network configuration.
The both adapters have the very similar MAC, and might be the issue when system tries to recognize it.



On the Linux systems, I previously sorted this out by setting static udev rules by adapters mac address.
How I can achieve the similar in Freebsd? I know it is related to devd but I'm not sure how to manage it, so the adapters get 'static' name.



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)


usbconfig -d ugen0.5 dump_device_desc
ugen0.5: <ASIX Elec. Corp. AX88179> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (248mA)

bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0210
bDeviceClass = 0x00ff <Vendor specific>
bDeviceSubClass = 0x00ff
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0040
idVendor = 0x0b95
idProduct = 0x1790
bcdDevice = 0x0100
iManufacturer = 0x0001 <ASIX Elec. Corp.>
iProduct = 0x0002 <AX88179>
iSerialNumber = 0x0003 <00000000000114>
bNumConfigurations = 0x0001

ugen0.4: <ASIX Elec. Corp. AX88179> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (248mA)

bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0210
bDeviceClass = 0x00ff <Vendor specific>
bDeviceSubClass = 0x00ff
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0040
idVendor = 0x0b95
idProduct = 0x1790
bcdDevice = 0x0100
iManufacturer = 0x0001 <ASIX Elec. Corp.>
iProduct = 0x0002 <AX88179>
iSerialNumber = 0x0003 <00000000000013>
bNumConfigurations = 0x0001






share|improve this question
















  • 1




    I don't know the answer to your question, but it isn't the similarity of the MAC addresses that causes the issue. It is the fact that are the same "kind" of device (ue) coupled with the fact that the USB probe isn't guaranteed to see the devices in the same order
    – Fox
    Jan 16 at 8:03










  • That was my blind guess. And yes, you are correct.
    – fugitive
    Jan 16 at 11:14












up vote
4
down vote

favorite
1









up vote
4
down vote

favorite
1






1





I have two Asix USB to ethernet adapters. The FreeBSD determines those as ue1 and ue2 adapters.



The problem is, that on reboot, sometimes the interface ue1 become ue2 and viceversa, which pretty much screws my network configuration.
The both adapters have the very similar MAC, and might be the issue when system tries to recognize it.



On the Linux systems, I previously sorted this out by setting static udev rules by adapters mac address.
How I can achieve the similar in Freebsd? I know it is related to devd but I'm not sure how to manage it, so the adapters get 'static' name.



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)


usbconfig -d ugen0.5 dump_device_desc
ugen0.5: <ASIX Elec. Corp. AX88179> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (248mA)

bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0210
bDeviceClass = 0x00ff <Vendor specific>
bDeviceSubClass = 0x00ff
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0040
idVendor = 0x0b95
idProduct = 0x1790
bcdDevice = 0x0100
iManufacturer = 0x0001 <ASIX Elec. Corp.>
iProduct = 0x0002 <AX88179>
iSerialNumber = 0x0003 <00000000000114>
bNumConfigurations = 0x0001

ugen0.4: <ASIX Elec. Corp. AX88179> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (248mA)

bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0210
bDeviceClass = 0x00ff <Vendor specific>
bDeviceSubClass = 0x00ff
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0040
idVendor = 0x0b95
idProduct = 0x1790
bcdDevice = 0x0100
iManufacturer = 0x0001 <ASIX Elec. Corp.>
iProduct = 0x0002 <AX88179>
iSerialNumber = 0x0003 <00000000000013>
bNumConfigurations = 0x0001






share|improve this question












I have two Asix USB to ethernet adapters. The FreeBSD determines those as ue1 and ue2 adapters.



The problem is, that on reboot, sometimes the interface ue1 become ue2 and viceversa, which pretty much screws my network configuration.
The both adapters have the very similar MAC, and might be the issue when system tries to recognize it.



On the Linux systems, I previously sorted this out by setting static udev rules by adapters mac address.
How I can achieve the similar in Freebsd? I know it is related to devd but I'm not sure how to manage it, so the adapters get 'static' name.



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)


usbconfig -d ugen0.5 dump_device_desc
ugen0.5: <ASIX Elec. Corp. AX88179> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (248mA)

bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0210
bDeviceClass = 0x00ff <Vendor specific>
bDeviceSubClass = 0x00ff
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0040
idVendor = 0x0b95
idProduct = 0x1790
bcdDevice = 0x0100
iManufacturer = 0x0001 <ASIX Elec. Corp.>
iProduct = 0x0002 <AX88179>
iSerialNumber = 0x0003 <00000000000114>
bNumConfigurations = 0x0001

ugen0.4: <ASIX Elec. Corp. AX88179> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (248mA)

bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0210
bDeviceClass = 0x00ff <Vendor specific>
bDeviceSubClass = 0x00ff
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0040
idVendor = 0x0b95
idProduct = 0x1790
bcdDevice = 0x0100
iManufacturer = 0x0001 <ASIX Elec. Corp.>
iProduct = 0x0002 <AX88179>
iSerialNumber = 0x0003 <00000000000013>
bNumConfigurations = 0x0001








share|improve this question











share|improve this question




share|improve this question










asked Jan 15 at 14:26









fugitive

710418




710418







  • 1




    I don't know the answer to your question, but it isn't the similarity of the MAC addresses that causes the issue. It is the fact that are the same "kind" of device (ue) coupled with the fact that the USB probe isn't guaranteed to see the devices in the same order
    – Fox
    Jan 16 at 8:03










  • That was my blind guess. And yes, you are correct.
    – fugitive
    Jan 16 at 11:14












  • 1




    I don't know the answer to your question, but it isn't the similarity of the MAC addresses that causes the issue. It is the fact that are the same "kind" of device (ue) coupled with the fact that the USB probe isn't guaranteed to see the devices in the same order
    – Fox
    Jan 16 at 8:03










  • That was my blind guess. And yes, you are correct.
    – fugitive
    Jan 16 at 11:14







1




1




I don't know the answer to your question, but it isn't the similarity of the MAC addresses that causes the issue. It is the fact that are the same "kind" of device (ue) coupled with the fact that the USB probe isn't guaranteed to see the devices in the same order
– Fox
Jan 16 at 8:03




I don't know the answer to your question, but it isn't the similarity of the MAC addresses that causes the issue. It is the fact that are the same "kind" of device (ue) coupled with the fact that the USB probe isn't guaranteed to see the devices in the same order
– Fox
Jan 16 at 8:03












That was my blind guess. And yes, you are correct.
– fugitive
Jan 16 at 11:14




That was my blind guess. And yes, you are correct.
– fugitive
Jan 16 at 11:14










1 Answer
1






active

oldest

votes

















up vote
0
down vote













The solution I suggest is call a script on attach that looks at the mac adress and renames the device.




attach 0
device-name "(ue)[0-9]+";
action "yourscript $device-name";
;


Untested:




#!/bin/sh

MAC=`ifconfig $1 | grep ether`

INBOUND_MAC="foo"
OUTBOUND_MAC="bla"

if [ "$MAC" == "$INBOUND_MAC" ]; then
ifconfig $1 name inbound
else
ifconfig $2 name outbound
fi





share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f417247%2ffreebsd-mixes-names-of-similar-usb-to-ethernet-adapters%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    The solution I suggest is call a script on attach that looks at the mac adress and renames the device.




    attach 0
    device-name "(ue)[0-9]+";
    action "yourscript $device-name";
    ;


    Untested:




    #!/bin/sh

    MAC=`ifconfig $1 | grep ether`

    INBOUND_MAC="foo"
    OUTBOUND_MAC="bla"

    if [ "$MAC" == "$INBOUND_MAC" ]; then
    ifconfig $1 name inbound
    else
    ifconfig $2 name outbound
    fi





    share|improve this answer
























      up vote
      0
      down vote













      The solution I suggest is call a script on attach that looks at the mac adress and renames the device.




      attach 0
      device-name "(ue)[0-9]+";
      action "yourscript $device-name";
      ;


      Untested:




      #!/bin/sh

      MAC=`ifconfig $1 | grep ether`

      INBOUND_MAC="foo"
      OUTBOUND_MAC="bla"

      if [ "$MAC" == "$INBOUND_MAC" ]; then
      ifconfig $1 name inbound
      else
      ifconfig $2 name outbound
      fi





      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        The solution I suggest is call a script on attach that looks at the mac adress and renames the device.




        attach 0
        device-name "(ue)[0-9]+";
        action "yourscript $device-name";
        ;


        Untested:




        #!/bin/sh

        MAC=`ifconfig $1 | grep ether`

        INBOUND_MAC="foo"
        OUTBOUND_MAC="bla"

        if [ "$MAC" == "$INBOUND_MAC" ]; then
        ifconfig $1 name inbound
        else
        ifconfig $2 name outbound
        fi





        share|improve this answer












        The solution I suggest is call a script on attach that looks at the mac adress and renames the device.




        attach 0
        device-name "(ue)[0-9]+";
        action "yourscript $device-name";
        ;


        Untested:




        #!/bin/sh

        MAC=`ifconfig $1 | grep ether`

        INBOUND_MAC="foo"
        OUTBOUND_MAC="bla"

        if [ "$MAC" == "$INBOUND_MAC" ]; then
        ifconfig $1 name inbound
        else
        ifconfig $2 name outbound
        fi






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 26 at 15:34









        arved

        827512




        827512






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f417247%2ffreebsd-mixes-names-of-similar-usb-to-ethernet-adapters%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)