Bootstrap FreeKB - iptables - allow lo interface
iptables - allow lo interface

Updated:   |  iptables articles

The following command will allow traffic directed to the lo interface, which is the looback (or localhost) interface bound to IP address 127.0.0.1/8. The -i or --in-interface option is used to allow inbound connections on the lo interface.

iptables -I INPUT -i lo -j ACCEPT

 

The ip address or ifconfig commands can be used to confirm that 127.0.0.1/8 is bound to the lo interface. The ip address (or `ip addr` or `ip a`) command without any options will display information about the lo interface.

~]# ip address show so
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever

 

The -L or --list option can be used to display the rules to ensure the rule was added.

The iptables-save command will need to be used to permanently save iptables.




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter bd89b6 in the box below so that we can be sure you are a human.