0

I am using a Ubuntu Linux system. For my task I have to run some modules by executing the respective scripts. All the modules must run at the same time in the background but all have different interface names, IPV4 & IPV6 addresses configuration. So, basically I have to run different modules simultaneously having different IP configuration.
Here I am specifying all the NIC card interfaces address & its corresponding name in a persistent net rules file. Suppose I have one NIC card Mac address and want to assign two different interface names associated with the same Mac address. I know we can assign multiple virtual IP's to a particular interface by making alias of it.
But how can we assign different interface names to a particular Hardware MAC address?

For example:

Persistent-net-generator.rules rules file.
We can modify it, as long as you keep each rule on a single line, and change only the value of the NAME=key.

net device ()  
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:04:9f:02:81:97", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

net device ()  
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:04:9f:02:81:96", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

net device ()  
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:04:9f:02:81:95", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

How to get two interface names associated with Mac address 00:04:9f:02:81:97?
Any kind of help or suggestions will be appreciated.

Thanks.

  • Having two interfaces with the same mac address on the same network will cause networking to fail for those two interfaces. If they are on different networks, that is ok. Are they on the same network, is this what you want? – Kyle H Dec 22 '16 at 13:26
  • I want to assign two different interface Names on the same Mac address. For example: for a Mac address- 00:04:9f:02:81:97, I want to assign two interface names like eth0 & eth1 associated with that particular Mac address. Is it possible? – Kushal Dec 23 '16 at 5:10
  • Yes, it is. You can specify the same mac in both of the ifcfg files. Things heavily depend on what you are trying to do and how your network is set up if you want networking to work on those interfaces with the same mac addresses, though. – Kyle H Dec 23 '16 at 13:06

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.