I have the following topology: enter image description here

I have a laptop with a WiFi NIC and a docking station with an Ethernet NIC. Both network connections are connected to the same LAN. What I want to do is to use the Ethernet port as much as possible, and, when I decouple the laptop from the docking station, I want it to switch to the wireless NIC. I want all this without my services being affected/going down => I must have the same layer 3 address running all time and the WiFi NIC must always be connected to the wireless network, although no bandwidth is used.

I have thought of a solution (I'm using Linux):

  1. Disable DHCP on wlan0 and eth0.
  2. Add these interfaces in a bridge.
  3. Activate a DHCP client on the bridge interface.
  4. Make sure the bridge interface has the mac address of wlan0 so it can communicate properly on a secure WiFi network as well.

Some restrictions and concerns:

  1. Both physical networks are connected to a switch on ports which are set as vlan access port type. And I do not have any control over that switch.
  2. I do not know the DHCP protocol by heart. Do I risk wlan0 interpreting the DHCP response instead of the br0 interface?
  3. How do I prioritize br0 to use eth0 when it is active and consider wlan0 in a sort of a logical down status, without braking the wlan0 wifi connectivity?
  • Further research of DHCP protocol suggests that concern number 2 should not be a problem. DHCP uses UDP. So if no other DHCP userspace client is blocked on a recv() on that UDP port, there should be no problem with this, as only the DHCP client specific to br0 can interpret it. – Catalin Vasile Dec 3 '16 at 19:22

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.