What is the loopback device and how do I use it?












127















What are loopback and localhost?



Why do they exist, what are they used for, and how would I use them?










share|improve this question

























  • Isn't it two separate question in 1?

    – Anwar
    Apr 9 '17 at 19:07
















127















What are loopback and localhost?



Why do they exist, what are they used for, and how would I use them?










share|improve this question

























  • Isn't it two separate question in 1?

    – Anwar
    Apr 9 '17 at 19:07














127












127








127


67






What are loopback and localhost?



Why do they exist, what are they used for, and how would I use them?










share|improve this question
















What are loopback and localhost?



Why do they exist, what are they used for, and how would I use them?







networking






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 22 '13 at 0:55









Braiam

52.1k20136222




52.1k20136222










asked Jan 25 '13 at 20:58









Eliah KaganEliah Kagan

82.4k22227368




82.4k22227368













  • Isn't it two separate question in 1?

    – Anwar
    Apr 9 '17 at 19:07



















  • Isn't it two separate question in 1?

    – Anwar
    Apr 9 '17 at 19:07

















Isn't it two separate question in 1?

– Anwar
Apr 9 '17 at 19:07





Isn't it two separate question in 1?

– Anwar
Apr 9 '17 at 19:07










1 Answer
1






active

oldest

votes


















164














The loopback device is a special, virtual network interface that your computer uses to communicate with itself. It is used mainly for diagnostics and troubleshooting, and to connect to servers running on the local machine.



The Purpose of Loopback



When a network interface is disconnected--for example, when an Ethernet port is unplugged or Wi-Fi is turned off or not associated with an access point--no communication on that interface is possible, not even communication between your computer and itself. The loopback interface does not represent any actual hardware, but exists so applications running on your computer can always connect to servers on the same machine.



This is important for troubleshooting (it can be compared to looking in a mirror). The loopback device is sometimes explained as purely a diagnostic tool. But it is also helpful when a server offering a resource you need is running on your own machine.



For example, if you run a web server, you have all your web documents and could examine them file by file. You may be able to load the files in your browser too, though with server-side active content, it won't work the way it does when someone accesses it normally.



So if you want to experience the same site others do, the best course is usually to connect to your own server. The loopback interface facilitates that.



Addresses on Loopback



For IPv4, the loopback interface is assigned all the IPs in the 127.0.0.0/8 address block. That is, 127.0.0.1 through 127.255.255.254 all represent your computer. For most purposes, though, it is only necessary to use one IP address, and that is 127.0.0.1. This IP has the hostname of localhost mapped to it.



Thus, to log in as bob via SSH to the SSH server running on your own machine, you would use:



ssh bob@localhost


Like other network adapters, the loopback device shows up in the output of ifconfig. Its name is lo.



ek@Del:~$ ifconfig lo
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:50121 errors:0 dropped:0 overruns:0 frame:0
TX packets:50121 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4381349 (4.3 MB) TX bytes:4381349 (4.3 MB)


An Example: CUPS



One common, production (i.e., not just diagnostic) use of localhost on Ubuntu is to perform advanced printer configuration. In a web browser, go to:



http://localhost:631


CUPS runs a web server on port 631, and this can be used to configure printing, regardless of what GUI you are running (or even if you are not running a GUI at all).



Screenshot showing CUPS in a web browser



If you try connecting to http://127.0.0.1:631, this will work too. However, if you try to connect to http://127.0.0.2, it will not. All the 127.*.*.* addresses identify your computer on the loopback interface, but a server program can decide to bind just to a specific IP address.



A Notable Difference from Windows



If you come from a Windows background, you might expect loopback to itself be a synonym of localhost (and thus to be able to ping loopback, connect to servers on loopback, and so forth). That behavior is peculiar to Windows.




  • But you can add any name including loopback to your /etc/hosts file, with 127.0.0.1 as its address, and it will act like localhost.


Other Meanings of "Loopback"



The general concept of loopback is a mechanism through which a message or signal ends up (or loops) back to where it started.



So there are a few other ways loopback is use in Ubuntu that should not be confused with the loopback device in networking.



