LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 05-06-2011, 07:40 PM   #1
goncalopp
Member
 
Registered: Jun 2008
Posts: 47

Rep: Reputation: Disabled
got two interfaces with same mac


I'm testing some network setups, and bought two dirt-cheap USB network interfaces. My plan was to attach these two to an embedded device (sheevaplug) and mess with firewall setups.
However, the two interfaces are absolutely identical; they have the same MAC, and lsusb -v is the same for both, line by line (except for device number, which tells the order the devices are plugged in, I believe?). Also, this is a single usb bus (single port, with a hub).

Now, obviously I can't make much of a firewall setup if I can't tell the interfaces apart... I realize I probably hit a brick wall, but does anyone have thoughts on this?
 
Old 05-06-2011, 10:26 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Hello,

lsusb -v may give the same vendor and product IDs for the devices, but I highly doubt that the MAC addresses are the same. Could you confirm this by giving the output of ifconfig -a?

Cheers,

Josh
 
Old 05-07-2011, 09:06 AM   #3
goncalopp
Member
 
Registered: Jun 2008
Posts: 47

Original Poster
Rep: Reputation: Disabled
A MAC is supposed to be unique; i'm guessing they're burning the exact same image onto the interfaces rom to cut costs...

Code:
eth0      Link encap:Ethernet  HWaddr 00:50:43:01:6e:e1  
          inet addr:192.168.1.64  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::250:43ff:fe01:6ee1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:106934 errors:0 dropped:0 overruns:0 frame:0
          TX packets:142957 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:22965227 (21.9 MiB)  TX bytes:52075033 (49.6 MiB)
          Interrupt:11 

eth1      Link encap:Ethernet  HWaddr 00:60:6e:00:f1:7d  
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::260:6eff:fe00:f17d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4550563 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5286218 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2139297514 (1.9 GiB)  TX bytes:2150716186 (2.0 GiB)

eth2-eth1 Link encap:Ethernet  HWaddr 00:60:6e:00:f1:7d  
          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)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:10327 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10327 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1481301 (1.4 MiB)  TX bytes:1481301 (1.4 MiB)
Code:
[44481.858302] usb 1-1.4: reset high speed USB device using orion-ehci and address 5
[50322.477299] usb 1-1.3: new full speed USB device using orion-ehci and address 12
[50322.592536] usb 1-1.3: New USB device found, idVendor=0a46, idProduct=9601
[50322.599741] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[50322.607107] usb 1-1.3: Product: DM9601 USB NIC          
[50322.612576] usb 1-1.3: Manufacturer: DM9601 USB NIC  
[50322.617676] usb 1-1.3: SerialNumber: 9601
[50322.624174] usb 1-1.3: configuration #1 chosen from 1 choice
[50322.638516] eth2: register 'dm9601' at usb-orion-ehci.0-1.3, Davicom DM9601 USB Ethernet, 00:60:6e:00:f1:7d
[50323.415383] udev[25703]: renamed network interface eth2 to eth2-eth1
eth0 is "onboard"; I'm sucessfully using one usb interface at eth1. These are ifconfig -a and dmesg outputs just after I plug the second usb interface. udev even tries to assign the same name to them, and then renames the second to eth2-eth1.

The udev rule only appears once:
Code:
# Unknown net device (/devices/platform/mv643xx_eth_port.0/net/eth0) (mv643xx_eth_port)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:43:01:6e:e1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# USB device 0x:0x (dm9601)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:60:6e:00:f1:7d", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
The distro's Debian squeeze; got the same results on a laptop with ubuntu.
I know I can change a MAC address, but AFAIK that change is volatile?
 
Old 05-07-2011, 09:21 AM   #4
kaushalpatel1982
Member
 
Registered: Aug 2007
Location: INDIA
Distribution: CentOS, RHEL, Fedora, Debian, Ubuntu, LinuxMint, Kali Linux, Raspbian
Posts: 166

Rep: Reputation: 10
Did you copy eth1 config file and change IP Address ? If you did it then remove MAC address from eth2 file first and restart network services. If still problem persist then Change MAC address manually by ifconfig command.
 
Old 05-07-2011, 09:46 AM   #5
goncalopp
Member
 
Registered: Jun 2008
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Did you copy eth1 config file and change IP Address ?
Sorry, didn't quite catch that. By 'eth1' config file you mean /etc/network/interfaces? I have no mention of the usb interfaces there yet.

Or you meant udev rules? I have only one file, rules.d/70-persistent-net.rules, which I pasted here, and the rules were written by the system. Should I have a file for each interface? (I'm sorry, I don't have much knowledge about udev)

I could change the MAC by "ifconfig ethX hw ether Y:Y:Y:Y:Y:Y", but I wanted this change to persist across reboots/usb plugging. And since there's no reliable way to tell the devices apart without physical intervention, I can't see how one could automate that?

--EDIT--
Hm, maybe I could change the mac by identifying the network the interface is plugged on?... Like, put the interface up, do DHCP (or other test), and change the MAC according to the results?

That sounds really.. hacky, but it's worth a try if nothing else does the trick.

Last edited by goncalopp; 05-07-2011 at 09:52 AM.
 
  


Reply



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
[SOLVED] /etc/network/interfaces configuration for virtual interfaces nonshatter Linux - Networking 4 10-25-2010 06:22 AM
ifup: couldn't read interfaces file "/etc/network/interfaces" debian lenny lorimer73 Linux - Networking 1 08-24-2010 03:47 PM
Ethernet MAC Addresses database; MAC address-based processing cctualatin Linux - Newbie 1 04-14-2009 08:59 AM
How to find *hardware* mac addresses on bonded interfaces? TotalDefiance Linux - Software 3 06-06-2006 11:53 AM
mac osx problems with linux samba after switching network interfaces cruiserparts Linux - Networking 2 01-22-2006 07:41 PM

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

All times are GMT -5. The time now is 11:47 AM.

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
Open Source Consulting | Domain Registration