I have a laptop running Lubuntu 13.04. I use ssh -X to log into my server and start programs there that I view on my laptop. When I pull the ethernet cable, the laptop switches to WLAN but my ssh -X windows turn black. My IP changes due to the switch, and this disrupts the ssh connection.

My router is unable to give two different MACs the same IP.

So, is it possible to set a fix IP for both wlan0 and eth0?

2 Answers 2


It's impossible to have same IP address on two different interfaces on any network device (computer,router,...) in L3 operation mode (default operation mode of interfaces on computer is L3 mode, as router interfaces).

To have same IP, you must bridge your interfaces.

  • DHCP server could give same IP to both interfaces if it received Client ID, and client could then choose the better interface on which to present the IP. If interface changes, it can send Unsolicited ARP (a.k.a Gratuitous ARP) to inform ARP caches of the new MAC and switches would know the port where the new MAC is to be reached. Support and configuration required in different servers and clients is then something I'm not familiar with, yet. Oct 25, 2016 at 11:52
  • @kohtala : I think that simple DHCP Servers like those are implemented in Modem Routers does not support Client ID but some devices like Mikrotik routers support that.
    – SuB
    Dec 2, 2016 at 18:12
  • see also superuser.com/questions/1423894/…
    – Joe
    Nov 11, 2020 at 16:21

I'm not sure keeping the same IP will help but this might just work:

  1. Connect with cable and set your IP address manually.
  2. Pull the cable and set the the same IP address manually and also change the MAC address to your Ethernet MAC.
  3. Disable DHCP on the WiFi router (I assume that you connect to the same router via cable and wireless).

Setting the IP address can be done in the network manager if you're using a typical Gnome setup.

You don't necessarily have to disable DHCP, my router has options to give DHCP addresses e.g. only above So I can set manual addresses 192.168.1.[2-9] and DHCP addresses will start from In such a situation you could try setting both your wired and wireless IP to

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.