1

I have a Ubuntu Linux 16.04.1 server. 10 minutes after startup SSH over IPV6 stops working and I can no longer connect to SSH using my IPV6 address. IPV4 works fine all the time.

Would anyone have any suggestions? I am banging my head off the desk nearly.. Happy to provide any logs if needed...

If I reboot the server, IPV6 works fine again for 10 minutes.

Output of /etc/ssh/sshd_config:

    # Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 7000
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

Output of ip6tables -L -v -n

Chain INPUT (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
 1209  138K LOCALINPUT  all      !lo    *       ::/0                 ::/0                
    3   147 ACCEPT     all      lo     *       ::/0                 ::/0                
    0     0 INVALID    tcp      !lo    *       ::/0                 ::/0                
    6   576 ACCEPT     all      !lo    *       ::/0                 ::/0                 state RELATED,ESTABLISHED
    0     0 ACCEPT     tcp      !lo    *       ::/0                 ::/0                 state NEW tcp dpt:25
    0     0 ACCEPT     tcp      !lo    *       ::/0                 ::/0                 state NEW tcp dpt:7000
    0     0 ACCEPT     tcp      !lo    *       ::/0                 ::/0                 state NEW tcp dpt:8080
    0     0 ACCEPT     udp      !lo    *       ::/0                 ::/0                 state NEW udp dpt:25
    0     0 ACCEPT     udp      !lo    *       ::/0                 ::/0                 state NEW udp dpt:7000
    0     0 ACCEPT     udp      !lo    *       ::/0                 ::/0                 state NEW udp dpt:8080
    4   280 ACCEPT     icmpv6    !lo    *       ::/0                 ::/0                
    0     0 LOGDROPIN  all      !lo    *       ::/0                 ::/0                

Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
  888  132K LOCALOUTPUT  all      *      !lo     ::/0                 ::/0                
    0     0 ACCEPT     tcp      *      !lo     ::/0                 ::/0                 tcp dpt:53
    0     0 ACCEPT     udp      *      !lo     ::/0                 ::/0                 udp dpt:53
    0     0 ACCEPT     tcp      *      !lo     ::/0                 ::/0                 tcp spt:53
    0     0 ACCEPT     udp      *      !lo     ::/0                 ::/0                 udp spt:53
    3   147 ACCEPT     all      *      lo      ::/0                 ::/0                
    0     0 INVALID    tcp      *      !lo     ::/0                 ::/0                
    0     0 ACCEPT     all      *      !lo     ::/0                 ::/0                 state RELATED,ESTABLISHED
    0     0 ACCEPT     tcp      *      !lo     ::/0                 ::/0                 state NEW tcp dpts:1:65535
    6   576 ACCEPT     udp      *      !lo     ::/0                 ::/0                 state NEW udp dpts:1:65535
    4   264 ACCEPT     icmpv6    *      !lo     ::/0                 ::/0                
    0     0 LOGDROPOUT  all      *      !lo     ::/0                 ::/0                

Chain ALLOWIN (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all      !lo    *       X  ::/0                
    0     0 ACCEPT     all      !lo    *       X  ::/0                
    0     0 ACCEPT     all      !lo    *       X  ::/0                
    0     0 ACCEPT     all      !lo    *       X  ::/0                
    0     0 ACCEPT     all      !lo    *       X  ::/0                
    0     0 ACCEPT     all      !lo    *       X  ::/0                
    0     0 ACCEPT     all      !lo    *       X  ::/0                
    0     0 ACCEPT     all      !lo    *       X  ::/0                
    0     0 ACCEPT     all      !lo    *       X  ::/0                
 1199  137K ACCEPT     all      !lo    *       X  ::/0                

Chain ALLOWOUT (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all      *      !lo     ::/0                 X 
    0     0 ACCEPT     all      *      !lo     ::/0                 X 
    0     0 ACCEPT     all      *      !lo     ::/0                 X 
    0     0 ACCEPT     all      *      !lo     ::/0                 X 
    0     0 ACCEPT     all      *      !lo     ::/0                 X 
    0     0 ACCEPT     all      *      !lo     ::/0                 X 
    0     0 ACCEPT     all      *      !lo     ::/0                 X 
    0     0 ACCEPT     all      *      !lo     ::/0                 X 
    0     0 ACCEPT     all      *      !lo     ::/0                 X 
  878  131K ACCEPT     all      *      !lo     ::/0                 X 

Chain DENYIN (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain DENYOUT (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain INVALID (2 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 INVDROP    all      *      *       ::/0                 ::/0                 state INVALID
    0     0 INVDROP    tcp      *      *       ::/0                 ::/0                 tcp flags:0x3F/0x00
    0     0 INVDROP    tcp      *      *       ::/0                 ::/0                 tcp flags:0x3F/0x3F
    0     0 INVDROP    tcp      *      *       ::/0                 ::/0                 tcp flags:0x03/0x03
    0     0 INVDROP    tcp      *      *       ::/0                 ::/0                 tcp flags:0x06/0x06
    0     0 INVDROP    tcp      *      *       ::/0                 ::/0                 tcp flags:0x05/0x05
    0     0 INVDROP    tcp      *      *       ::/0                 ::/0                 tcp flags:0x11/0x01
    0     0 INVDROP    tcp      *      *       ::/0                 ::/0                 tcp flags:0x18/0x08
    0     0 INVDROP    tcp      *      *       ::/0                 ::/0                 tcp flags:0x30/0x20
    0     0 INVDROP    tcp      *      *       ::/0                 ::/0                 tcp flags:!0x17/0x02 state NEW

Chain INVDROP (10 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 DROP       all      *      *       ::/0                 ::/0                

Chain LOCALINPUT (1 references)
 pkts bytes target     prot opt in     out     source               destination         
 1209  138K ALLOWIN    all      !lo    *       ::/0                 ::/0                
   10   856 DENYIN     all      !lo    *       ::/0                 ::/0                

Chain LOCALOUTPUT (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  888  132K ALLOWOUT   all      *      !lo     ::/0                 ::/0                
   10   840 DENYOUT    all      *      !lo     ::/0                 ::/0                

Chain LOGDROPIN (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 DROP       tcp      *      *       ::/0                 ::/0                 tcp dpt:67
    0     0 DROP       udp      *      *       ::/0                 ::/0                 udp dpt:67
    0     0 DROP       tcp      *      *       ::/0                 ::/0                 tcp dpt:68
    0     0 DROP       udp      *      *       ::/0                 ::/0                 udp dpt:68
    0     0 DROP       tcp      *      *       ::/0                 ::/0                 tcp dpt:111
    0     0 DROP       udp      *      *       ::/0                 ::/0                 udp dpt:111
    0     0 DROP       tcp      *      *       ::/0                 ::/0                 tcp dpt:113
    0     0 DROP       udp      *      *       ::/0                 ::/0                 udp dpt:113
    0     0 DROP       tcp      *      *       ::/0                 ::/0                 tcp dpts:135:139
    0     0 DROP       udp      *      *       ::/0                 ::/0                 udp dpts:135:139
    0     0 DROP       tcp      *      *       ::/0                 ::/0                 tcp dpt:445
    0     0 DROP       udp      *      *       ::/0                 ::/0                 udp dpt:445
    0     0 DROP       tcp      *      *       ::/0                 ::/0                 tcp dpt:500
    0     0 DROP       udp      *      *       ::/0                 ::/0                 udp dpt:500
    0     0 DROP       tcp      *      *       ::/0                 ::/0                 tcp dpt:513
    0     0 DROP       udp      *      *       ::/0                 ::/0                 udp dpt:513
    0     0 DROP       tcp      *      *       ::/0                 ::/0                 tcp dpt:520
    0     0 DROP       udp      *      *       ::/0                 ::/0                 udp dpt:520
    0     0 LOG        tcp      *      *       ::/0                 ::/0                 limit: avg 30/min burst 5 LOG flags 0 level 4 prefix "Firewall: *TCP6IN Blocked* "
    0     0 LOG        udp      *      *       ::/0                 ::/0                 limit: avg 30/min burst 5 LOG flags 0 level 4 prefix "Firewall: *UDP6IN Blocked* "
    0     0 LOG        icmpv6    *      *       ::/0                 ::/0                 limit: avg 30/min burst 5 LOG flags 0 level 4 prefix "Firewall: *ICMP6IN Blocked* "
    0     0 DROP       all      *      *       ::/0                 ::/0                

Chain LOGDROPOUT (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 LOG        tcp      *      *       ::/0                 ::/0                 tcp flags:0x17/0x02 limit: avg 30/min burst 5 LOG flags 8 level 4 prefix "Firewall: *TCP6OUT Blocked* "
    0     0 LOG        udp      *      *       ::/0                 ::/0                 limit: avg 30/min burst 5 LOG flags 8 level 4 prefix "Firewall: *UDP6OUT Blocked* "
    0     0 LOG        icmpv6    *      *       ::/0                 ::/0                 limit: avg 30/min burst 5 LOG flags 8 level 4 prefix "Firewall: *ICMP6OUT Blocked* "
    0     0 REJECT     all      *      *       ::/0                 ::/0                 reject-with icmp6-port-unreachable
7
  • Is there a firewall between you and the system? Can that system still connect out over IPv6?
    – Zoredache
    Dec 5, 2017 at 16:32
  • Can you describe what happens? Does the ssh session time out? Can you edit and show us: /etc/ssh/sshd_config ; ip6tables -L -v -n ; and also login to the box you're connecting to locally and let us know if sshd is running when you can't connect. Also, just out of curiosity, why IPV6?
    – kilrainebc
    Dec 5, 2017 at 16:37
  • @Zoredache there is a firewall, but ip's are whitelisted, along with ports. It was also disabled just to be sure.
    – navrag
    Dec 5, 2017 at 16:42
  • @kilrainebc I have added the files you requested to the original post. I can confirm sshd is running when I cannot connect. It also works over IPV4 when I cannot connect over IPV6. We've decided to setup IPV6 on some servers as we have many spare addresses, and IPV4 is costly from our provider.
    – navrag
    Dec 5, 2017 at 16:54
  • @DaraG I think you missed the second part of my comment. Are you able to PING the IPv6 address of server after it gets into the 'broken' state? Are you able to ping the IPv6 gateway from the server? Is the host in your ipv6 neighbor cache after that point? Have you looked at the IPv6 route table on the system to check to see if it is using the router you expect? Perhaps you have a rouge RA?
    – Zoredache
    Dec 5, 2017 at 18:30

1 Answer 1

0

Turns out it was an issue with a router at my providers end. Apparently it was kicking the subnet off.. All working now! woo..

Thanks for the help!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .