I would like to set up a firewall on Linux Debian for IPv6. It is important to use iptables for me. I have tried to change the ipv4 folder to ipv6.
How can I set up iptables for IPv6?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
In addition to the existing answer.
If you prefer (like I do) to use the syntax from the
ip6tables-restore can be used.
The convenient part is that you can share the same rule file for
ip6tables-restore respectively by prefixing all the version-specific lines with
-6 respectively and leaving it out on lines that apply to both IPv4 and IPv6.
In order to to check for the correct address family (
$ADDRFAM) in your script, use:
set -e case "$1" in start) case $ADDRFAM in inet) iptables-restore < /etc/myfwrules.txt ;; inet6) ip6tables-restore < /etc/myfwrules.txt ;; esac # ... ;; stop) # ... ;; esac exit 0