Ip tables by route command and iptables’s table by iptables command, is the same

iptablesnetworkingroute

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 ?

Best Answer

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.

Related Question