Jump to content

Connecting ethernet cable while connected over WIFI causes SSH over WIFI to disconnect


Go to solution Solved by Jonathan Till,

Recommended Posts

Posted

If I am using SSH over a WIFI connection and then plug in the ethernet cable, then I lose my SSH connection.

 

Simply disconnecting the cable doesn't resolve the issue; I need to reboot without the ethernet cable connected to reestablish the SSH over WIFI.

 

The system diagnosis is here.

Posted
7 hours ago, Jonathan Till said:

If I am using SSH over a WIFI connection and then plug in the ethernet cable, then I lose my SSH connection.


How is your network configured? Which tools do you use?

Posted

I've traced the problem back to a set-up that was working okay when I used the ASUS Debian O/S, but is now broken on Armbian.

 

My router is set up to assign 192.168.99.61 to the ethernet connection and 192.168.99.62 to the WIFI connection. The set-up that is now broken involved adding a virtual interface 40 seconds after each boot, to which the router assigns 192.168.99.64. The bash script setting up the virtual interface is as follows:

 

ip link add link eth0 address 22:05:19:61:00:00 eth0.1 type macvlan
ifconfig eth0.1 up
dhclient -v eth0.1

 

For testing purposes I disabled the bash script to set up the virtual interface. Then:

  • connected the ethernet cable while the board was running: SSH connections to both 192.168.99.61 and 192.168.99.62 worked fine ✔️
  • rebooted the board with the cable connected: again both connections worked fine ✔️

I then repeated the test with the bash script reenabled and a reboot:

  • connected the ethernet cable while the board was running: while the SSH connection over WIFI had been working, both SSH connections failed after connecting the cable 
  • rebooted: both SSH connections not working 

The network configuration with the virtual interface running, but before connecting the ethernet cable looks like this:

ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 0a:de:e9:d5:14:3c  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 74

eth0.1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 22:05:19:61:00:00  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0.1:avahi: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 169.254.2.252  netmask 255.255.0.0  broadcast 169.254.255.255
        ether 22:05:19:61:00:00  txqueuelen 1000  (Ethernet)

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 1134  bytes 94702 (94.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1134  bytes 94702 (94.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.99.62  netmask 255.255.255.0  broadcast 192.168.99.255
        inet6 fe80::b9e2:65fb:f79b:299b  prefixlen 64  scopeid 0x20<link>
        ether 20:4e:f6:c1:c3:a9  txqueuelen 1000  (Ethernet)
        RX packets 390291491  bytes 570483346160 (570.4 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 24460636  bytes 3287101270 (3.2 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

I'm not sure why the virtual interface is causing this to happen. Myabe something to do with the Armbian O/S or maybe I should be setting it up another way?

  • Solution
Posted

After further investigation I was able to solve the issue by delaying the script for 90 seconds, however worked out a better solution to modify the /etc/network/interfaces file adding:

 

up ip link add link eth0 address 22:05:19:61:00:00 eth0.1 type macvlan
up ip link set eth0.1 up
up dhclient eth0.1

 

Problem solved

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines