Community discussions

MikroTik App
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 337
Joined: Tue Dec 21, 2021 5:12 am

loopback interface in mikrotik

Wed Jul 06, 2022 1:13 pm

hello for all mikrotik people there..! i have two question in loopback topic.
the First one
is it a mandatory to create a loopback in mikrotik router..? so what if i dont want to do that..?
so what is the advantages and disadvantages..?
the second
in preconfigured router when i torch the Eth1 interface which is the out interface -(the internet came from this interface)- the distination was the ip address of the loopback interface.however, when i create loopback on my router and torch the Eth1 the distination was the ip address of my Eth1.
so please anyone can explain to me why this happen and what it mean, and who is the right my config or the other router config..?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: loopback interface in mikrotik

Wed Jul 06, 2022 2:40 pm

Please specify what you mean exactly for loopback interface, and what IP you "see" or "set" on that interface.
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 337
Joined: Tue Dec 21, 2021 5:12 am

Re: loopback interface in mikrotik

Wed Jul 06, 2022 4:08 pm

it is a bridge interface with zero member ports,The interface will always be active and thus will function as a regular loopback interface.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19102
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: loopback interface in mikrotik

Wed Jul 06, 2022 4:23 pm

What is the use case for such functionality. What does it allow users/devices to do or not to do?

By the way it reminds me of an existing default rule......
add action=accept chain=input comment=\
"defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1

Not sure of its purpose outside of capsman but rextended is capable of explaining it as I see no need for it.
 
sindy
Forum Guru
Forum Guru
Posts: 10205
Joined: Mon Dec 04, 2017 9:19 pm

Re: loopback interface in mikrotik

Wed Jul 06, 2022 4:29 pm

To the first question, I'd start from the fact that the popular name "loopback address" is technically wrong - it is a shortcut obfuscating the actual point.

The idea behind a "loopback address" is that this address is always active on the device. Addresses attached to a physical interfaces become inactive if the interface they are attached to goes down. So on bare Linux systems, long before bridges were implemented, people started attaching addresses they needed to stay active no matter what to a loopback interface, and from there the shortcut "loopback address" comes.

There is a "real" loopback interface on Mikrotik too, but it is not made visible in the RouterOS configuration. So when you want to configure an IP address that will not depend on a state of any physical interface, you have to create a bridge interface with no member ports and attach the address to it. So the "interface-state-independent" address exists, but it is not attached to a loopback interface as such.

It makes sense to use an "interface-state-independent" address in mesh topology networks with dynamic routing protocols, where you require path redundancy - if there is an outage on a link between nodes, the traffic gets routed via some other path instead. And you need that an outage of any link does not invalidate an IP address used by the dynamic routing protocols to talk to the router. If there are no alternative paths in your network, there is no point in using interface-state-independent addresses.

To the second question - the interface-state-independent address only exists in the L3 domain. So a neighbor router only knows how to send a packet to that address if it has a route to it. Even if the address fits into a subnet attached to some physical interface, Mikrotik will not respond ARP requests about that address even if they come through that physical interface.

What torch shows depends on the addresses in the packets, not on what address is attached to the interface. So the question is what traffic you were torching in the latter case and whether there were any NAT rules configured. I'd suppose there were NAT rules, so even packets sent from the interface-state-independent address got src-nated to the address attached to the WAN interface when routed out through that interface.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19102
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: loopback interface in mikrotik

Wed Jul 06, 2022 6:35 pm

Sweet explanation, I think I understood what you were saying but with my limited experience see no need for it in my lifetime.
What it didnt answer is what is the purpose of the capsman default rule, and is it just limited to capsman usage......seems more generic in nature.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: loopback interface in mikrotik

Wed Jul 06, 2022 7:16 pm

As I have already written to you other times, 127.0.0.1 means "itself", that is the loopback interface (localhost / 127.0.0.1/32)
always exists, is not deletable, and is used by the CPU for packets that are sent between internal services of the RouterBoard,
for example, The Dude, RADIUS, user-manager, CAPsMAN on a wireless interface on the routerboard itself, Wireguard.

Blocking 127.0.0.1 is bullshit, because it is an address that cannot be forwarded, cannot be received, and cannot be sent,
but it is needed to make the services work properly.

Probably on english can exist a better description, but for semplicity take this and hope that "someone" write a better "guide". :lol:
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 337
Joined: Tue Dec 21, 2021 5:12 am

Re: loopback interface in mikrotik

Wed Jul 06, 2022 9:03 pm

Mr sindy Mr anav im very grateful.. Thanks a lot for your time and response..
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19102
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: loopback interface in mikrotik

Wed Jul 06, 2022 10:47 pm

Thanks rextended maybe this time the valuable information will stick!!
however i have never used any loopback in any of my wireguard configs or useful article.
Please let me know where I can use it.
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 337
Joined: Tue Dec 21, 2021 5:12 am

Re: loopback interface in mikrotik

Wed Jul 06, 2022 11:40 pm

Mr rextended also very very thanksful for you, and for your time
My sincerly regards.
Really your info is so helpful.

Who is online

Users browsing this forum: Google [Bot], Kuitz, Michiganbroadband, mkx, xristostsilis and 82 guests