please add the predefined/built-in "localhost" in Services -> IP addresses #5733

Closed
opened 2025-12-29 19:32:00 +01:00 by adam · 4 comments
Owner

Originally created by @ghost on GitHub (Dec 6, 2021).

NetBox version

v3.0.11

Feature type

New functionality

Proposed functionality

the list of IP addresses should contain "localhost" and perhaps even "localhost (IPv4 only)"

Use case

Sometimes a service is accesible on localhost - I want to add this information in NetBox

Database changes

No response

External dependencies

No response

Originally created by @ghost on GitHub (Dec 6, 2021). ### NetBox version v3.0.11 ### Feature type New functionality ### Proposed functionality the list of IP addresses should contain "localhost" and perhaps even "localhost (IPv4 only)" ### Use case Sometimes a service is accesible on localhost - I want to add this information in NetBox ### Database changes _No response_ ### External dependencies _No response_
adam added the type: feature label 2025-12-29 19:32:00 +01:00
adam closed this issue 2025-12-29 19:32:00 +01:00
Author
Owner

@DanSheps commented on GitHub (Dec 6, 2021):

There is a proper method to do this already. On your device or VM add the appropriate loopback interface (yes, localhost is a loopback interface) and then add an IP address.

@DanSheps commented on GitHub (Dec 6, 2021): There is a proper method to do this already. On your device or VM add the appropriate loopback interface (yes, localhost is a loopback interface) and then add an IP address.
Author
Owner

@ghost commented on GitHub (Dec 6, 2021):

sorry, but this proper method is crap: it inflates the interfaces list with these loopback entries.

@ghost commented on GitHub (Dec 6, 2021): sorry, but this proper method is crap: it inflates the interfaces list with these loopback entries.
Author
Owner

@ghost commented on GitHub (Dec 6, 2021):

and AFAIK it is not possible to hide these loopback entries from interface list :-(
unfortunately it is not possible to mark interface as loopback. Only an address can have role: loopback.
IMHO usually you call an interface loopback, not address.

@ghost commented on GitHub (Dec 6, 2021): and AFAIK it is not possible to hide these loopback entries from interface list :-( unfortunately it is not possible to mark interface as loopback. Only an address can have role: loopback. IMHO usually you call an *interface* loopback, not address.
Author
Owner

@DanSheps commented on GitHub (Dec 7, 2021):

sorry, but this proper method is crap: it inflates the interfaces list with these loopback entries.

NetBox models real world, almost every OS has a interface for loopback addresses. Those loopback entries exist in real-life too.
As far as inflating the interface list, I don't know too many people that use a unfiltered interface list and loopback interfaces are virtual so you can at least filter on Physical interfaces. However, I am rarely in the interface list as part of my daily work, I am mainly in a device view interface list.

Example of a loopback interface on Windows:

ifIndex InterfaceAlias                  AddressFamily NlMtu(Bytes) InterfaceMetric Dhcp     ConnectionState PolicyStore
------- --------------                  ------------- ------------ --------------- ----     --------------- -----------
1       Loopback Pseudo-Interface 1     IPv6            4294967295              75 Disabled Connected       ActiveStore
ifIndex IPAddress                                       PrefixLength PrefixOrigin SuffixOrigin AddressState PolicyStore
------- ---------                                       ------------ ------------ ------------ ------------ -----------
1       ::1                                                      128 WellKnown    WellKnown    Preferred    ActiveStore
1       127.0.0.1                                                  8 WellKnown    WellKnown    Preferred    ActiveStore

On the windows example, you can even add non-loopback addresses to the loopback interface. This is going to be the same on Linux as well.

and AFAIK it is not possible to hide these loopback entries from interface list :-(
unfortunately it is not possible to mark interface as loopback. Only an address can have role: loopback.
IMHO usually you call an interface loopback, not address.

Yes, that is unfortuante, however there is a issue to add negation filters (I am not going to look it up but you might want to add a 👍 up if you go and find it to help get it more traction). You could add in a FR to perhaps somehow denote a loopback address or maybe add a filter to look at the IP's on a interface for a "has loopback" and we could add that.

@DanSheps commented on GitHub (Dec 7, 2021): > sorry, but this proper method is crap: it inflates the interfaces list with these loopback entries. NetBox models real world, almost every OS has a interface for loopback addresses. Those loopback entries exist in real-life too. As far as inflating the interface list, I don't know too many people that use a unfiltered interface list and loopback interfaces are virtual so you can at least filter on Physical interfaces. However, I am rarely in the interface list as part of my daily work, I am mainly in a device view interface list. Example of a loopback interface on Windows: ``` ifIndex InterfaceAlias AddressFamily NlMtu(Bytes) InterfaceMetric Dhcp ConnectionState PolicyStore ------- -------------- ------------- ------------ --------------- ---- --------------- ----------- 1 Loopback Pseudo-Interface 1 IPv6 4294967295 75 Disabled Connected ActiveStore ``` ``` ifIndex IPAddress PrefixLength PrefixOrigin SuffixOrigin AddressState PolicyStore ------- --------- ------------ ------------ ------------ ------------ ----------- 1 ::1 128 WellKnown WellKnown Preferred ActiveStore 1 127.0.0.1 8 WellKnown WellKnown Preferred ActiveStore ``` On the windows example, you can even add non-loopback addresses to the loopback interface. This is going to be the same on Linux as well. > and AFAIK it is not possible to hide these loopback entries from interface list :-( > unfortunately it is not possible to mark interface as loopback. Only an address can have role: loopback. > IMHO usually you call an _interface_ loopback, not address. Yes, that is unfortuante, however there is a issue to add negation filters (I am not going to look it up but you might want to add a 👍 up if you go and find it to help get it more traction). You could add in a FR to perhaps somehow denote a loopback address or maybe add a filter to look at the IP's on a interface for a "has loopback" and we could add that.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5733