Why is some virtual network interface assigned private IP address, while some is assigned loopback IP address?2019 Community Moderator ElectionWhat does the action “loop back” mean?Which network interface or IP address in the guest OS corresponds to which in the host OS?When does an IP address not need to be assigned to a network interface?In what cases, can ping receive response when the IP address is not assigned to a network interface?How to find a private class A IP address assigned to cable modem by DHCP server?

Female=gender counterpart?

Blender - show edges angles “direction”

Is there any significance to the Valyrian Stone vault door of Qarth?

Could solar power be utilized and substitute coal in the 19th century?

For airliners, what prevents wing strikes on landing in bad weather?

The most efficient algorithm to find all possible integer pairs which sum to a given integer

What does the "3am" section means in manpages?

Java - What do constructor type arguments mean when placed *before* the type?

Why isn't KTEX's runway designation 10/28 instead of 9/27?

How can I raise concerns with a new DM about XP splitting?

Can a malicious addon access internet history and such in chrome/firefox?

Indicating multiple different modes of speech (fantasy language or telepathy)

How do I repair my stair bannister?

Installing PowerShell on 32-bit Kali OS fails

Can I create an upright 7-foot × 5-foot wall with the Minor Illusion spell?

Is there enough fresh water in the world to eradicate the drinking water crisis?

Superhero words!

Is it possible to build a CPA Secure encryption scheme which remains secure even when the encryption of secret key is given?

You're three for three

Calculating the number of days between 2 dates in Excel

A Standard Integral Equation

I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?

Why are all the doors on Ferenginar (the Ferengi home world) far shorter than the average Ferengi?

Identify a stage play about a VR experience in which participants are encouraged to simulate performing horrific activities



Why is some virtual network interface assigned private IP address, while some is assigned loopback IP address?



2019 Community Moderator ElectionWhat does the action “loop back” mean?Which network interface or IP address in the guest OS corresponds to which in the host OS?When does an IP address not need to be assigned to a network interface?In what cases, can ping receive response when the IP address is not assigned to a network interface?How to find a private class A IP address assigned to cable modem by DHCP server?










1















Are docker0, lo and virbr0 are virtual network interfaces?



Why are docker0 and virbr0 assigned private not loopback IP address?



If private IP address can work like a loopback address, can lo be assigned a prviate instead of loopback IP address?



Loopback addresses are 127.*.*.*. Do they always form a network instead of being split into several smaller networks, as in the example?



192.168.*.* is a range of private IP addresses. Are they often split into several smaller networks, as in the example (wlx8 and virbr0)?



Thanks.



$ ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:a6:79:a6:bc txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1552397 bytes 88437726 (88.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1552397 bytes 88437726 (88.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:b1:aa:1f txqueuelen 1000 (Ethernet)
RX packets 123 bytes 12102 (12.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 39 bytes 4300 (4.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlx8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.97 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::a0df:c436:afb1:8b45 prefixlen 64 scopeid 0x20<link>
ether txqueuelen 1000 (Ethernet)
RX packets 991338 bytes 536052615 (536.0 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 618233 bytes 101520924 (101.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0









share|improve this question
























  • The private addresses do not work the same as loopback adresses. A packet sent to a private address is not looped back. A rfc1918 ("private") address is simply an adress from a blocks reserved for use "inside an organization", but with the ipv4 address shortage, more and more clients are only assigned such addresses by ISPs, which are then using some form of NAT to let them use the Internet.

    – Uncle Billy
    Mar 22 at 13:16















1















Are docker0, lo and virbr0 are virtual network interfaces?



Why are docker0 and virbr0 assigned private not loopback IP address?



If private IP address can work like a loopback address, can lo be assigned a prviate instead of loopback IP address?



Loopback addresses are 127.*.*.*. Do they always form a network instead of being split into several smaller networks, as in the example?



192.168.*.* is a range of private IP addresses. Are they often split into several smaller networks, as in the example (wlx8 and virbr0)?



Thanks.



$ ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:a6:79:a6:bc txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1552397 bytes 88437726 (88.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1552397 bytes 88437726 (88.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:b1:aa:1f txqueuelen 1000 (Ethernet)
RX packets 123 bytes 12102 (12.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 39 bytes 4300 (4.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlx8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.97 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::a0df:c436:afb1:8b45 prefixlen 64 scopeid 0x20<link>
ether txqueuelen 1000 (Ethernet)
RX packets 991338 bytes 536052615 (536.0 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 618233 bytes 101520924 (101.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0









share|improve this question
























  • The private addresses do not work the same as loopback adresses. A packet sent to a private address is not looped back. A rfc1918 ("private") address is simply an adress from a blocks reserved for use "inside an organization", but with the ipv4 address shortage, more and more clients are only assigned such addresses by ISPs, which are then using some form of NAT to let them use the Internet.

    – Uncle Billy
    Mar 22 at 13:16













1












1








1








Are docker0, lo and virbr0 are virtual network interfaces?



Why are docker0 and virbr0 assigned private not loopback IP address?



If private IP address can work like a loopback address, can lo be assigned a prviate instead of loopback IP address?



Loopback addresses are 127.*.*.*. Do they always form a network instead of being split into several smaller networks, as in the example?



192.168.*.* is a range of private IP addresses. Are they often split into several smaller networks, as in the example (wlx8 and virbr0)?



Thanks.



$ ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:a6:79:a6:bc txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1552397 bytes 88437726 (88.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1552397 bytes 88437726 (88.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:b1:aa:1f txqueuelen 1000 (Ethernet)
RX packets 123 bytes 12102 (12.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 39 bytes 4300 (4.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlx8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.97 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::a0df:c436:afb1:8b45 prefixlen 64 scopeid 0x20<link>
ether txqueuelen 1000 (Ethernet)
RX packets 991338 bytes 536052615 (536.0 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 618233 bytes 101520924 (101.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0









share|improve this question
















Are docker0, lo and virbr0 are virtual network interfaces?



Why are docker0 and virbr0 assigned private not loopback IP address?



If private IP address can work like a loopback address, can lo be assigned a prviate instead of loopback IP address?



Loopback addresses are 127.*.*.*. Do they always form a network instead of being split into several smaller networks, as in the example?



192.168.*.* is a range of private IP addresses. Are they often split into several smaller networks, as in the example (wlx8 and virbr0)?



Thanks.



$ ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:a6:79:a6:bc txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1552397 bytes 88437726 (88.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1552397 bytes 88437726 (88.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:b1:aa:1f txqueuelen 1000 (Ethernet)
RX packets 123 bytes 12102 (12.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 39 bytes 4300 (4.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlx8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.97 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::a0df:c436:afb1:8b45 prefixlen 64 scopeid 0x20<link>
ether txqueuelen 1000 (Ethernet)
RX packets 991338 bytes 536052615 (536.0 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 618233 bytes 101520924 (101.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0






ip-address private-network loopback






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 22 at 13:03







Tim

















asked Mar 22 at 12:57









TimTim

28.1k78269490




28.1k78269490












  • The private addresses do not work the same as loopback adresses. A packet sent to a private address is not looped back. A rfc1918 ("private") address is simply an adress from a blocks reserved for use "inside an organization", but with the ipv4 address shortage, more and more clients are only assigned such addresses by ISPs, which are then using some form of NAT to let them use the Internet.

    – Uncle Billy
    Mar 22 at 13:16

















  • The private addresses do not work the same as loopback adresses. A packet sent to a private address is not looped back. A rfc1918 ("private") address is simply an adress from a blocks reserved for use "inside an organization", but with the ipv4 address shortage, more and more clients are only assigned such addresses by ISPs, which are then using some form of NAT to let them use the Internet.

    – Uncle Billy
    Mar 22 at 13:16
















The private addresses do not work the same as loopback adresses. A packet sent to a private address is not looped back. A rfc1918 ("private") address is simply an adress from a blocks reserved for use "inside an organization", but with the ipv4 address shortage, more and more clients are only assigned such addresses by ISPs, which are then using some form of NAT to let them use the Internet.

– Uncle Billy
Mar 22 at 13:16





The private addresses do not work the same as loopback adresses. A packet sent to a private address is not looped back. A rfc1918 ("private") address is simply an adress from a blocks reserved for use "inside an organization", but with the ipv4 address shortage, more and more clients are only assigned such addresses by ISPs, which are then using some form of NAT to let them use the Internet.

– Uncle Billy
Mar 22 at 13:16










2 Answers
2






active

oldest

votes


















4














What constitutes a “network” (a set of endpoints which are reachable without the help of routers) is determined by the netmask here. Thus docker0 is on the 172.17.x.x network (and can talk to any 172.17.x.x endpoint in the same layer 2 network), lo is on the 127.x.x.x network, virbr0 is on the 192.168.122.x network (and can talk to any 192.168.122.x endpoint in the same layer 2 network), and wlx8 is on the 192.168.1.x network (I’ll let you fill in), and they’re all separate. The loopback network is special in that by default, all 127.x.x.x addresses correspond to the local host.




Are docker0, lo and virbr0 are virtual network interfaces?




Yes, they don’t correspond to physical network interfaces.




Why are docker0 and virbr0 assigned private not loopback IP address?




Because they are not loopback interfaces. Such interfaces are generally used to communicate with containers or VMs, which are separate (from a networking perspective, which is what concerns us here) from the local host.




If private IP address can work like a loopback address, can lo be assigned a prviate instead of loopback IP address?




No, private IP addresses don’t work like a loopback address. (They can be made to work in any way you want, but that’s for networking experts and people who design systems such as Istio with Envoy, which uses an interesting loopback trick for multi-cluster setups.)




Loopback addresses are 127.*.*.*. Do they always form a network instead of being split into several smaller networks, as in the example?




See my first point.




192.168.*.* is a range of private IP addresses. Are they often split into several smaller networks, as in the example (wlx8 and virbr0)?




Yes; again, see my first point.






share|improve this answer

























  • Thanks. (1) Loopback addresses are 127.*.*.*. Are they normally assigned to the same virtual network interface, or to different virtual network interface? For example, if a process sends a request to 127.0.0.2:2000, will a process listening at 127.0.0.1:2000 receive it? (2) I am still not sure: do 127.*.*.* addresses always form a network instead of being split into several smaller networks, as in the example?

    – Tim
    Mar 22 at 13:20












  • Loopback addresses don’t need to be assigned; try pinging different loopback addresses, you’ll see answers (from the local host) even though they’re not assigned. However they’re distinguished when binding, so a process listening on 127.0.0.1:2000 won’t receive traffic directed to 127.0.0.2:2000 (try it with nc). Perhaps my first point wasn’t clear: 127.x.x.x forms a single network.

    – Stephen Kitt
    Mar 22 at 13:27











  • ifconfig doesn't show any interface with 127.0.0.2. Is such a virtual network interface exist? If I ping it, should the virtual network respond?

    – Tim
    Mar 22 at 13:42











  • Re-read what I wrote, and try it.

    – Stephen Kitt
    Mar 22 at 13:43











  • Maybe I miss something. ping 127.0.0.2 can receives response. But ifconfig doesn't show any interface with 127.0.0.2. Is such a virtual network interface exist? How shall I understand it? Is ping supposed to test if a network interface for an IP address exists and is working?

    – Tim
    Mar 22 at 14:23



















1















Are docker0, lo and virbr0 are virtual network interfaces?




Yes.



They are not all the same type. All it means is they are not provided by a hardware device. Virtual devices are listed in /sys/devices/virtual/. Look in the net/ subdirectory.




If private IP address can work like a loopback address,




I don't know what you mean




can lo be assigned a prviate instead of loopback IP address?




Yes. Worked fine for me, try it yourself. ip addr add <ADDR> dev lo.




Loopback addresses are 127.*.*.*. Do they always form a network instead of being split into several smaller networks, as in the example?




I don't really know. But I am suspicious of any software that relies on splitting 127.*.*.*. In IPv6, you only get one loopback address ::1. Because the authors did not find any good reasons for having a whole loopback network (let alone 2^24 such addresses). So, it is clear it was not used very much.




192.168.*.* is a range of private IP addresses. Are they often split into several smaller networks, as in the example (wlx8 and virbr0)?




Splitting 192.168.*.* into subnets is absolutely the most common way of using it. Your home router almost certainly uses 192.168.0.* or 192.168.1.* by default. This helps when you want to configure multiple subnets - e.g. a second network for guest Wi-Fi access, which is firewalled from your main network.




Why are docker0 and virbr0 assigned private not loopback IP address?




Why would they not be?



More specifically, the IPv4 standard could reasonably be interpreted as requiring all the loopback addresses to behave as loopbacks. This means that it is not legal to use them e.g. to communicate between a docker container and a docker host. Because they would no longer work as loopback addresses.



Maybe the standard requirement means something else. I.e. maybe it could be legal to use them to construct more complex virtual networks, if you never let them touch a physical network. The standard does not clarify this point. Where the loopback network is supported, it has generally been interpreted in the same way as Linux has. So people are used to that implementation, and would be confused to see something different.






share|improve this answer
























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f507980%2fwhy-is-some-virtual-network-interface-assigned-private-ip-address-while-some-is%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4














    What constitutes a “network” (a set of endpoints which are reachable without the help of routers) is determined by the netmask here. Thus docker0 is on the 172.17.x.x network (and can talk to any 172.17.x.x endpoint in the same layer 2 network), lo is on the 127.x.x.x network, virbr0 is on the 192.168.122.x network (and can talk to any 192.168.122.x endpoint in the same layer 2 network), and wlx8 is on the 192.168.1.x network (I’ll let you fill in), and they’re all separate. The loopback network is special in that by default, all 127.x.x.x addresses correspond to the local host.




    Are docker0, lo and virbr0 are virtual network interfaces?




    Yes, they don’t correspond to physical network interfaces.




    Why are docker0 and virbr0 assigned private not loopback IP address?




    Because they are not loopback interfaces. Such interfaces are generally used to communicate with containers or VMs, which are separate (from a networking perspective, which is what concerns us here) from the local host.




    If private IP address can work like a loopback address, can lo be assigned a prviate instead of loopback IP address?




    No, private IP addresses don’t work like a loopback address. (They can be made to work in any way you want, but that’s for networking experts and people who design systems such as Istio with Envoy, which uses an interesting loopback trick for multi-cluster setups.)




    Loopback addresses are 127.*.*.*. Do they always form a network instead of being split into several smaller networks, as in the example?




    See my first point.




    192.168.*.* is a range of private IP addresses. Are they often split into several smaller networks, as in the example (wlx8 and virbr0)?




    Yes; again, see my first point.






    share|improve this answer

























    • Thanks. (1) Loopback addresses are 127.*.*.*. Are they normally assigned to the same virtual network interface, or to different virtual network interface? For example, if a process sends a request to 127.0.0.2:2000, will a process listening at 127.0.0.1:2000 receive it? (2) I am still not sure: do 127.*.*.* addresses always form a network instead of being split into several smaller networks, as in the example?

      – Tim
      Mar 22 at 13:20












    • Loopback addresses don’t need to be assigned; try pinging different loopback addresses, you’ll see answers (from the local host) even though they’re not assigned. However they’re distinguished when binding, so a process listening on 127.0.0.1:2000 won’t receive traffic directed to 127.0.0.2:2000 (try it with nc). Perhaps my first point wasn’t clear: 127.x.x.x forms a single network.

      – Stephen Kitt
      Mar 22 at 13:27











    • ifconfig doesn't show any interface with 127.0.0.2. Is such a virtual network interface exist? If I ping it, should the virtual network respond?

      – Tim
      Mar 22 at 13:42











    • Re-read what I wrote, and try it.

      – Stephen Kitt
      Mar 22 at 13:43











    • Maybe I miss something. ping 127.0.0.2 can receives response. But ifconfig doesn't show any interface with 127.0.0.2. Is such a virtual network interface exist? How shall I understand it? Is ping supposed to test if a network interface for an IP address exists and is working?

      – Tim
      Mar 22 at 14:23
















    4














    What constitutes a “network” (a set of endpoints which are reachable without the help of routers) is determined by the netmask here. Thus docker0 is on the 172.17.x.x network (and can talk to any 172.17.x.x endpoint in the same layer 2 network), lo is on the 127.x.x.x network, virbr0 is on the 192.168.122.x network (and can talk to any 192.168.122.x endpoint in the same layer 2 network), and wlx8 is on the 192.168.1.x network (I’ll let you fill in), and they’re all separate. The loopback network is special in that by default, all 127.x.x.x addresses correspond to the local host.




    Are docker0, lo and virbr0 are virtual network interfaces?




    Yes, they don’t correspond to physical network interfaces.




    Why are docker0 and virbr0 assigned private not loopback IP address?




    Because they are not loopback interfaces. Such interfaces are generally used to communicate with containers or VMs, which are separate (from a networking perspective, which is what concerns us here) from the local host.




    If private IP address can work like a loopback address, can lo be assigned a prviate instead of loopback IP address?




    No, private IP addresses don’t work like a loopback address. (They can be made to work in any way you want, but that’s for networking experts and people who design systems such as Istio with Envoy, which uses an interesting loopback trick for multi-cluster setups.)




    Loopback addresses are 127.*.*.*. Do they always form a network instead of being split into several smaller networks, as in the example?




    See my first point.




    192.168.*.* is a range of private IP addresses. Are they often split into several smaller networks, as in the example (wlx8 and virbr0)?




    Yes; again, see my first point.






    share|improve this answer

























    • Thanks. (1) Loopback addresses are 127.*.*.*. Are they normally assigned to the same virtual network interface, or to different virtual network interface? For example, if a process sends a request to 127.0.0.2:2000, will a process listening at 127.0.0.1:2000 receive it? (2) I am still not sure: do 127.*.*.* addresses always form a network instead of being split into several smaller networks, as in the example?

      – Tim
      Mar 22 at 13:20












    • Loopback addresses don’t need to be assigned; try pinging different loopback addresses, you’ll see answers (from the local host) even though they’re not assigned. However they’re distinguished when binding, so a process listening on 127.0.0.1:2000 won’t receive traffic directed to 127.0.0.2:2000 (try it with nc). Perhaps my first point wasn’t clear: 127.x.x.x forms a single network.

      – Stephen Kitt
      Mar 22 at 13:27











    • ifconfig doesn't show any interface with 127.0.0.2. Is such a virtual network interface exist? If I ping it, should the virtual network respond?

      – Tim
      Mar 22 at 13:42











    • Re-read what I wrote, and try it.

      – Stephen Kitt
      Mar 22 at 13:43











    • Maybe I miss something. ping 127.0.0.2 can receives response. But ifconfig doesn't show any interface with 127.0.0.2. Is such a virtual network interface exist? How shall I understand it? Is ping supposed to test if a network interface for an IP address exists and is working?

      – Tim
      Mar 22 at 14:23














    4












    4








    4







    What constitutes a “network” (a set of endpoints which are reachable without the help of routers) is determined by the netmask here. Thus docker0 is on the 172.17.x.x network (and can talk to any 172.17.x.x endpoint in the same layer 2 network), lo is on the 127.x.x.x network, virbr0 is on the 192.168.122.x network (and can talk to any 192.168.122.x endpoint in the same layer 2 network), and wlx8 is on the 192.168.1.x network (I’ll let you fill in), and they’re all separate. The loopback network is special in that by default, all 127.x.x.x addresses correspond to the local host.




    Are docker0, lo and virbr0 are virtual network interfaces?




    Yes, they don’t correspond to physical network interfaces.




    Why are docker0 and virbr0 assigned private not loopback IP address?




    Because they are not loopback interfaces. Such interfaces are generally used to communicate with containers or VMs, which are separate (from a networking perspective, which is what concerns us here) from the local host.




    If private IP address can work like a loopback address, can lo be assigned a prviate instead of loopback IP address?




    No, private IP addresses don’t work like a loopback address. (They can be made to work in any way you want, but that’s for networking experts and people who design systems such as Istio with Envoy, which uses an interesting loopback trick for multi-cluster setups.)




    Loopback addresses are 127.*.*.*. Do they always form a network instead of being split into several smaller networks, as in the example?




    See my first point.




    192.168.*.* is a range of private IP addresses. Are they often split into several smaller networks, as in the example (wlx8 and virbr0)?




    Yes; again, see my first point.






    share|improve this answer















    What constitutes a “network” (a set of endpoints which are reachable without the help of routers) is determined by the netmask here. Thus docker0 is on the 172.17.x.x network (and can talk to any 172.17.x.x endpoint in the same layer 2 network), lo is on the 127.x.x.x network, virbr0 is on the 192.168.122.x network (and can talk to any 192.168.122.x endpoint in the same layer 2 network), and wlx8 is on the 192.168.1.x network (I’ll let you fill in), and they’re all separate. The loopback network is special in that by default, all 127.x.x.x addresses correspond to the local host.




    Are docker0, lo and virbr0 are virtual network interfaces?




    Yes, they don’t correspond to physical network interfaces.




    Why are docker0 and virbr0 assigned private not loopback IP address?




    Because they are not loopback interfaces. Such interfaces are generally used to communicate with containers or VMs, which are separate (from a networking perspective, which is what concerns us here) from the local host.




    If private IP address can work like a loopback address, can lo be assigned a prviate instead of loopback IP address?




    No, private IP addresses don’t work like a loopback address. (They can be made to work in any way you want, but that’s for networking experts and people who design systems such as Istio with Envoy, which uses an interesting loopback trick for multi-cluster setups.)




    Loopback addresses are 127.*.*.*. Do they always form a network instead of being split into several smaller networks, as in the example?




    See my first point.




    192.168.*.* is a range of private IP addresses. Are they often split into several smaller networks, as in the example (wlx8 and virbr0)?




    Yes; again, see my first point.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 22 at 18:44

























    answered Mar 22 at 13:15









    Stephen KittStephen Kitt

    177k24402480




    177k24402480












    • Thanks. (1) Loopback addresses are 127.*.*.*. Are they normally assigned to the same virtual network interface, or to different virtual network interface? For example, if a process sends a request to 127.0.0.2:2000, will a process listening at 127.0.0.1:2000 receive it? (2) I am still not sure: do 127.*.*.* addresses always form a network instead of being split into several smaller networks, as in the example?

      – Tim
      Mar 22 at 13:20












    • Loopback addresses don’t need to be assigned; try pinging different loopback addresses, you’ll see answers (from the local host) even though they’re not assigned. However they’re distinguished when binding, so a process listening on 127.0.0.1:2000 won’t receive traffic directed to 127.0.0.2:2000 (try it with nc). Perhaps my first point wasn’t clear: 127.x.x.x forms a single network.

      – Stephen Kitt
      Mar 22 at 13:27











    • ifconfig doesn't show any interface with 127.0.0.2. Is such a virtual network interface exist? If I ping it, should the virtual network respond?

      – Tim
      Mar 22 at 13:42











    • Re-read what I wrote, and try it.

      – Stephen Kitt
      Mar 22 at 13:43











    • Maybe I miss something. ping 127.0.0.2 can receives response. But ifconfig doesn't show any interface with 127.0.0.2. Is such a virtual network interface exist? How shall I understand it? Is ping supposed to test if a network interface for an IP address exists and is working?

      – Tim
      Mar 22 at 14:23


















    • Thanks. (1) Loopback addresses are 127.*.*.*. Are they normally assigned to the same virtual network interface, or to different virtual network interface? For example, if a process sends a request to 127.0.0.2:2000, will a process listening at 127.0.0.1:2000 receive it? (2) I am still not sure: do 127.*.*.* addresses always form a network instead of being split into several smaller networks, as in the example?

      – Tim
      Mar 22 at 13:20












    • Loopback addresses don’t need to be assigned; try pinging different loopback addresses, you’ll see answers (from the local host) even though they’re not assigned. However they’re distinguished when binding, so a process listening on 127.0.0.1:2000 won’t receive traffic directed to 127.0.0.2:2000 (try it with nc). Perhaps my first point wasn’t clear: 127.x.x.x forms a single network.

      – Stephen Kitt
      Mar 22 at 13:27











    • ifconfig doesn't show any interface with 127.0.0.2. Is such a virtual network interface exist? If I ping it, should the virtual network respond?

      – Tim
      Mar 22 at 13:42











    • Re-read what I wrote, and try it.

      – Stephen Kitt
      Mar 22 at 13:43











    • Maybe I miss something. ping 127.0.0.2 can receives response. But ifconfig doesn't show any interface with 127.0.0.2. Is such a virtual network interface exist? How shall I understand it? Is ping supposed to test if a network interface for an IP address exists and is working?

      – Tim
      Mar 22 at 14:23

















    Thanks. (1) Loopback addresses are 127.*.*.*. Are they normally assigned to the same virtual network interface, or to different virtual network interface? For example, if a process sends a request to 127.0.0.2:2000, will a process listening at 127.0.0.1:2000 receive it? (2) I am still not sure: do 127.*.*.* addresses always form a network instead of being split into several smaller networks, as in the example?

    – Tim
    Mar 22 at 13:20






    Thanks. (1) Loopback addresses are 127.*.*.*. Are they normally assigned to the same virtual network interface, or to different virtual network interface? For example, if a process sends a request to 127.0.0.2:2000, will a process listening at 127.0.0.1:2000 receive it? (2) I am still not sure: do 127.*.*.* addresses always form a network instead of being split into several smaller networks, as in the example?

    – Tim
    Mar 22 at 13:20














    Loopback addresses don’t need to be assigned; try pinging different loopback addresses, you’ll see answers (from the local host) even though they’re not assigned. However they’re distinguished when binding, so a process listening on 127.0.0.1:2000 won’t receive traffic directed to 127.0.0.2:2000 (try it with nc). Perhaps my first point wasn’t clear: 127.x.x.x forms a single network.

    – Stephen Kitt
    Mar 22 at 13:27





    Loopback addresses don’t need to be assigned; try pinging different loopback addresses, you’ll see answers (from the local host) even though they’re not assigned. However they’re distinguished when binding, so a process listening on 127.0.0.1:2000 won’t receive traffic directed to 127.0.0.2:2000 (try it with nc). Perhaps my first point wasn’t clear: 127.x.x.x forms a single network.

    – Stephen Kitt
    Mar 22 at 13:27













    ifconfig doesn't show any interface with 127.0.0.2. Is such a virtual network interface exist? If I ping it, should the virtual network respond?

    – Tim
    Mar 22 at 13:42





    ifconfig doesn't show any interface with 127.0.0.2. Is such a virtual network interface exist? If I ping it, should the virtual network respond?

    – Tim
    Mar 22 at 13:42













    Re-read what I wrote, and try it.

    – Stephen Kitt
    Mar 22 at 13:43





    Re-read what I wrote, and try it.

    – Stephen Kitt
    Mar 22 at 13:43













    Maybe I miss something. ping 127.0.0.2 can receives response. But ifconfig doesn't show any interface with 127.0.0.2. Is such a virtual network interface exist? How shall I understand it? Is ping supposed to test if a network interface for an IP address exists and is working?

    – Tim
    Mar 22 at 14:23






    Maybe I miss something. ping 127.0.0.2 can receives response. But ifconfig doesn't show any interface with 127.0.0.2. Is such a virtual network interface exist? How shall I understand it? Is ping supposed to test if a network interface for an IP address exists and is working?

    – Tim
    Mar 22 at 14:23














    1















    Are docker0, lo and virbr0 are virtual network interfaces?




    Yes.



    They are not all the same type. All it means is they are not provided by a hardware device. Virtual devices are listed in /sys/devices/virtual/. Look in the net/ subdirectory.




    If private IP address can work like a loopback address,




    I don't know what you mean




    can lo be assigned a prviate instead of loopback IP address?




    Yes. Worked fine for me, try it yourself. ip addr add <ADDR> dev lo.




    Loopback addresses are 127.*.*.*. Do they always form a network instead of being split into several smaller networks, as in the example?




    I don't really know. But I am suspicious of any software that relies on splitting 127.*.*.*. In IPv6, you only get one loopback address ::1. Because the authors did not find any good reasons for having a whole loopback network (let alone 2^24 such addresses). So, it is clear it was not used very much.




    192.168.*.* is a range of private IP addresses. Are they often split into several smaller networks, as in the example (wlx8 and virbr0)?




    Splitting 192.168.*.* into subnets is absolutely the most common way of using it. Your home router almost certainly uses 192.168.0.* or 192.168.1.* by default. This helps when you want to configure multiple subnets - e.g. a second network for guest Wi-Fi access, which is firewalled from your main network.




    Why are docker0 and virbr0 assigned private not loopback IP address?




    Why would they not be?



    More specifically, the IPv4 standard could reasonably be interpreted as requiring all the loopback addresses to behave as loopbacks. This means that it is not legal to use them e.g. to communicate between a docker container and a docker host. Because they would no longer work as loopback addresses.



    Maybe the standard requirement means something else. I.e. maybe it could be legal to use them to construct more complex virtual networks, if you never let them touch a physical network. The standard does not clarify this point. Where the loopback network is supported, it has generally been interpreted in the same way as Linux has. So people are used to that implementation, and would be confused to see something different.






    share|improve this answer





























      1















      Are docker0, lo and virbr0 are virtual network interfaces?




      Yes.



      They are not all the same type. All it means is they are not provided by a hardware device. Virtual devices are listed in /sys/devices/virtual/. Look in the net/ subdirectory.




      If private IP address can work like a loopback address,




      I don't know what you mean




      can lo be assigned a prviate instead of loopback IP address?




      Yes. Worked fine for me, try it yourself. ip addr add <ADDR> dev lo.




      Loopback addresses are 127.*.*.*. Do they always form a network instead of being split into several smaller networks, as in the example?




      I don't really know. But I am suspicious of any software that relies on splitting 127.*.*.*. In IPv6, you only get one loopback address ::1. Because the authors did not find any good reasons for having a whole loopback network (let alone 2^24 such addresses). So, it is clear it was not used very much.




      192.168.*.* is a range of private IP addresses. Are they often split into several smaller networks, as in the example (wlx8 and virbr0)?




      Splitting 192.168.*.* into subnets is absolutely the most common way of using it. Your home router almost certainly uses 192.168.0.* or 192.168.1.* by default. This helps when you want to configure multiple subnets - e.g. a second network for guest Wi-Fi access, which is firewalled from your main network.




      Why are docker0 and virbr0 assigned private not loopback IP address?




      Why would they not be?



      More specifically, the IPv4 standard could reasonably be interpreted as requiring all the loopback addresses to behave as loopbacks. This means that it is not legal to use them e.g. to communicate between a docker container and a docker host. Because they would no longer work as loopback addresses.



      Maybe the standard requirement means something else. I.e. maybe it could be legal to use them to construct more complex virtual networks, if you never let them touch a physical network. The standard does not clarify this point. Where the loopback network is supported, it has generally been interpreted in the same way as Linux has. So people are used to that implementation, and would be confused to see something different.






      share|improve this answer



























        1












        1








        1








        Are docker0, lo and virbr0 are virtual network interfaces?




        Yes.



        They are not all the same type. All it means is they are not provided by a hardware device. Virtual devices are listed in /sys/devices/virtual/. Look in the net/ subdirectory.




        If private IP address can work like a loopback address,




        I don't know what you mean




        can lo be assigned a prviate instead of loopback IP address?




        Yes. Worked fine for me, try it yourself. ip addr add <ADDR> dev lo.




        Loopback addresses are 127.*.*.*. Do they always form a network instead of being split into several smaller networks, as in the example?




        I don't really know. But I am suspicious of any software that relies on splitting 127.*.*.*. In IPv6, you only get one loopback address ::1. Because the authors did not find any good reasons for having a whole loopback network (let alone 2^24 such addresses). So, it is clear it was not used very much.




        192.168.*.* is a range of private IP addresses. Are they often split into several smaller networks, as in the example (wlx8 and virbr0)?




        Splitting 192.168.*.* into subnets is absolutely the most common way of using it. Your home router almost certainly uses 192.168.0.* or 192.168.1.* by default. This helps when you want to configure multiple subnets - e.g. a second network for guest Wi-Fi access, which is firewalled from your main network.




        Why are docker0 and virbr0 assigned private not loopback IP address?




        Why would they not be?



        More specifically, the IPv4 standard could reasonably be interpreted as requiring all the loopback addresses to behave as loopbacks. This means that it is not legal to use them e.g. to communicate between a docker container and a docker host. Because they would no longer work as loopback addresses.



        Maybe the standard requirement means something else. I.e. maybe it could be legal to use them to construct more complex virtual networks, if you never let them touch a physical network. The standard does not clarify this point. Where the loopback network is supported, it has generally been interpreted in the same way as Linux has. So people are used to that implementation, and would be confused to see something different.






        share|improve this answer
















        Are docker0, lo and virbr0 are virtual network interfaces?




        Yes.



        They are not all the same type. All it means is they are not provided by a hardware device. Virtual devices are listed in /sys/devices/virtual/. Look in the net/ subdirectory.




        If private IP address can work like a loopback address,




        I don't know what you mean




        can lo be assigned a prviate instead of loopback IP address?




        Yes. Worked fine for me, try it yourself. ip addr add <ADDR> dev lo.




        Loopback addresses are 127.*.*.*. Do they always form a network instead of being split into several smaller networks, as in the example?




        I don't really know. But I am suspicious of any software that relies on splitting 127.*.*.*. In IPv6, you only get one loopback address ::1. Because the authors did not find any good reasons for having a whole loopback network (let alone 2^24 such addresses). So, it is clear it was not used very much.




        192.168.*.* is a range of private IP addresses. Are they often split into several smaller networks, as in the example (wlx8 and virbr0)?




        Splitting 192.168.*.* into subnets is absolutely the most common way of using it. Your home router almost certainly uses 192.168.0.* or 192.168.1.* by default. This helps when you want to configure multiple subnets - e.g. a second network for guest Wi-Fi access, which is firewalled from your main network.




        Why are docker0 and virbr0 assigned private not loopback IP address?




        Why would they not be?



        More specifically, the IPv4 standard could reasonably be interpreted as requiring all the loopback addresses to behave as loopbacks. This means that it is not legal to use them e.g. to communicate between a docker container and a docker host. Because they would no longer work as loopback addresses.



        Maybe the standard requirement means something else. I.e. maybe it could be legal to use them to construct more complex virtual networks, if you never let them touch a physical network. The standard does not clarify this point. Where the loopback network is supported, it has generally been interpreted in the same way as Linux has. So people are used to that implementation, and would be confused to see something different.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 2 days ago

























        answered Mar 22 at 21:12









        sourcejedisourcejedi

        25.4k445110




        25.4k445110



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f507980%2fwhy-is-some-virtual-network-interface-assigned-private-ip-address-while-some-is%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            -ip-address, loopback, private-network

            Popular posts from this blog

            Creating 100m^2 grid automatically using QGIS?Creating grid constrained within polygon in QGIS?Createing polygon layer from point data using QGIS?Creating vector grid using QGIS?Creating grid polygons from coordinates using R or PythonCreating grid from spatio temporal point data?Creating fields in attributes table using other layers using QGISCreate .shp vector grid in QGISQGIS Creating 4km point grid within polygonsCreate a vector grid over a raster layerVector Grid Creates just one grid

            What is this called? Old film camera viewer?What makes a good film camera?What to do with an old film camera?What should one look for when buying a used film camera?What is the value and age of this pre-1967 Ricoh 35 mm camera?DSLR recommendation, question about old Canon 35mm film Camera & lensesCan anyone identify the silver rangefinder-style camera in this advertisement?What kind of a Polaroid 600-camera is this?Will an old film camera still work even when not used in a very long time?What is this camera / Can I develop the film?How to fit an action camera into antique (bellows) housing?What to check when buying used and old film bodies?

            Why is this plane circling around the Lucknow airport every day?Why do aircraft on Flight Radar 24 jump around randomly sometimes?What airport has this walkway over a taxiway?How does Chicago O'Hare's tower sequence aircraft at peak capacity?Which airport is featured in this Delta commercial?After a crash, for how long is the airport closed?Can a passenger plane stand still in the air, or hover at a fixed location above a ground?What are those trucks towing around, and why?What is this airport outside of Cairo, Egypt?Which US airport has the lowest circling MDH?What is this airport video?