githubEdit

iptables

iptables firewall configuration

Introduction

Description

# install

apt install iptables

# iptables

Kernel module ip_tables, view kernel info with modinfo ip_tables
User space tool that calls netfilter

# netfilter

Webhook points in kernel space

iptables tables

  • tables property

# raw

Kernel module iptable_raw
Determines packet state tracking mechanism handling

# mangle

Kernel module iptable_mangle
Modifies packet TOS, TTL, MARK tags to enable QOS adjustments and policy routing. Requires router device support

# nat

Kernel module iptable_nat
Modifies packet IP address, port, and other information. Packets belonging to the same flow are processed only once

# filter

Kernel module iptable_filter
Filters packets, decides whether to allow or block based on rules
  • Data packet connection state

  • tables chain

  • tables priority

iptables chains

  • chains property

  • chains priority

iptables rules

  • rules property

  • target and rule

Command

Common

Example

Reference:

Last updated