How to allow IPv6 address ssh access through ufw firewall

Firewall for remote machine is configured for SSH restricted access. This works well with IPv4 address.
Now the remote machine has IPv6 address. Configured the machine for IPv6 address.

  1. Added lines /etc/network/interfaces
  2. Added AAAA record
  3. Checked with ping6 2001:4860:4860::8888 - I get “64 bytes from 2001:4860:4860::8888: icmp_seq=1 ttl=57 time=3.16 ms”
  4. UFW /etc/default/ufw - have “IPV6=yes”
  5. remote machine have been rebooted for IPv6 configuration
  6. UFW disabled/enabled for IPv6 configuration

Firewall on remote machine:

Putty access thru port 22 for IP - 2405:204:7449:49fc:f09a:6f4a:bc93:1955

Also I doing a tunnellig ufw lines [5] and [10]

sudo ufw allow proto ipv6 to
sudo ufw allow to port 22

First command allows ipv6 wrapped stuff to come in on the ipv4 address so the tunnel can see it
The second command allows ipv6 to ssh.


Do I have to set up my putty for IPv6 address?
My putty uses IPv4 address of remote machine. But my machine IP is in IPv6 format.
So how to allow access for machine.

My putty gives “Network Error: Connection timed out” pop up error.

Yes, you need to open both IPv4 and IPv6 SSH ports using ufw:

 sudo ufw open ssh 

That is all. Now you can connect using putty IPv4 or IPv6 by inputting IP address as follows (you must put IPv6 in brackets):