10

Recently I am learning iptables, I know there are 5 independent tables, two of them are filter and nat tables. And I sometimes will look at netatat -r or route table, I know ip command can modify this routing table. I am a bit confused about these 2 kinds of tables:

  1. routing table
  2. nat and filter tables

They all can do something on packet traffic and looks they can do similar things, can someone tell me what are the differences? Thanks in advance.

4
  • 8
    iptables and ip have much the same relationship that cat and catepillar do - they start with the same first two letters. iptables is for managing the firewall. ip is for managing network interfaces, addresses, and routes Commented Sep 9, 2020 at 7:28
  • Consider also nftables as a replacement to iptables, ip6tables, arptables, etc. Commented Sep 9, 2020 at 9:28
  • 3
    superuser.com/questions/419659/iptables-vs-route Commented Dec 30, 2020 at 7:39
  • A routing table is mandatory for proper function of the IP network protocol; all the iptables functionality is optional. Commented Mar 12, 2024 at 17:47

1 Answer 1

1

Well, iptables is a tool, the ip route table is something used by the operating system to determine how to send network packets to its destination. With iptables on linux you can manage firewall rules e.g. redirect ports or block certain addresses. The ip route table (aka "routing table") is a kind of "maps" for your system to inform about paths to take to get somewhere. nat is something you can establish via the tool iptables, it can "translate" (the t in nat) network addresses into other addresses.

For example, if you have multiple systems in a network, you can use NAT to redirect all incoming traffic for the public port 80 (usually HTTP, or 4381 for HTTPS) to the system that should respond to your web requests. This could be any other port, and this redirection is done using Network Address Translation.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.