Mailinglist Archive: opensuse (1108 mails)

< Previous Next >
Re: [opensuse] Re: What would be the proper command to swtich off wlan?
On 08/30/2018 04:32 PM, Carlos E. R. wrote:
Then I move the laptop to another room, and remove the cable. I do "ssh
cer@legolas" and now doesn't work, because machine now is only
192.168.1.10. Nameserver does not change, hosts file do not change at
all the machines. And no, I'm not going to type "ssh cer@legolas_e" or
"ssh cer@legolas_w"

Have you actually tried it?  It works fine for me.  My notebook computer
has an address of 172.16.0.40 on WiFi and 172.16.0.42 on Ethernet.

At the moment, it's connect via WiFi modem.  If I ping 172.16.0.40, I
get a response, but not if I ping 172.16.0.42.

Now, when I plug in the Ethernet cable, both addresses work.

I'll ssh to the WiFi address to see what the status is:

ip -4 route show
default via 172.16.0.1 dev eth0 proto dhcp metric 100
default via 172.16.0.1 dev wlan0 proto dhcp metric 600
172.16.0.0/24 dev eth0 proto kernel scope link src 172.16.0.42 metric 100
172.16.0.0/24 dev wlan0 proto kernel scope link src 172.16.0.40 metric 600

Now, I'll do the same with the Ethernet cable disconnected:
ip -4 route show
default via 172.16.0.1 dev wlan0 proto dhcp metric 600
172.16.0.0/24 dev wlan0 proto kernel scope link src 172.16.0.40 metric 600

Notice that the Ethernet connection is now gone, but my ssh connection
is still up.  So, I am able to connect to the WiFi address, regardless
of whether Ethernet is connected or not and connecting or disconnecting
Ethernet has absolutely no effect on the ssh connection.

As I said, you're trying to solve a problem that doesn't exist.  This
works, thanks to Linux doing proper routing, based on the metric.

Now, as I suggested earlier, why don't you give this a try and prove it
to yourself?

BTW, in your example, you were trying to connect to the Ethernet
address, which will fail when disconnected, as the interface drops and
the address is no longer reachable.  The WiFi address can be reached so
long as WiFi is up, regardless of what's happening with the Ethernet
connection.






--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups