LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-20-2012, 12:10 PM   #1
totaluser
LQ Newbie
 
Registered: Nov 2011
Posts: 29

Rep: Reputation: Disabled
Multiple NICs with the same MAC address


hello everybody,
I bought a few pretty cheap USB to Ethernet adapters from HongKong

They look exactly like the picture in the article here (http://tech.firdooze.com/2011/11/16/...9601-on-linux/)

when plugged however, they don't register as AsiX like in the article
the problem is that all of them appear to have the same MAC address

dmesg | tail -n 20
Code:
[  628.298714] usb 1-1.3: new full speed USB device number 3 using ehci_hcd
[  628.461486] dm9601 1-1.3:1.0: eth5: register 'dm9601' at usb-0000:00:1a.0-1.3, Davicom DM9601 USB Ethernet, 00:e0:4c:53:44:58
[  628.461516] usbcore: registered new interface driver dm9601
[  628.543572] dm9601 1-1.3:1.0: eth5: link up, 100Mbps, full-duplex, lpa 0xFFFF
[  639.244058] eth5: no IPv6 routers present
[  654.906849] usb 1-1.6: new full speed USB device number 4 using ehci_hcd
[  655.018019] dm9601 1-1.6:1.0: eth6: register 'dm9601' at usb-0000:00:1a.0-1.6, Davicom DM9601 USB Ethernet, 00:e0:4c:53:44:58
[  655.119109] udevd[675]: renamed network interface eth6 to rename10
[  717.081829] usb 1-1.4: new full speed USB device number 5 using ehci_hcd
[  717.196783] dm9601 1-1.4:1.0: eth6: register 'dm9601' at usb-0000:00:1a.0-1.4, Davicom DM9601 USB Ethernet, 00:e0:4c:53:44:58
[  717.294212] udevd[676]: renamed network interface eth6 to rename11
[  745.996647] usb 1-1.5: new full speed USB device number 6 using ehci_hcd
[  746.107159] dm9601 1-1.5:1.0: eth6: register 'dm9601' at usb-0000:00:1a.0-1.5, Davicom DM9601 USB Ethernet, 00:e0:4c:53:44:58
[  746.189000] udevd[675]: renamed network interface eth6 to rename12

ifconfig -a (with other interfaces ommitted)
Code:
eth5      Link encap:Ethernet  HWaddr 00:e0:4c:53:44:58  
          inet6 addr: fe80::2e0:4cff:fe53:4458/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

rename10  Link encap:Ethernet  HWaddr 00:e0:4c:53:44:58  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

rename11  Link encap:Ethernet  HWaddr 00:e0:4c:53:44:58  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

rename12  Link encap:Ethernet  HWaddr 00:e0:4c:53:44:58  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

without -a switch in the ifconfig command only eth5 is shown and there is no trace of those rename interfaces


is is possible that it is the driver issue that it sees those adapters with some generic MAC address?

how can I get all 4 of them working and appear to have different MAC addresses?
 
Old 02-20-2012, 12:14 PM   #2
uhelp
Member
 
Registered: Nov 2011
Location: Germany, Bavaria, Nueremberg area
Distribution: openSUSE, Debian, LFS
Posts: 205

Rep: Reputation: 43
It is also possible that all these devices DO HAVE the same MAC adress.

Times, when MAC adresses were unique, are long gone...

Setting another MAC adress ca be done.
But depends on system/distri you are using.

Last edited by uhelp; 02-20-2012 at 12:15 PM.
 
Old 02-20-2012, 12:46 PM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Right. This isn't supposed to happen, but it certainly can and does.

As uhelp said, we need to know your Linux distro and version. You can set arbitrary MAC addresses using ifconfig(8), and you'll need to make some configuration changes for the settings to be "permanent" (i.e. surviving a reboot).
 
Old 02-20-2012, 02:03 PM   #4
totaluser
LQ Newbie
 
Registered: Nov 2011
Posts: 29

Original Poster
Rep: Reputation: Disabled
sorry that I forgot to mention that information
I am running Ubuntu 11.10 x64 with 3.0.16 kernel

could you please tell me how to assign some persistent MAC addresses to them?
thanks
 
Old 02-20-2012, 10:23 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 18,635

Rep: Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789
Boot to a live cd and see if this happens.

No, you can't easily get two or more nics with the same mac. That would be bad. There is no way you should have this.

What is looks like to me is you cloned some install and now it doesn't correctly view nics or some other deal that isn't right.
Maybe someone tried to rename them and messed up.
 
Old 02-21-2012, 06:00 AM   #6
totaluser
LQ Newbie
 
Registered: Nov 2011
Posts: 29

Original Poster
Rep: Reputation: Disabled
OK, so I booted Ubuntu 11.10 x64 LiveCD
uname -a
Code:
Linux ubuntu 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
dmesg | tail -n 20
Quote:
[ 1156.154454] usb 1-1.6: new full speed USB device number 3 using ehci_hcd
[ 1156.300364] dm9601 1-1.6:1.0: eth5: register 'dm9601' at usb-0000:00:1a.0-1.6, Davicom DM9601 USB Ethernet, 00:e0:4c:53:44:58
[ 1156.300448] usbcore: registered new interface driver dm9601
[ 1156.670538] dm9601 1-1.6:1.0: eth5: link up, 100Mbps, full-duplex, lpa 0xFFFF
[ 1166.875789] eth5: no IPv6 routers present
[ 1186.704092] usb 1-1.5: new full speed USB device number 4 using ehci_hcd
[ 1186.814252] dm9601 1-1.5:1.0: eth6: register 'dm9601' at usb-0000:00:1a.0-1.5, Davicom DM9601 USB Ethernet, 00:e0:4c:53:44:58
[ 1186.890991] dm9601 1-1.5:1.0: eth6: link up, 100Mbps, full-duplex, lpa 0xFFFF
[ 1197.297673] eth6: no IPv6 routers present
[ 1222.778642] usb 1-1.3: new full speed USB device number 5 using ehci_hcd
[ 1222.892353] dm9601 1-1.3:1.0: eth7: register 'dm9601' at usb-0000:00:1a.0-1.3, Davicom DM9601 USB Ethernet, 00:e0:4c:53:44:58
[ 1222.969414] dm9601 1-1.3:1.0: eth7: link up, 100Mbps, full-duplex, lpa 0xFFFF
[ 1229.686504] usb 1-1.4: new full speed USB device number 6 using ehci_hcd
[ 1229.800937] dm9601 1-1.4:1.0: eth8: register 'dm9601' at usb-0000:00:1a.0-1.4, Davicom DM9601 USB Ethernet, 00:e0:4c:53:44:58
[ 1229.876181] dm9601 1-1.4:1.0: eth8: link up, 100Mbps, full-duplex, lpa 0xFFFF
[ 1233.771934] eth7: no IPv6 routers present
ifconfig
Quote:
eth5 Link encap:Ethernet HWaddr 00:e0:4c:53:44:58
inet6 addr: fe80::2e0:4cff:fe53:4458/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

eth6 Link encap:Ethernet HWaddr 00:e0:4c:53:44:58
inet6 addr: fe80::2e0:4cff:fe53:4458/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:1 dropped:0 overruns:0 frame:1
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

eth7 Link encap:Ethernet HWaddr 00:e0:4c:53:44:58
inet6 addr: fe80::2e0:4cff:fe53:4458/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

eth8 Link encap:Ethernet HWaddr 00:e0:4c:53:44:58
inet6 addr: fe80::2e0:4cff:fe53:4458/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

so I guess that this is what it should look like

I will look into rules naming my ETH interfaces


//edit:
/etc/udev/rules.d/70-persistent-net.rules
contained only 1 entry for all those Davicom cards and was forcing it to have the name of ETH5.
this probably caused the interfaces to be renamed.

after deleting that entry and rebooting,
this was added to that file automatically

Code:
# USB device 0x0fe6:0x9700 (usb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:4c:53:44:58", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth7"

# USB device 0x0fe6:0x9700 (usb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:4c:53:44:58", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth8"

# USB device 0x0fe6:0x9700 (usb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:4c:53:44:58", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth6"

# USB device 0x0fe6:0x9700 (usb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:4c:53:44:58", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"
So now I see all 4 USB Ethernet interfaces just like in Ubuntu LiveCD (output posted above)


how can I persistently assign them different MAC addresses?
Thanks

Last edited by totaluser; 02-21-2012 at 06:14 AM.
 
Old 02-21-2012, 04:08 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 18,635

Rep: Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789
Talk about cheap indeed.

http://www.aboutlinux.info/2005/09/h...s-of-your.html shows how to use ifconfig. The problem now is that you may not be able to predict how the usb's attach in order.

Get rid of them and buy a real 4 port card from intel or other quality brand.
 
Old 02-21-2012, 05:25 PM   #8
totaluser
LQ Newbie
 
Registered: Nov 2011
Posts: 29

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jefro View Post
he problem now is that you may not be able to predict how the usb's attach in order.
I guess that some script that searches through dmesg could do that.
I agree that I can't tell which one is eth8 after reboot

what I can do however, is to parse through this output

[ 1156.300364] dm9601 1-1.6:1.0: eth5: register 'dm9601' at usb-0000:00:1a.0-1.6, Davicom DM9601 USB Ethernet, 00:e0:4c:53:44:58
[ 1186.814252] dm9601 1-1.5:1.0: eth6: register 'dm9601' at usb-0000:00:1a.0-1.5, Davicom DM9601 USB Ethernet, 00:e0:4c:53:44:58
[ 1222.892353] dm9601 1-1.3:1.0: eth7: register 'dm9601' at usb-0000:00:1a.0-1.3, Davicom DM9601 USB Ethernet, 00:e0:4c:53:44:58
[ 1229.800937] dm9601 1-1.4:1.0: eth8: register 'dm9601' at usb-0000:00:1a.0-1.4, Davicom DM9601 USB Ethernet, 00:e0:4c:53:44:58

and since I am not changing their point of attachement (USB port) I should be able to identify them by that 1.3 - 1.6 number
So I would know which adapter is which, then I can set their MAC addresses and then I could somehow trigger interface renumbering with 77-persistent-net.rules


does that sound possible?
I am gonna use them just for playing with my Cisco CAT3550 switches, for some serious traffic I have Dlink DFE580TX quad ethernet card
 
Old 02-21-2012, 08:37 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 18,635

Rep: Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789Reputation: 2789
You could try it. Just that usb sometimes is affected by odd things. There may be a way to grep some id off them. I get the feeling they are clones by some crooked company.
 
Old 07-28-2014, 03:05 PM   #10
louigi600
Member
 
Registered: Dec 2013
Location: Italy
Distribution: Slackware
Posts: 480
Blog Entries: 13

Rep: Reputation: 43
This will not help you have multiple of these devices on any one machine *as the rule would do the same to each device) but it can be used so that you could use multiple of these devices at the same time but on different computers.

