IPTABLES Interview Questions & Answers

5 avg. rating (100% score) - 1 votes

IPTABLES Interview Questions & Answers

If you have knowledge and experience in Linux administration, then you can look for an Iptables job. An Iptables job will enable you to set up, maintain and check the tables of IP protocol filter rules which are provided by the Linux Kernel firewall. As a system administrator you will be able to manage the incoming and outgoing traffic by using a set of table rules. If you have good knowledge of Linux but you don’t know where to search for a job, then you can browse the wisdomjobs page to search for your desired job. Here we make your job easy, by providing you with the latest list of all the Iptables jobs, from which you can choose based on your skills, qualification and experience. We have also provided a set of Iptables job interview questions and answers, which will help you to crack your dream job confidently.

IPTABLES Interview Questions

IPTABLES Interview Questions
    1. Question 1. What Is Iptables ?

      Answer :

      iptables is a user space application program that allows a system administrator to configure the tables provided by the Linux kernel firewall (implemented as different Netfilter modules) and the chains and rules it stores. Different kernel modules and programs are currently used for different protocols; iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames.

    2. Question 2. What Is The Configuration File Of Iptables In Linux ?

      Answer :

      /etc/sysconfig/iptables

    3. Question 3. What Are Tables Used In Iptables ?

      Answer :

      • Nat Table
      • Mangle Table
      • Filter Table

    4. Question 4. How To Enable Iptables ?

      Answer :

      • # /etc/init.d/iptables start
      • # chkconfig iptables on
      • # iptables-save > /root/working.fw

    5. Question 5. How To Disable Iptables ?

      Answer :

      # service iptables save

      # service iptables stop

      # chkconfig iptables off

    6. Question 6. How Do I Save Iptables Rules Or Settings?

      Answer :

      Fedora Linux you can use following commands to save and restore firewall rules. To Save the rules to /etc/sysconfig/iptables file: # /etc/init.d/iptables save To restore the rules from /etc/sysconfig/iptables file: # /etc/init.d/iptables start If you are using Debian / Ubuntu Linux open /etc/network/interfaces: # vi /etc/network/interfaces Append the line to eth0 section: post-up iptables-restore Close and save the file. Reboot the system.

    7. Question 7. How To Restore Rules In Iptables ?

      Answer :

      #iptables-restore < /root/firewall.rules

      #iptables-save > /root/firewall.rules

    8. Question 8. How To List The Iptable Rules In Iptables ?

      Answer :

      # iptables --list

      #iptables -L

    9. Question 9. How To List The Nat Iptable Rules ?

      Answer :

      # iptables -t nat -L

      # iptables -t nat -L -n -v | grep 'some-word'

      # iptables -t nat -L -n -v

    10. Question 10. How To Delete Iptable Rules ?

      Answer :

      # iptables --flush

      # iptables --flush OUTPUT  //To delete particular CHAIN

    11. Question 11. Explain Filter Table In Iptables ?

      Answer :

      The filter table should be used exclusively for filtering packets. For example, we could DROP, LOG, ACCEPT or REJECT packets without problems, as we can in the other tables. There are three chains built in to this table. The first one is named FORWARD and is used on all non-locally generated packets that are not destined for our local host (the firewall, in other words). INPUT is used on all packets that are destined for our local host (the firewall) and OUTPUT is finally used for all locally generated packets.

    12. Question 12. Some Basic Rules Of Iptables ?

      Answer :

      Interface level:

      Allow incoming packets at interface level

      # iptables -A INPUT -i lo -j ACCEPT

      # iptables -A INPUT -i eth0 -j ACCEPT

      Accept packets from trusted IP addresses:

      iptables -A INPUT -s 192.168.0.4 -j ACCEPT # change the IP address as appropriate

      Accept packets from trusted IP addresses:

      #  iptables -A INPUT -s 192.168.0.0/24 -j ACCEPT   //using standard slash notation

      #  iptables -A INPUT -s 192.168.0.0/255.255.255.0 -j ACCEPT // using a subnet mask

      Accept tcp packets on destination port 6881 (bittorrent):

      # iptables -A INPUT -p tcp --dport 6881 -j ACCEPT

      # Accept tcp packets on destination ports 6881-6890

       #  iptables -A INPUT -p tcp --dport 6881:6890 -j ACCEPT

    13. Question 13. How To List All The Rules Applied On Your System And How To Flush All Iptables Rules ?

      Answer :

      To list the rules we have on our system use:

      # iptables -nL

      To flush (drop) all the rules we can use:

      # iptables –F

    14. Question 14. Rules For Ssh?

      Answer :

      Accept tcp packets on destination port 22 (SSH)

       # iptables -A INPUT -p tcp --dport 22 -j ACCEPT

      Accept tcp packets on destination port 22 (SSH) from private LAN

      # iptables -A INPUT -p tcp -s 192.168.0.0/24 --dport 22 -j ACCEPT

    15. Question 15. What Are The Target Values In Iptables?

      Answer :

      Following are the possible special values that we can specify in the target.

      ACCEPT :Firewall will accept the packet.

      DROP:Firewall will drop the packet.

      QUEUE : Firewall will pass the packet to the userspace.

      RETURN : Firewall will stop executing the next set of rules in the current chain for this packet. The control will be returned to the calling chain.

Popular Interview Questions

All Interview Questions

All Practice Tests

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Tutorial