Ubuntu – How to allow an IP (ipv6) address using ufw

firewalliptablesipv6ufw

I'm using Ubuntu 16.04 LTS, and I want to block all connections except some IP addresses. I ran these commands

ufw default allow outgoing
ufw default deny incoming
ufw allow ssh
ufw enable
ufw allow from 1.2.3.4

and it's working fine for me, But now i want to allow a ipv6 address and i'm using this command.

ufw allow from 2405:204:108e:650c:10cb:11ea:bb8f:3937

but it's not working

Best Answer

man ufw is the answer (at line 139), the manual mention this:

...
         ufw deny proto tcp from 2001:db8::/32 to any port 25

       This  will  deny all traffic from the IPv6 2001:db8::/32 to tcp port 25
       on this host. Note that IPv6 must be enabled  in  /etc/default/ufw  for
       IPv6 firewalling to work.
...

Since the OP not mentioning more detail about his difficulties, I hope this answer may help you to create IPV6 ufw rules