Permanent MAC Address with Bonding in Ubuntu

Problem: When you have located device with bonding to network, sometimes the device is not seen by router or switch devices due to a changeable MAC address.

Solution: You can assign a permanent MAC address to your network device with bonding. The Below configuration works out the problem. For instance, you have eth0 and eth1 interfaces and you want to create bonding between two interfaces.

auto eth0
iface eth0 inet manual
bond-master bond0
bond-primary eth0

auto eth1
iface eth1 inet manual
bond-master bond0

auto bond0
iface bond0 inet static
hwaddress ether xx:xx:xx:xx:xx:xx
address x.x.x.x
netmask x.x.x.x
gateway x.x.x.x
bond-mode active-backup
bond-miimon 100
bond-slaves none

If your network device is not visible on your network, then your route table may be corrupted. Use the following command for solving the problem:

route add default gw x.x.x.x