Jump to content



Photo

Spoof MAC to bond?

centos nic bonding mac

  • Please log in to reply
3 replies to this topic

#1 DannyCSC

DannyCSC

    Neowinian

  • Joined: 14-February 08
  • Location: Columbia, SC

Posted 26 September 2012 - 06:26

I am running a custom CentOS distro and I have bonded three of my four NIC's in mode zero. I have eth0 as management and bond0 as data traffic. Now the reason I can't use all 4 NICs is due to software that I use. It is licensed to the specific hardware MAC address on eth0. So my question is: Can I bond all 4 ports and "spoof" the hardware address of eth0 onto the bond to trick my software?
If this is hard to understand I apologize but it is 2:30 in the morning and I have been in this building since 9am. Thanks in advance!


#2 ichi

ichi

    Akihabara Style

  • Tech Issues Solved: 4
  • Joined: 20-December 04

Posted 26 September 2012 - 06:57

Bring the bond0 interface down and set any MAC address you want:

ifconfig bond0 ha ether 00:11:22:33:44:55

You might also want to change the MAC address of your eth0 interface so it isn't duplicated (not sure about this one, it might not matter if eth0 is part of the bonding interface), and you'll have to change all the MAC addresses again every time you reboot (you can automate that with the network config scripts).

#3 OP DannyCSC

DannyCSC

    Neowinian

  • Joined: 14-February 08
  • Location: Columbia, SC

Posted 26 September 2012 - 15:27

I will give a try, thanks!

#4 +Karl L.

Karl L.

    xorangekiller

  • Tech Issues Solved: 15
  • Joined: 24-January 09
  • Location: Virginia, USA
  • OS: Debian Testing

Posted 27 September 2012 - 15:39

I believe that what ichi said will work, use ifconfig to change bond0's MAC address to that of eth0 and change eth0's MAC address to something else. Once you verify that works, you definitely want to set it on boot, like ichi suggested.

You will need to modify your /etc/sysconfig/network-scripts/ifcfg-eth0 and /etc/sysconfig/network-scripts/ifcfg-bond0 to include these lines:
HWADDR="00:11:22:33:44:55"
ONBOOT="yes"

Although I don't have exactly the same configuration as you, my ifcfg-eth0 with a spoofed MAC address and static IP address on my CentOS 6 machine looks like this:
DEVICE="eth0"
HWADDR="00:25:52:E6:6E:00"
NM_CONTROLLED="no"
ONBOOT="yes"
IPADDR="192.168.1.2"
NETMASK="255.255.255.0"
NETWORK="192.168.1.0"
BROADCAST="192.168.1.255"
GATEWAY="192.168.1.1"