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?

up vote 4 down vote accepted

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. – Marko Kohtala Oct 25 '16 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 '16 at 18:12

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 192.168.0.10. So I can set manual addresses 192.168.1.[2-9] and DHCP addresses will start from 192.168.1.10. In such a situation you could try setting both your wired and wireless IP to 192.168.1.5.

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.

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