Loop Mounts



To mount a disk image in Ubuntu, you could run:



sudo mount -o loop image.iso /media/label


This is usually called a loop device (and not a loopback device), but the term loopback file interface is occasionally used.



This has nothing to do with the loopback device in networking.



Sound



Pulseaudio and other sound systems provide a mechanism to "connect" line-in to line-out, so that audio input is echoed back to your speakers/headphones. Pulseaudio's loopback module facilitates this.



Here, it is correct to use the term loopback, but like loop mounts, this also has nothing to do with the loopback device in networking. (And nothing to do with loop mounts, either.)



Further Reading





  • TLDP, "The Loopback Interface"

  • How is the loopback device implemented?






share|improve this answer





















  • 5





    Why does 127.0.0.0/8 map to 127.0.0.1 through 127.255.255.254 instead of 127.0.0.0 through 127.255.255.255? (Sorry if this is perceived as a highjack.)

    – JellicleCat
    Jun 25 '15 at 22:48






  • 3





    He mentioned only usable host addresses, and excluded network and broadcast addresses. You are correct in saying that it should be 127.0.0.0-127.255.255.255, but the first and last have other purposes.

    – Gabriel Samfira
    Jul 14 '15 at 14:32






  • 1





    @Eliah, Must localhost be pointing to 127.0.0.1? Or could it also point to another loopback address e.g. 127.0.0.2?

    – Pacerier
    Jan 21 '16 at 21:03











  • @GabrielSamfira, so why when I try to connect to those two IP addresses using SSH (e.g. by running ssh 127.0.0.0), it will say "Network is unreachable" instead of "Connection refused"?

    – MAChitgarha
    Aug 25 '18 at 11:20













  • @MAChitgarha The first IP address in a subnet is the network identification address, and the last IP address is the broadcast address. Neither of these can be assigned to a host by default. The broadcast address is used to address every host in a network, and the network address is used to ID the network itself. Please see: en.wikipedia.org/wiki/IP_address

    – Gabriel Samfira
    Aug 25 '18 at 14:47











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2faskubuntu.com%2fquestions%2f247625%2fwhat-is-the-loopback-device-and-how-do-i-use-it%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









164














The loopback device is a special, virtual network interface that your computer uses to communicate with itself. It is used mainly for diagnostics and troubleshooting, and to connect to servers running on the local machine.



The Purpose of Loopback



When a network interface is disconnected--for example, when an Ethernet port is unplugged or Wi-Fi is turned off or not associated with an access point--no communication on that interface is possible, not even communication between your computer and itself. The loopback interface does not represent any actual hardware, but exists so applications running on your computer can always connect to servers on the same machine.



This is important for troubleshooting (it can be compared to looking in a mirror). The loopback device is sometimes explained as purely a diagnostic tool. But it is also helpful when a server offering a resource you need is running on your own machine.



For example, if you run a web server, you have all your web documents and could examine them file by file. You may be able to load the files in your browser too, though with server-side active content, it won't work the way it does when someone accesses it normally.



So if you want to experience the same site others do, the best course is usually to connect to your own server. The loopback interface facilitates that.



Addresses on Loopback



For IPv4, the loopback interface is assigned all the IPs in the 127.0.0.0/8 address block. That is, 127.0.0.1 through 127.255.255.254 all represent your computer. For most purposes, though, it is only necessary to use one IP address, and that is 127.0.0.1. This IP has the hostname of localhost mapped to it.



Thus, to log in as bob via SSH to the SSH server running on your own machine, you would use:



ssh bob@localhost


Like other network adapters, the loopback device shows up in the output of ifconfig. Its name is lo.



ek@Del:~$ ifconfig lo
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:50121 errors:0 dropped:0 overruns:0 frame:0
TX packets:50121 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4381349 (4.3 MB) TX bytes:4381349 (4.3 MB)


An Example: CUPS



One common, production (i.e., not just diagnostic) use of localhost on Ubuntu is to perform advanced printer configuration. In a web browser, go to:



http://localhost:631


CUPS runs a web server on port 631, and this can be used to configure printing, regardless of what GUI you are running (or even if you are not running a GUI at all).



Screenshot showing CUPS in a web browser



If you try connecting to http://127.0.0.1:631, this will work too. However, if you try to connect to http://127.0.0.2, it will not. All the 127.*.*.* addresses identify your computer on the loopback interface, but a server program can decide to bind just to a specific IP address.



A Notable Difference from Windows



If you come from a Windows background, you might expect loopback to itself be a synonym of localhost (and thus to be able to ping loopback, connect to servers on loopback, and so forth). That behavior is peculiar to Windows.




  • But you can add any name including loopback to your /etc/hosts file, with 127.0.0.1 as its address, and it will act like localhost.


Other Meanings of "Loopback"



The general concept of loopback is a mechanism through which a message or signal ends up (or loops) back to where it started.



So there are a few other ways loopback is use in Ubuntu that should not be confused with the loopback device in networking.



Loop Mounts



To mount a disk image in Ubuntu, you could run:



sudo mount -o loop image.iso /media/label


This is usually called a loop device (and not a loopback device), but the term loopback file interface is occasionally used.



This has nothing to do with the loopback device in networking.



Sound



Pulseaudio and other sound systems provide a mechanism to "connect" line-in to line-out, so that audio input is echoed back to your speakers/headphones. Pulseaudio's loopback module facilitates this.



Here, it is correct to use the term loopback, but like loop mounts, this also has nothing to do with the loopback device in networking. (And nothing to do with loop mounts, either.)



Further Reading





  • TLDP, "The Loopback Interface"

  • How is the loopback device implemented?






share|improve this answer





















  • 5





    Why does 127.0.0.0/8 map to 127.0.0.1 through 127.255.255.254 instead of 127.0.0.0 through 127.255.255.255? (Sorry if this is perceived as a highjack.)

    – JellicleCat
    Jun 25 '15 at 22:48






  • 3





    He mentioned only usable host addresses, and excluded network and broadcast addresses. You are correct in saying that it should be 127.0.0.0-127.255.255.255, but the first and last have other purposes.

    – Gabriel Samfira
    Jul 14 '15 at 14:32






  • 1





    @Eliah, Must localhost be pointing to 127.0.0.1? Or could it also point to another loopback address e.g. 127.0.0.2?

    – Pacerier
    Jan 21 '16 at 21:03











  • @GabrielSamfira, so why when I try to connect to those two IP addresses using SSH (e.g. by running ssh 127.0.0.0), it will say "Network is unreachable" instead of "Connection refused"?

    – MAChitgarha
    Aug 25 '18 at 11:20













  • @MAChitgarha The first IP address in a subnet is the network identification address, and the last IP address is the broadcast address. Neither of these can be assigned to a host by default. The broadcast address is used to address every host in a network, and the network address is used to ID the network itself. Please see: en.wikipedia.org/wiki/IP_address

    – Gabriel Samfira
    Aug 25 '18 at 14:47
















164














The loopback device is a special, virtual network interface that your computer uses to communicate with itself. It is used mainly for diagnostics and troubleshooting, and to connect to servers running on the local machine.



The Purpose of Loopback



When a network interface is disconnected--for example, when an Ethernet port is unplugged or Wi-Fi is turned off or not associated with an access point--no communication on that interface is possible, not even communication between your computer and itself. The loopback interface does not represent any actual hardware, but exists so applications running on your computer can always connect to servers on the same machine.



This is important for troubleshooting (it can be compared to looking in a mirror). The loopback device is sometimes explained as purely a diagnostic tool. But it is also helpful when a server offering a resource you need is running on your own machine.



For example, if you run a web server, you have all your web documents and could examine them file by file. You may be able to load the files in your browser too, though with server-side active content, it won't work the way it does when someone accesses it normally.



So if you want to experience the same site others do, the best course is usually to connect to your own server. The loopback interface facilitates that.



Addresses on Loopback



For IPv4, the loopback interface is assigned all the IPs in the 127.0.0.0/8 address block. That is, 127.0.0.1 through 127.255.255.254 all represent your computer. For most purposes, though, it is only necessary to use one IP address, and that is 127.0.0.1. This IP has the hostname of localhost mapped to it.



Thus, to log in as bob via SSH to the SSH server running on your own machine, you would use:



ssh bob@localhost


Like other network adapters, the loopback device shows up in the output of ifconfig. Its name is lo.



ek@Del:~$ ifconfig lo
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:50121 errors:0 dropped:0 overruns:0 frame:0
TX packets:50121 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4381349 (4.3 MB) TX bytes:4381349 (4.3 MB)


An Example: CUPS



One common, production (i.e., not just diagnostic) use of localhost on Ubuntu is to perform advanced printer configuration. In a web browser, go to:



http://localhost:631


CUPS runs a web server on port 631, and this can be used to configure printing, regardless of what GUI you are running (or even if you are not running a GUI at all).



Screenshot showing CUPS in a web browser



If you try connecting to http://127.0.0.1:631, this will work too. However, if you try to connect to http://127.0.0.2, it will not. All the 127.*.*.* addresses identify your computer on the loopback interface, but a server program can decide to bind just to a specific IP address.



A Notable Difference from Windows



If you come from a Windows background, you might expect loopback to itself be a synonym of localhost (and thus to be able to ping loopback, connect to servers on loopback, and so forth). That behavior is peculiar to Windows.




  • But you can add any name including loopback to your /etc/hosts file, with 127.0.0.1 as its address, and it will act like localhost.


Other Meanings of "Loopback"



The general concept of loopback is a mechanism through which a message or signal ends up (or loops) back to where it started.



So there are a few other ways loopback is use in Ubuntu that should not be confused with the loopback device in networking.



Loop Mounts



To mount a disk image in Ubuntu, you could run:



sudo mount -o loop image.iso /media/label


This is usually called a loop device (and not a loopback device), but the term loopback file interface is occasionally used.



This has nothing to do with the loopback device in networking.



Sound



Pulseaudio and other sound systems provide a mechanism to "connect" line-in to line-out, so that audio input is echoed back to your speakers/headphones. Pulseaudio's loopback module facilitates this.



Here, it is correct to use the term loopback, but like loop mounts, this also has nothing to do with the loopback device in networking. (And nothing to do with loop mounts, either.)



Further Reading





  • TLDP, "The Loopback Interface"

  • How is the loopback device implemented?






share|improve this answer





















  • 5





    Why does 127.0.0.0/8 map to 127.0.0.1 through 127.255.255.254 instead of 127.0.0.0 through 127.255.255.255? (Sorry if this is perceived as a highjack.)

    – JellicleCat
    Jun 25 '15 at 22:48






  • 3





    He mentioned only usable host addresses, and excluded network and broadcast addresses. You are correct in saying that it should be 127.0.0.0-127.255.255.255, but the first and last have other purposes.

    – Gabriel Samfira
    Jul 14 '15 at 14:32






  • 1





    @Eliah, Must localhost be pointing to 127.0.0.1? Or could it also point to another loopback address e.g. 127.0.0.2?

    – Pacerier
    Jan 21 '16 at 21:03











  • @GabrielSamfira, so why when I try to connect to those two IP addresses using SSH (e.g. by running ssh 127.0.0.0), it will say "Network is unreachable" instead of "Connection refused"?

    – MAChitgarha
    Aug 25 '18 at 11:20













  • @MAChitgarha The first IP address in a subnet is the network identification address, and the last IP address is the broadcast address. Neither of these can be assigned to a host by default. The broadcast address is used to address every host in a network, and the network address is used to ID the network itself. Please see: en.wikipedia.org/wiki/IP_address

    – Gabriel Samfira
    Aug 25 '18 at 14:47














164












164








164







The loopback device is a special, virtual network interface that your computer uses to communicate with itself. It is used mainly for diagnostics and troubleshooting, and to connect to servers running on the local machine.



The Purpose of Loopback



When a network interface is disconnected--for example, when an Ethernet port is unplugged or Wi-Fi is turned off or not associated with an access point--no communication on that interface is possible, not even communication between your computer and itself. The loopback interface does not represent any actual hardware, but exists so applications running on your computer can always connect to servers on the same machine.



This is important for troubleshooting (it can be compared to looking in a mirror). The loopback device is sometimes explained as purely a diagnostic tool. But it is also helpful when a server offering a resource you need is running on your own machine.



For example, if you run a web server, you have all your web documents and could examine them file by file. You may be able to load the files in your browser too, though with server-side active content, it won't work the way it does when someone accesses it normally.



So if you want to experience the same site others do, the best course is usually to connect to your own server. The loopback interface facilitates that.



Addresses on Loopback



For IPv4, the loopback interface is assigned all the IPs in the 127.0.0.0/8 address block. That is, 127.0.0.1 through 127.255.255.254 all represent your computer. For most purposes, though, it is only necessary to use one IP address, and that is 127.0.0.1. This IP has the hostname of localhost mapped to it.



Thus, to log in as bob via SSH to the SSH server running on your own machine, you would use:



ssh bob@localhost


Like other network adapters, the loopback device shows up in the output of ifconfig. Its name is lo.



ek@Del:~$ ifconfig lo
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:50121 errors:0 dropped:0 overruns:0 frame:0
TX packets:50121 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4381349 (4.3 MB) TX bytes:4381349 (4.3 MB)


An Example: CUPS



One common, production (i.e., not just diagnostic) use of localhost on Ubuntu is to perform advanced printer configuration. In a web browser, go to:



http://localhost:631


CUPS runs a web server on port 631, and this can be used to configure printing, regardless of what GUI you are running (or even if you are not running a GUI at all).



Screenshot showing CUPS in a web browser



If you try connecting to http://127.0.0.1:631, this will work too. However, if you try to connect to http://127.0.0.2, it will not. All the 127.*.*.* addresses identify your computer on the loopback interface, but a server program can decide to bind just to a specific IP address.



A Notable Difference from Windows



If you come from a Windows background, you might expect loopback to itself be a synonym of localhost (and thus to be able to ping loopback, connect to servers on loopback, and so forth). That behavior is peculiar to Windows.




  • But you can add any name including loopback to your /etc/hosts file, with 127.0.0.1 as its address, and it will act like localhost.


Other Meanings of "Loopback"



The general concept of loopback is a mechanism through which a message or signal ends up (or loops) back to where it started.



So there are a few other ways loopback is use in Ubuntu that should not be confused with the loopback device in networking.



Loop Mounts



To mount a disk image in Ubuntu, you could run:



sudo mount -o loop image.iso /media/label


This is usually called a loop device (and not a loopback device), but the term loopback file interface is occasionally used.



This has nothing to do with the loopback device in networking.



Sound



Pulseaudio and other sound systems provide a mechanism to "connect" line-in to line-out, so that audio input is echoed back to your speakers/headphones. Pulseaudio's loopback module facilitates this.



Here, it is correct to use the term loopback, but like loop mounts, this also has nothing to do with the loopback device in networking. (And nothing to do with loop mounts, either.)



Further Reading





  • TLDP, "The Loopback Interface"

  • How is the loopback device implemented?






share|improve this answer















The loopback device is a special, virtual network interface that your computer uses to communicate with itself. It is used mainly for diagnostics and troubleshooting, and to connect to servers running on the local machine.



The Purpose of Loopback



When a network interface is disconnected--for example, when an Ethernet port is unplugged or Wi-Fi is turned off or not associated with an access point--no communication on that interface is possible, not even communication between your computer and itself. The loopback interface does not represent any actual hardware, but exists so applications running on your computer can always connect to servers on the same machine.



This is important for troubleshooting (it can be compared to looking in a mirror). The loopback device is sometimes explained as purely a diagnostic tool. But it is also helpful when a server offering a resource you need is running on your own machine.



For example, if you run a web server, you have all your web documents and could examine them file by file. You may be able to load the files in your browser too, though with server-side active content, it won't work the way it does when someone accesses it normally.



So if you want to experience the same site others do, the best course is usually to connect to your own server. The loopback interface facilitates that.



