ip6tables
is a command-line utility for configuring the IPv6 firewall in Linux. It is used to set up, maintain, and inspect the tables of IPv6 packet filter rules in the Linux kernel.
ip6tables
operates on four different tables:
filter
: This is the default table and contains rules for filtering packets based on their IP addresses, protocols, and other characteristics.nat
: This table contains rules for Network Address Translation (NAT), which allows packets to be translated between different IPv6 address domains.mangle
: This table contains rules for modifying the headers of IPv6 packets.raw
: This table contains rules for configuring the raw packet filtering mechanism in the Linux kernel.Each table contains a number of chains, which are lists of rules for filtering packets. The most commonly used chains in the filter
table are INPUT
, OUTPUT
, and FORWARD
.
Here are some examples of how ip6tables
can be used:
filter
table:ip6tables -L
ip6tables -A INPUT -p tcp --dport 22 -j ACCEPT
ip6tables -A INPUT -p icmpv6 --icmpv6-type 128 -j DROP
ip6tables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination [::1]:8080