Home » Home » HOW TO: configure Loopback Interface in Linux & Windows?

A Loopback interface is a virtual interface which is not connected to any device. Loopback interfaces are very useful because they will never go down, unless the entire system goes down. Loopback interface really helps in learning communication between the host and the guest Operating System and also it helps in understanding the complex real labs of network structures using network simulator GNS3.

HOW TO: Configure Loopback Interface in Linux?

Entering “ifconfig” in the terminal without specifying any options will provide a fairly complete description of the current state of all active network interfaces.

ifconfig

Executing the following commands in terminal will install User-mode Linux utility “uml-utilities”, it gives a kind of virtual environment, which runs Linux as a user process under another Linux kernel. This package has a bundle of userspace utilities for User-mode Linux, including uml_mconsole, uml_moo, uml_switch, uml_net and tunctl.

$ sudo apt-get install uml-utilities

$ modprobe tun

$ tunctl

$ ifconfig tap0 172.16.1.1 netmask 255.255.255.0 up

$ ifconfig

The above commands will create a  loopback interface “tap0” which includes IP address 172.16.1.1 with netmask 255.255.255.0.

tap0

$ ifconfig tap1 192.168.1.1 netmask 255.255.255.0 up

$ ifconfig

To create multiple interfaces you can rename tap0 as tap1, tap2, tap3.. with your needed IP and netmask.

HOW TO : Configure Loopback interface in Windows?

To create Loopback interface in Windows machine launch Run command as administrator and enter hdwwiz.exe to start Add Hardware Wizard,

hdwwiz

window_1

Click the Next button to continue.

Select the “Instal the hardware that I manually select from a list (Advanced)” and click the Next button to continue.window_2

Scroll down to select Network adapters and then click the Next button.

window_3

In Select Network Adapter form select Microsoft for the Manufacturer and then select Microsoft Loopback Adapter for the Network Adapter and click the Next button to continue.

window_4

Then Confirmation screen will appear, just click Next button to install Microsoft Loopback Adapter and once the installation completed click the finish button to exit the Add Hardware Wizard.

Now the creation of Loopback Adapter is done successfully, The final process is to configure the loopback interface. To perform that in Control Panel open the Network and Sharing Center and click the Change adapter settings in left side panel.

chnage_adapter

Now you should get a window with list of network connections icon, select Local Area Connection with the type of Microsoft Loopback Adapter then right click the adapter to select Properties.

localare_conn

On the Properties box select Internet Protocol Version 4 (TCP/IPv4) and click the Properties button.

loopback

In Internet Protocol Version 4 (TCP/IPv4) Properties page enter IP information for an IP address in one of the private address space (10.x.x.x , 172.16.x.x or 192.168.x.x). The IP should not be the same address range as your work or home network settings.

Ipaddress_windows

Once the Ip addressing is done click OK button to continue. You will be taken back to the Properties page for the Local Area Connection,  then click the Close button to finalize the changes.

The last thing we need to do to complete this is to add an entry to the hosts file. The hosts file in Windows can be located in C:WindowsSystem32driversetc directory.

To open host file with admin privilege using command prompt, enter the following command

cmd for host

Include a line at the bottom that should specify the IP address you added for the Loopback Adapter along with the name of the machine.

host change

Once you are done, save and exit the notepad. Now you should able to ping the loopback address successfully.

Hope you enjoyed the article, feel free to leave your commands and do share :)

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA Image

*