Skip to main content
link to new question
Source Link
Metamorphic
  • 103
  • 1
  • 1
  • 5

I had trouble GooglingSince this errorquestion is off-topic I moved it to Super User. But I was unable to delete it.

Here is the new location.

Here is the original question:


I'm trying to connect to a headless server via my laptop; they share a wired link via a Linksys wireless router ("Linksys EA6350") and TP-Link ethernet switch. I'm running Arch Linux on both machines, using a pretty default Systemd setup with dhcpcd for the network configuration.

After reading this question I thought to specify the interface manually (ssh -v -v -F /dev/null -B en0 myserver). This eliminates the error when it occurs, but it is not a permanent solution for me and it doesn't explain why the error suddenly appeared.

Here is some more information: (on laptop)

$ route                              
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         _gateway        0.0.0.0         UG    202    0        0 en0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 en0
$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    202    0        0 en0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 en0
$ ip route
default via 192.168.1.1 dev en0 proto dhcp src 192.168.1.124 metric 202 
192.168.1.0/24 dev en0 proto dhcp scope link src 192.168.1.124 metric 202 
$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:1f:16:25:32:96 brd ff:ff:ff:ff:ff:ff
3: wi0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:1e:65:6e:ee:02 brd ff:ff:ff:ff:ff:ff
$ ip -6 link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:1f:16:25:32:96 brd ff:ff:ff:ff:ff:ff
3: wi0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:1e:65:6e:ee:02 brd ff:ff:ff:ff:ff:ff
$ ip -6 route
fe80::/64 dev en0 proto kernel metric 256 pref medium

On myserver:

$ ip -6 link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 6c:0b:84:6a:2a:d7 brd ff:ff:ff:ff:ff:ff
$ ip -6 route
fe80::/64 dev en0 proto kernel metric 256 pref medium
$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         Linksys02473    0.0.0.0         UG    202    0        0 en0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 en0
$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 6c:0b:84:6a:2a:d7 brd ff:ff:ff:ff:ff:ff
$ ifconfig 
en0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.149  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::9cd8:b045:5974:c5cf  prefixlen 64  scopeid 0x20<link>
        ether 6c:0b:84:6a:2a:d7  txqueuelen 1000  (Ethernet)
        RX packets 362214214  bytes 471295240672 (438.9 GiB)
        RX errors 0  dropped 1647817  overruns 0  frame 0
        TX packets 247712687  bytes 135068734171 (125.7 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xf7c00000-f7c20000  

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 2171366  bytes 455452638 (434.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2171366  bytes 455452638 (434.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The server logs show that the DHCP client is doing something every couple of minutes:

Aug 14 15:57:44 myserver dhcpcd[4002]: en0: Router Advertisement from fe80::6238:e0ff:fe8d:92d2
Aug 14 15:57:44 myserver dhcpcd[4002]: en0: requesting DHCPv6 information
Aug 14 15:59:58 myserver dhcpcd[4002]: en0: Router Advertisement from fe80::6238:e0ff:fe8d:92d2
Aug 14 15:59:58 myserver dhcpcd[4002]: en0: requesting DHCPv6 information

However, I used a while loop in my shell to determine the time to the nearest second when ssh goes from working to not working, and vice-versa, and I was not able to correlate these events with anything in the output of journalctl, including the dhcpcd messages.

I had trouble Googling this error.

I'm trying to connect to a headless server via my laptop; they share a wired link via a Linksys wireless router ("Linksys EA6350") and TP-Link ethernet switch. I'm running Arch Linux on both machines, using a pretty default Systemd setup with dhcpcd for the network configuration.

After reading this question I thought to specify the interface manually (ssh -v -v -F /dev/null -B en0 myserver). This eliminates the error when it occurs, but it is not a permanent solution for me and it doesn't explain why the error suddenly appeared.

Here is some more information: (on laptop)

$ route                              
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         _gateway        0.0.0.0         UG    202    0        0 en0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 en0
$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    202    0        0 en0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 en0
$ ip route
default via 192.168.1.1 dev en0 proto dhcp src 192.168.1.124 metric 202 
192.168.1.0/24 dev en0 proto dhcp scope link src 192.168.1.124 metric 202 
$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:1f:16:25:32:96 brd ff:ff:ff:ff:ff:ff
3: wi0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:1e:65:6e:ee:02 brd ff:ff:ff:ff:ff:ff
$ ip -6 link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:1f:16:25:32:96 brd ff:ff:ff:ff:ff:ff
3: wi0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:1e:65:6e:ee:02 brd ff:ff:ff:ff:ff:ff
$ ip -6 route
fe80::/64 dev en0 proto kernel metric 256 pref medium

On myserver:

$ ip -6 link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 6c:0b:84:6a:2a:d7 brd ff:ff:ff:ff:ff:ff
$ ip -6 route
fe80::/64 dev en0 proto kernel metric 256 pref medium
$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         Linksys02473    0.0.0.0         UG    202    0        0 en0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 en0
$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 6c:0b:84:6a:2a:d7 brd ff:ff:ff:ff:ff:ff
$ ifconfig 
en0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.149  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::9cd8:b045:5974:c5cf  prefixlen 64  scopeid 0x20<link>
        ether 6c:0b:84:6a:2a:d7  txqueuelen 1000  (Ethernet)
        RX packets 362214214  bytes 471295240672 (438.9 GiB)
        RX errors 0  dropped 1647817  overruns 0  frame 0
        TX packets 247712687  bytes 135068734171 (125.7 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xf7c00000-f7c20000  

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 2171366  bytes 455452638 (434.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2171366  bytes 455452638 (434.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The server logs show that the DHCP client is doing something every couple of minutes:

Aug 14 15:57:44 myserver dhcpcd[4002]: en0: Router Advertisement from fe80::6238:e0ff:fe8d:92d2
Aug 14 15:57:44 myserver dhcpcd[4002]: en0: requesting DHCPv6 information
Aug 14 15:59:58 myserver dhcpcd[4002]: en0: Router Advertisement from fe80::6238:e0ff:fe8d:92d2
Aug 14 15:59:58 myserver dhcpcd[4002]: en0: requesting DHCPv6 information

However, I used a while loop in my shell to determine the time to the nearest second when ssh goes from working to not working, and vice-versa, and I was not able to correlate these events with anything in the output of journalctl, including the dhcpcd messages.

Since this question is off-topic I moved it to Super User. But I was unable to delete it.

Here is the new location.

Here is the original question:


I'm trying to connect to a headless server via my laptop; they share a wired link via a Linksys wireless router ("Linksys EA6350") and TP-Link ethernet switch. I'm running Arch Linux on both machines, using a pretty default Systemd setup with dhcpcd for the network configuration.

After reading this question I thought to specify the interface manually (ssh -v -v -F /dev/null -B en0 myserver). This eliminates the error when it occurs, but it is not a permanent solution for me and it doesn't explain why the error suddenly appeared.

add ip -6 outputs etc.
Source Link
Metamorphic
  • 103
  • 1
  • 1
  • 5

Here is some more information: (on laptop)

$ route                              
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         _gateway        0.0.0.0         UG    202    0        0 en0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 en0
$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    202    0        0 en0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 en0
$ ip route
default via 192.168.1.1 dev en0 proto dhcp src 192.168.1.124 metric 202 
192.168.1.0/24 dev en0 proto dhcp scope link src 192.168.1.124 metric 202 
$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:1f:16:25:32:96 brd ff:ff:ff:ff:ff:ff
3: wi0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:1e:65:6e:ee:02 brd ff:ff:ff:ff:ff:ff
$ ip -6 link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:1f:16:25:32:96 brd ff:ff:ff:ff:ff:ff
3: wi0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:1e:65:6e:ee:02 brd ff:ff:ff:ff:ff:ff
$ ip -6 route
fe80::/64 dev en0 proto kernel metric 256 pref medium

On myserver:

$ ip -6 link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 6c:0b:84:6a:2a:d7 brd ff:ff:ff:ff:ff:ff
$ ip -6 route
fe80::/64 dev en0 proto kernel metric 256 pref medium
$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         Linksys02473    0.0.0.0         UG    202    0        0 en0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 en0
$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 6c:0b:84:6a:2a:d7 brd ff:ff:ff:ff:ff:ff
$ ifconfig 
en0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.149  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::9cd8:b045:5974:c5cf  prefixlen 64  scopeid 0x20<link>
        ether 6c:0b:84:6a:2a:d7  txqueuelen 1000  (Ethernet)
        RX packets 362214214  bytes 471295240672 (438.9 GiB)
        RX errors 0  dropped 1647817  overruns 0  frame 0
        TX packets 247712687  bytes 135068734171 (125.7 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xf7c00000-f7c20000  

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 2171366  bytes 455452638 (434.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2171366  bytes 455452638 (434.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Here is some more information:

$ route                              
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         _gateway        0.0.0.0         UG    202    0        0 en0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 en0
$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    202    0        0 en0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 en0
$ ip route
default via 192.168.1.1 dev en0 proto dhcp src 192.168.1.124 metric 202 
192.168.1.0/24 dev en0 proto dhcp scope link src 192.168.1.124 metric 202 
$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:1f:16:25:32:96 brd ff:ff:ff:ff:ff:ff
3: wi0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:1e:65:6e:ee:02 brd ff:ff:ff:ff:ff:ff

Here is some more information: (on laptop)

$ route                              
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         _gateway        0.0.0.0         UG    202    0        0 en0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 en0
$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    202    0        0 en0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 en0
$ ip route
default via 192.168.1.1 dev en0 proto dhcp src 192.168.1.124 metric 202 
192.168.1.0/24 dev en0 proto dhcp scope link src 192.168.1.124 metric 202 
$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:1f:16:25:32:96 brd ff:ff:ff:ff:ff:ff
3: wi0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:1e:65:6e:ee:02 brd ff:ff:ff:ff:ff:ff
$ ip -6 link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:1f:16:25:32:96 brd ff:ff:ff:ff:ff:ff
3: wi0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:1e:65:6e:ee:02 brd ff:ff:ff:ff:ff:ff
$ ip -6 route
fe80::/64 dev en0 proto kernel metric 256 pref medium

On myserver:

$ ip -6 link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 6c:0b:84:6a:2a:d7 brd ff:ff:ff:ff:ff:ff
$ ip -6 route
fe80::/64 dev en0 proto kernel metric 256 pref medium
$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         Linksys02473    0.0.0.0         UG    202    0        0 en0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 en0
$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 6c:0b:84:6a:2a:d7 brd ff:ff:ff:ff:ff:ff
$ ifconfig 
en0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.149  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::9cd8:b045:5974:c5cf  prefixlen 64  scopeid 0x20<link>
        ether 6c:0b:84:6a:2a:d7  txqueuelen 1000  (Ethernet)
        RX packets 362214214  bytes 471295240672 (438.9 GiB)
        RX errors 0  dropped 1647817  overruns 0  frame 0
        TX packets 247712687  bytes 135068734171 (125.7 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xf7c00000-f7c20000  

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 2171366  bytes 455452638 (434.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2171366  bytes 455452638 (434.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Post Closed as "Not suitable for this site" by Ron Trunk, rnxrx, Teun Vink
Source Link
Metamorphic
  • 103
  • 1
  • 1
  • 5

"ssh: connect to host myserver port 22: Invalid argument" (intermittent, ipv6, link-local address, dhcp hostname)

I had trouble Googling this error.

I'm trying to connect to a headless server via my laptop; they share a wired link via a Linksys wireless router ("Linksys EA6350") and TP-Link ethernet switch. I'm running Arch Linux on both machines, using a pretty default Systemd setup with dhcpcd for the network configuration.

I recently experienced the following error when trying to ssh to the server:

$ ssh -v -v -F /dev/null myserver
OpenSSH_7.7p1, OpenSSL 1.1.0h  27 Mar 2018
debug1: Reading configuration data /dev/null
debug2: resolving "myserver" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to myserver [fe80::9cd8:b045:5974:c5cf] port 22.
debug1: connect to address fe80::9cd8:b045:5974:c5cf port 22: Invalid argument
ssh: connect to host myserver port 22: Invalid argument

Running the same with strace shows the error comes from connect:

connect(3, {sa_family=AF_INET6, sin6_port=htons(22), inet_pton(AF_INET6, "fe80::9cd8:b045:5974:c5cf", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, 28) = -1 EINVAL (Invalid argument)

Usually I have a local named forwarding DNS queries but the error persists when I go back to using the router's DNS server directly:

$ sudo cat /etc/resolv.conf
# Generated by resolvconf
nameserver 192.168.1.1

The error is intermittent: every few minutes I am able to connect successfully. When I can connect successfully, I see that connect is using an IPv4 address:

connect(3, {sa_family=AF_INET, sin_port=htons(22), sin_addr=inet_addr("192.168.1.149")}, 16) = 0

However, the host command shows the same IPv4 address whether the connection is working or broken:

$ host myserver                   
myserver has address 192.168.1.149

After reading this question I thought to specify the interface manually (ssh -v -v -F /dev/null -B en0 myserver). This eliminates the error when it occurs, but it is not a permanent solution for me and it doesn't explain why the error suddenly appeared.

Here is some more information:

$ route                              
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         _gateway        0.0.0.0         UG    202    0        0 en0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 en0
$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    202    0        0 en0
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 en0
$ ip route
default via 192.168.1.1 dev en0 proto dhcp src 192.168.1.124 metric 202 
192.168.1.0/24 dev en0 proto dhcp scope link src 192.168.1.124 metric 202 
$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:1f:16:25:32:96 brd ff:ff:ff:ff:ff:ff
3: wi0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:1e:65:6e:ee:02 brd ff:ff:ff:ff:ff:ff

The server logs show that the DHCP client is doing something every couple of minutes:

Aug 14 15:57:44 myserver dhcpcd[4002]: en0: Router Advertisement from fe80::6238:e0ff:fe8d:92d2
Aug 14 15:57:44 myserver dhcpcd[4002]: en0: requesting DHCPv6 information
Aug 14 15:59:58 myserver dhcpcd[4002]: en0: Router Advertisement from fe80::6238:e0ff:fe8d:92d2
Aug 14 15:59:58 myserver dhcpcd[4002]: en0: requesting DHCPv6 information

However, I used a while loop in my shell to determine the time to the nearest second when ssh goes from working to not working, and vice-versa, and I was not able to correlate these events with anything in the output of journalctl, including the dhcpcd messages.