Addresses on Loopback



For IPv4, the loopback interface is assigned all the IPs in the 127.0.0.0/8 address block. That is, 127.0.0.1 through 127.255.255.254 all represent your computer. For most purposes, though, it is only necessary to use one IP address, and that is 127.0.0.1. This IP has the hostname of localhost mapped to it.



Thus, to log in as bob via SSH to the SSH server running on your own machine, you would use:



ssh bob@localhost


Like other network adapters, the loopback device shows up in the output of ifconfig. Its name is lo.



ek@Del:~$ ifconfig lo
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:50121 errors:0 dropped:0 overruns:0 frame:0
TX packets:50121 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4381349 (4.3 MB) TX bytes:4381349 (4.3 MB)


An Example: CUPS



One common, production (i.e., not just diagnostic) use of localhost on Ubuntu is to perform advanced printer configuration. In a web browser, go to:



http://localhost:631


CUPS runs a web server on port 631, and this can be used to configure printing, regardless of what GUI you are running (or even if you are not running a GUI at all).



Screenshot showing CUPS in a web browser



If you try connecting to http://127.0.0.1:631, this will work too. However, if you try to connect to http://127.0.0.2, it will not. All the 127.*.*.* addresses identify your computer on the loopback interface, but a server program can decide to bind just to a specific IP address.



A Notable Difference from Windows



If you come from a Windows background, you might expect loopback to itself be a synonym of localhost (and thus to be able to ping loopback, connect to servers on loopback, and so forth). That behavior is peculiar to Windows.




  • But you can add any name including loopback to your /etc/hosts file, with 127.0.0.1 as its address, and it will act like localhost.


Other Meanings of "Loopback"



The general concept of loopback is a mechanism through which a message or signal ends up (or loops) back to where it started.



So there are a few other ways loopback is use in Ubuntu that should not be confused with the loopback device in networking.



Loop Mounts



To mount a disk image in Ubuntu, you could run:



sudo mount -o loop image.iso /media/label


This is usually called a loop device (and not a loopback device), but the term loopback file interface is occasionally used.



This has nothing to do with the loopback device in networking.



Sound



Pulseaudio and other sound systems provide a mechanism to "connect" line-in to line-out, so that audio input is echoed back to your speakers/headphones. Pulseaudio's loopback module facilitates this.



Here, it is correct to use the term loopback, but like loop mounts, this also has nothing to do with the loopback device in networking. (And nothing to do with loop mounts, either.)



Further Reading





  • TLDP, "The Loopback Interface"

  • How is the loopback device implemented?







share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 13 '17 at 12:23









Community

1




1










answered Jan 25 '13 at 20:58









Eliah KaganEliah Kagan

82.4k22227368




82.4k22227368








  • 5





    Why does 127.0.0.0/8 map to 127.0.0.1 through 127.255.255.254 instead of 127.0.0.0 through 127.255.255.255? (Sorry if this is perceived as a highjack.)

    – JellicleCat
    Jun 25 '15 at 22:48






  • 3





    He mentioned only usable host addresses, and excluded network and broadcast addresses. You are correct in saying that it should be 127.0.0.0-127.255.255.255, but the first and last have other purposes.

    – Gabriel Samfira
    Jul 14 '15 at 14:32






  • 1





    @Eliah, Must localhost be pointing to 127.0.0.1? Or could it also point to another loopback address e.g. 127.0.0.2?

    – Pacerier
    Jan 21 '16 at 21:03











  • @GabrielSamfira, so why when I try to connect to those two IP addresses using SSH (e.g. by running ssh 127.0.0.0), it will say "Network is unreachable" instead of "Connection refused"?

    – MAChitgarha
    Aug 25 '18 at 11:20













  • @MAChitgarha The first IP address in a subnet is the network identification address, and the last IP address is the broadcast address. Neither of these can be assigned to a host by default. The broadcast address is used to address every host in a network, and the network address is used to ID the network itself. Please see: en.wikipedia.org/wiki/IP_address

    – Gabriel Samfira
    Aug 25 '18 at 14:47














  • 5





    Why does 127.0.0.0/8 map to 127.0.0.1 through 127.255.255.254 instead of 127.0.0.0 through 127.255.255.255? (Sorry if this is perceived as a highjack.)

    – JellicleCat
    Jun 25 '15 at 22:48






  • 3





    He mentioned only usable host addresses, and excluded network and broadcast addresses. You are correct in saying that it should be 127.0.0.0-127.255.255.255, but the first and last have other purposes.

    – Gabriel Samfira
    Jul 14 '15 at 14:32






  • 1





    @Eliah, Must localhost be pointing to 127.0.0.1? Or could it also point to another loopback address e.g. 127.0.0.2?

    – Pacerier
    Jan 21 '16 at 21:03











  • @GabrielSamfira, so why when I try to connect to those two IP addresses using SSH (e.g. by running ssh 127.0.0.0), it will say "Network is unreachable" instead of "Connection refused"?

    – MAChitgarha
    Aug 25 '18 at 11:20













  • @MAChitgarha The first IP address in a subnet is the network identification address, and the last IP address is the broadcast address. Neither of these can be assigned to a host by default. The broadcast address is used to address every host in a network, and the network address is used to ID the network itself. Please see: en.wikipedia.org/wiki/IP_address

    – Gabriel Samfira
    Aug 25 '18 at 14:47








5




5





Why does 127.0.0.0/8 map to 127.0.0.1 through 127.255.255.254 instead of 127.0.0.0 through 127.255.255.255? (Sorry if this is perceived as a highjack.)

– JellicleCat
Jun 25 '15 at 22:48





Why does 127.0.0.0/8 map to 127.0.0.1 through 127.255.255.254 instead of 127.0.0.0 through 127.255.255.255? (Sorry if this is perceived as a highjack.)

– JellicleCat
Jun 25 '15 at 22:48




3




3





He mentioned only usable host addresses, and excluded network and broadcast addresses. You are correct in saying that it should be 127.0.0.0-127.255.255.255, but the first and last have other purposes.

– Gabriel Samfira
Jul 14 '15 at 14:32





He mentioned only usable host addresses, and excluded network and broadcast addresses. You are correct in saying that it should be 127.0.0.0-127.255.255.255, but the first and last have other purposes.

– Gabriel Samfira
Jul 14 '15 at 14:32




1




1





@Eliah, Must localhost be pointing to 127.0.0.1? Or could it also point to another loopback address e.g. 127.0.0.2?

– Pacerier
Jan 21 '16 at 21:03





@Eliah, Must localhost be pointing to 127.0.0.1? Or could it also point to another loopback address e.g. 127.0.0.2?

– Pacerier
Jan 21 '16 at 21:03













@GabrielSamfira, so why when I try to connect to those two IP addresses using SSH (e.g. by running ssh 127.0.0.0), it will say "Network is unreachable" instead of "Connection refused"?

– MAChitgarha
Aug 25 '18 at 11:20







@GabrielSamfira, so why when I try to connect to those two IP addresses using SSH (e.g. by running ssh 127.0.0.0), it will say "Network is unreachable" instead of "Connection refused"?

– MAChitgarha
Aug 25 '18 at 11:20















@MAChitgarha The first IP address in a subnet is the network identification address, and the last IP address is the broadcast address. Neither of these can be assigned to a host by default. The broadcast address is used to address every host in a network, and the network address is used to ID the network itself. Please see: en.wikipedia.org/wiki/IP_address

– Gabriel Samfira
Aug 25 '18 at 14:47





@MAChitgarha The first IP address in a subnet is the network identification address, and the last IP address is the broadcast address. Neither of these can be assigned to a host by default. The broadcast address is used to address every host in a network, and the network address is used to ID the network itself. Please see: en.wikipedia.org/wiki/IP_address

– Gabriel Samfira
Aug 25 '18 at 14:47


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • 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%2faskubuntu.com%2fquestions%2f247625%2fwhat-is-the-loopback-device-and-how-do-i-use-it%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







Popular posts from this blog

flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

Mangá

Eduardo VII do Reino Unido