Firewall query

I'm modifying an iptables script but there are a few bits I'm not certain about.

These two variables are defined

LO_IFACE="lo" 
LO_IP="127.0.0.1"

So the loopback address is 127.0.0.1… but I don't understand the LO_IFACE="lo" bit

Here is an example of where these are referred to in a rule

iptables -A INPUT -p ALL -i $LO_IFACE -s $LO_IP -j ACCEPT

So instead of defining these variables you could put 127.0.0.1 for LOIP, but what would you put for LOIFACE?

Does this even make any sense??

1 Reply

lo (lowercase LO) is the "network interface" used for loopback.

In easy terms, think of it as of a virtual network card, that's connected to the loopback only.

Just like eth0, eth1, eth2 are Ethernet cards, ppp0…pppX are PPP interfaces, and so on.

And, you'd put "lo" instead of $LO_IFACE, obviously.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct