ip6tables: IPv6 Firewall For Linux

‮‬www.lautturi.com
ip6tables: IPv6 Firewall For Linux

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:

  • List the current rules in the filter table:
ip6tables -L
  • Allow incoming SSH connections:
ip6tables -A INPUT -p tcp --dport 22 -j ACCEPT
  • Block incoming ICMPv6 echo requests (ping):
ip6tables -A INPUT -p icmpv6 --icmpv6-type 128 -j DROP
  • Forward incoming HTTP traffic to a local web server:
ip6tables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination [::1]:8080
Created Time:2017-10-29 22:09:02  Author:lautturi