what is iptables

tags: learning networking linux

content

what is iptables?

  • man iptables: admin tools for IPv4/IPv6 packet filtering and NAT
  • it’s just a tool to configure rules for firewall
  • works on network layer and transport layer (filter by IP address and transport layer protocol TCP/UDP)
  • also has connection tracking (sequence number, port number) to allow
    • SNAT, DNAT
    • state matching of packets

example commands:

  • setting for a router to allow eth1 (internal) to access eth0 interface (external):
    • sudo iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT

up

firewall-and-iptables

down

iptables-chains

reference