2

Lately I have been having to switch between a wifi and wired internet connection with some frequency, and have found that the only way I am capable of doing this is to restart the computer. Here are the two cases of how this works:

1) Start computer with wireless automatically connected. This makes it impossible to later switch to an ethernet connection, even with wifi turned off.

2) Start computer with wifi hardware disabled and ethernet plugged in. This allows an ethernet connection, but if I unplug it and enable wifi, I cannot get a connection.

How would I go about resolving this issue?

Here are the contents of my /etc/network/interfaces file

 # This file describes the network interfaces available on your system
 # and how to activate them. For more information, see interfaces(5).

 source /etc/network/interfaces.d/*

 # The loopback network interface
 auto lo
 iface lo inet loopback

 # The primary network interface
 allow-hotplug eth0
 iface eth0 inet dhcp

Edit: I have found a work-around script, but no solution so far.

 /etc/init.d/networking stop
 nano #this is where i unplug wire and enable wifi, or vice versa, then Ctrl-x
 /etc/init.d/networking start
  • Which flavour of Debian? What manages your network interfaces? – roaima Jan 19 '17 at 17:15
  • Its Debian Jessie (8.7), and I'm not sure if this is answering your question, but the /etc/network/interfaces file helps to manage them, I think. Here is its contents. <br> <br># This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet dhcp – Carl Shiles Jan 19 '17 at 17:46
  • Could you clarify what you're doing to try to switch them? Also, do you know if you're using NetworkManager or not? – derobert Jan 19 '17 at 17:50
  • @CarlShiles also, take a look at unix.stackexchange.com/help/formatting for how to format your question. Or use the buttons up above the text box. – derobert Jan 19 '17 at 17:52
  • derobert, I was simply going to Settings and then Network, but only wireless connections were listed. – Carl Shiles Jan 19 '17 at 20:27
3

Your problem lies in the fact that you're using two different things to manage your interfaces. NetworkManager (which is the usual default connection manager on Debian) does not manage any interfaces whose names are listed in /etc/network/interfaces by default.

Either comment out the lines about eth0 in /etc/network/interfaces and have NetworkManager handle both connections or (a bit more involved), move the management of your wireless connection to /etc/network/interfaces.

Your Answer

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

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