LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-28-2014, 09:53 AM   #1
rsousa05004
LQ Newbie
 
Registered: Jul 2014
Posts: 1

Rep: Reputation: Disabled
How to create two loopback interfaces


Hello everybody,

Id like to ask you how to create two loopback interfaces (like the 127.0.0.0) for local communications between applications. It would be important if they dont disappear when the pc is rebooted.

Many thanks for your help

All the best

Ricardo Sousa
 
Old 07-28-2014, 10:03 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,688

Rep: Reputation: 725Reputation: 725Reputation: 725Reputation: 725Reputation: 725Reputation: 725Reputation: 725
Most distros of Linux require interface lo in order to come up. Since the loopback interface returns all packets to the sender, you can't use it for communications.

Code:
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:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
Maybe what you want is a named pipe.
 
Old 07-28-2014, 10:17 AM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,396

Rep: Reputation: 2017Reputation: 2017Reputation: 2017Reputation: 2017Reputation: 2017Reputation: 2017Reputation: 2017Reputation: 2017Reputation: 2017Reputation: 2017Reputation: 2017
Quote:
Originally Posted by smallpond View Post
Most distros of Linux require interface lo in order to come up. Since the loopback interface returns all packets to the sender, you can't use it for communications.
Sure you can, I'm not sure why you're saying this would be a problem? I use 127.0.0.1 to communicate between networked processes on the same machine all the time.

What I'm curious about is why the OP needs two of them. All you need is one interface and a port number to open up a TCP connection. If you have two processes running, then use two different ports.
 
Old 07-28-2014, 03:28 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,859

Rep: Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301Reputation: 2301
There may be a few ways to go. At first I'd think a hosts file entry. Never tried it.

You can easily create private IP addresses on almost all newer nic's so that you'd have it with the normal IP and an alias.

VM's use a virtual network and I guess one might set up something like that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to configure multiple loopback interfaces (lo0, lo1, lo2...) arkin Linux - General 6 02-20-2009 01:12 AM
Question about Destination 127.0.0.0/8 Packets Sent to Non-loopback Interfaces blackhole54 Linux - Networking 2 12-15-2008 10:59 PM
routing b/w two tap interfaces connected to bridge w/o using loopback interface jesus_diehard Linux - Networking 0 08-18-2007 03:15 AM
[SOLVED] Debian multiple Loopback interfaces ? ionreflex Linux - Networking 1 10-02-2005 10:48 AM
multiple loopback interfaces arkin Linux - Networking 1 11-18-2003 04:22 PM


All times are GMT -5. The time now is 01:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration