1

There are two command : route, and iptables. Both of it have a/many tables: route tables and iptables's table.

Does those two kind of tables describe the diffrent thing, or iptables can also be used to set the route' table ?

3

route command output gives you routing tables. In the simplest terms, routing tables tell the system how to handle IP packets which are going to a foreign IP address. Routing tables are especially useful, if the server has more than one network interface and connected to more than one network.

iptables command on the other hand does a totally different thing (sort of). It decides which incoming and (sometimes outgoing) packets will do so, depending on a set of rules (usually contained in /etc/sysconfig/iptables in current and well known linux distributons). I said sometimes outgoing because, this is a capability of iptables, but it is not used as often as blocking incoming packets. iptables, for the lack of a better term, is a server based firewall implementation. For instance, lets say you have a server that contains financial information and 3 subnets, lets say for the simplicity, one for finance people, one for HR People and last one for the techies. HR and techies, have no business, logging into finance server. You can configure iptables in a such a way that, any connection request coming from HR or techie subnets gets dropped/disconnected, while the requests coming from finance subnet gets connected. This is just one scenario. iptables are capable of filtering traffic in many, many more ways than this but all iptable functionality is not the subject matter suited for this site. If you are interested, there are myriad of documents available on the interwebs.

  • I would add that another common task of iptables is doing NAT to your internal network, and it has many more advanced functionalities including having an ideia of the active connections, tracking traffic statistics, QoS, and redirecting traffic. As @MelBurlan said, this is not the place to delve into those functionalities. – Rui F Ribeiro Mar 10 '16 at 7:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.