Ubuntu 19.04 bonding ethernet and wireless interface

I know this is not a new question and it has been asked many times before. But, I could not find any documentation on how to do it on Ubuntu 19.04.

As any ordinary notebook computer I have a notebook with an Ethernet and a Wireless interface. I am using static local IP address on my Ethernet connection (because I am doing port forwarding from my router to my notebook). I want my notebook to have the same IP address whether it is connected to my LAN through Ethernet and/or Wireless. To do this (I think) I need to bond these two interfaces. In other words, regardless of how I connect my notebook computer to my LAN (i.e., using its wireless and/or Ethernet interface), the computer will use the same LAN IP address.

All the references I have found on the Internet are about older versions of Ubuntu. Newer versions of Ubuntu changed the way network configuration is done. So I tried to do this using Advanced Network Configuration tool (nm-connection-editor). However, after creating a new Bond virtual interface, the options to add "Bonded connections" in the Bond tab does not bring any Wi-Fi interface; only Ethernet, InfiniBand and other virtual connections are listed.

What am I doing wrong? Maybe I misunderstood the term. Maybe I am using it in the wrong way.


Note: Any other suggestions on how to use the same IP address on these two interfaces are welcome.

2 Answers

You are looking to use the Cloned MAC address feature on the Wifi interface. Set your DHCP reservation against your tethered MAC interface.

As for how you set these, it depends on how you manage your network connection. The GNOME Network Manager presents the field for you. Use the tethered MAC address in the Wifi Cloned MAC address field.

If you are using /etc/network/interfaces and config files, you can set the hw value there.

Example:

pre-up ifconfig <interface> hw ether xx:xx:xx:yy:yy:yy

1

What you want is a simple MAC address spoofing, meaning that instead of using the default and unique MAC address assigned to your card at the factory, you will want to broadcast a different number. When you reserve an ip address on your router, it reserves it based on the MAC address, so if they both appear to have the same address, your router will treat them as if they were the same card, and therefore will assign the same reserved ip.

You can do it either by changing the config files, or using the GUI. Since you want the simplest way, I'll cover the GUI.

Let's start by opening the GUI for the network manager. Open the terminal and run nm-connection-editor. An image with all the saved networks you have will open. Similar to the one below. Let's start by seeing the MAC address of both your wired card and your wifi card. You can check by selecting the network and clicking on the gear icon.

Network manager

The MAC address will be displayed on the Device Name box, either standalone or inside parenthesis, next to the device name. The image will be similar to the one below. The wifi one will be slightly different. Take note of the MAC address of both the WIFI card and the Ethernet card. You can also use ip addr command to get the MAC address.

enter image description here

If you noticed on the image above, there is a "Cloned MAC Address" box. This is the box you want to place the address you want your computer to give out every time it connects to this network.

If you want to spoof the WIFI mac to be the same as the ethernet one on this network, you simply copy the ethernet mac address, open the the wifi settings, and copy it on the "Cloned MAC Address" box, following the format XX:XX:XX:XX:XX:XX.

After saving, simply restart the network to make sure the router gets the new MAC. You can do this by using sudo systemctl restart NetworkManager.service. You can ensure that both interfaces are using the same MAC address with the command ip addr.

7

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like