In each computer you could edit the appropriate udev rule (distro dependent) to do something like this:
# USB device 0x0fe6:0x9700 (usb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:4c:53:44:58", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1", RUN="/sbin/ifconfig eth1 hw ether 00:e0:4c:53:44:59"

and on each computer you could have a different mac address assigned to the card
RUN="/sbin/ifconfig eth1 hw ether 00:e0:4c:53:44:60" ...
so that at least they can be used on different pc.

I'm looking for a way to permanently change the register that holds the mac address on the device ... but dumping the register shows "00:00:00:00:00:00" so I suspect that it may not be possible.
 
Old 07-28-2014, 03:14 PM   #11
totaluser
LQ Newbie
 
Registered: Nov 2011
Posts: 29

Original Poster
Rep: Reputation: Disabled
when dumping that register and it returns "00:00:00:00:00:00" try this

if I remember correctly, after plugging it in when Windows OS was running (for me Windows 7 x64, there should be support for Win7 and older maybe even default Win8 driver will work)
in control panel when selecting device manager and then that specific USB NIC look for a field "Network Address" or similar that let's you set custom MAC address
apply your new MAC address and close everything, reboot Windows and see if new MAC address persisted across reboot

now if I am not mistaken, that MAC address should be read by linux and dumping that register should return MAC address you set on Windows (for some time, never tested how long this will last)

I could be wrong of course but I think I remember this the way I described it

try and let me know if that worked
 
Old 07-28-2014, 03:58 PM   #12
louigi600
Member
 
Registered: Dec 2013
Location: Italy
Distribution: Slackware
Posts: 480
Blog Entries: 13

Rep: Reputation: 43
I don't run windows on any of my pc ... and I think that only instructs the system to change the mac address in software ... it's not e permanent change on the NIC itself (if you take it to another PC you are back to the original MAC).
I suspect that it does more or less what I suggested for linux ... that in any case is permanent across reboots on the pc where it's done.

One could actually choose to replace it with an exotic mac like this:
de:ad:be:ef or b1:6b:00:b5
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding MAC Address of NICs on IP330 myurick Linux - Hardware 1 04-15-2008 11:25 AM
Same MAC with Multiple IP address: Network slow debyani Linux - Server 2 08-04-2007 11:24 AM
Sharing one IP address with multiple NICs Astryk Linux - Software 4 06-02-2004 04:39 PM
multiple mac addresses per ip address dwater Linux - Networking 1 04-23-2004 03:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration