I need to used multiple loopback addresses (interfaces) for an server application that communicates with multiple clients running on the same machine. Since a loopback interface short circuits the network stack (looping back in the IP layer) it is a more efficient means of communication, hence better for my purpose.
How do I define multiple loopback interfaces?
BTW, I'm a newbie to this mailing mailing list. Hopefully this is an appropriate question?
---John
Am 29.08.2013 15:38, schrieb John Chludzinski:
I need to used multiple loopback addresses (interfaces) for an server application that communicates with multiple clients running on the same machine. Since a loopback interface short circuits the network stack (looping back in the IP layer) it is a more efficient means of communication, hence better for my purpose.
How do I define multiple loopback interfaces?
BTW, I'm a newbie to this mailing mailing list. Hopefully this is an appropriate question?
if you are running network.service it's trivial NetworkManager -> no ida, i do not touch it ___________________________________________
[root@rh:/etc/sysconfig/network-scripts]$ cat /etc/sysconfig/network-scripts/ifcfg-lo:1 DEVICE=lo:1 IPADDR=127.0.0.2 ONPARENT=yes
[root@rh:/etc/sysconfig/network-scripts]$ ifup lo:1
[root@rh:/etc/sysconfig/network-scripts]$ ifconfig lo:1 lo:1: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.2 netmask 255.0.0.0 loop txqueuelen 0 (Lokale Schleife)
[root@rh:/etc/sysconfig/network-scripts]$ ping 127.0.0.2 PING 127.0.0.2 (127.0.0.2) 56(84) bytes of data. 64 bytes from 127.0.0.2: icmp_seq=1 ttl=50 time=0.056 ms ___________________________________________
that's the "lo" config shipped with Fedora
[root@rh:/etc/sysconfig/network-scripts]$ cat /etc/sysconfig/network-scripts/ifcfg-lo DEVICE=lo IPADDR=127.0.0.1 NETMASK=255.0.0.0 NETWORK=127.0.0.0 # If you're having problems with gated making 127.0.0.0/8 a martian, # you can change this to something else (255.255.255.255, for example) BROADCAST=127.255.255.255 ONBOOT=yes NAME=loopback
BTW:
try to ping 127.0.0.1, 127.0.0.2, 127.0.0.3............
here they are pingable as default
the instruction below if only needed if the application checks that a configured IP exists via ifconfig or lookalike
Am 29.08.2013 15:46, schrieb Reindl Harald:
Am 29.08.2013 15:38, schrieb John Chludzinski:
I need to used multiple loopback addresses (interfaces) for an server application that communicates with multiple clients running on the same machine. Since a loopback interface short circuits the network stack (looping back in the IP layer) it is a more efficient means of communication, hence better for my purpose.
How do I define multiple loopback interfaces?
BTW, I'm a newbie to this mailing mailing list. Hopefully this is an appropriate question?
if you are running network.service it's trivial NetworkManager -> no ida, i do not touch it ___________________________________________
[root@rh:/etc/sysconfig/network-scripts]$ cat /etc/sysconfig/network-scripts/ifcfg-lo:1 DEVICE=lo:1 IPADDR=127.0.0.2 ONPARENT=yes
[root@rh:/etc/sysconfig/network-scripts]$ ifup lo:1
[root@rh:/etc/sysconfig/network-scripts]$ ifconfig lo:1 lo:1: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.2 netmask 255.0.0.0 loop txqueuelen 0 (Lokale Schleife)
[root@rh:/etc/sysconfig/network-scripts]$ ping 127.0.0.2 PING 127.0.0.2 (127.0.0.2) 56(84) bytes of data. 64 bytes from 127.0.0.2: icmp_seq=1 ttl=50 time=0.056 ms ___________________________________________
that's the "lo" config shipped with Fedora
[root@rh:/etc/sysconfig/network-scripts]$ cat /etc/sysconfig/network-scripts/ifcfg-lo DEVICE=lo IPADDR=127.0.0.1 NETMASK=255.0.0.0 NETWORK=127.0.0.0 # If you're having problems with gated making 127.0.0.0/8 a martian, # you can change this to something else (255.255.255.255, for example) BROADCAST=127.255.255.255 ONBOOT=yes NAME=loopback
Both 127.0.0.7 and 127.0.0.10 exist in /etc/hosts for the client apps to use when connecting to the server. The clients use both gethostbyname() and getservbyname() for connecting. Currently, there are *no* multiple loopback interfaces defined.
I wrote my own example TCP socket code to test the set up and found problems.
Without defining multiple loopback interfaces using 127.0.0.7 and 127.0.0.10, are 127.0.0.7 and 127.0.0.10 simply the same interface?
BTW, this is code I inherited.
---John
On Thu, Aug 29, 2013, at 06:49 AM, Reindl Harald wrote:
BTW:
try to ping 127.0.0.1, 127.0.0.2, 127.0.0.3............
here they are pingable as default
the instruction below if only needed if the application checks that a configured IP exists via ifconfig or lookalike
Am 29.08.2013 15:46, schrieb Reindl Harald:
Am 29.08.2013 15:38, schrieb John Chludzinski:
I need to used multiple loopback addresses (interfaces) for an server application that communicates with multiple clients running on the same machine. Since a loopback interface short circuits the network stack (looping back in the IP layer) it is a more efficient means of communication, hence better for my purpose.
How do I define multiple loopback interfaces?
BTW, I'm a newbie to this mailing mailing list. Hopefully this is an appropriate question?
if you are running network.service it's trivial NetworkManager -> no ida, i do not touch it ___________________________________________
[root@rh:/etc/sysconfig/network-scripts]$ cat /etc/sysconfig/network-scripts/ifcfg-lo:1 DEVICE=lo:1 IPADDR=127.0.0.2 ONPARENT=yes
[root@rh:/etc/sysconfig/network-scripts]$ ifup lo:1
[root@rh:/etc/sysconfig/network-scripts]$ ifconfig lo:1 lo:1: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.2 netmask 255.0.0.0 loop txqueuelen 0 (Lokale Schleife)
[root@rh:/etc/sysconfig/network-scripts]$ ping 127.0.0.2 PING 127.0.0.2 (127.0.0.2) 56(84) bytes of data. 64 bytes from 127.0.0.2: icmp_seq=1 ttl=50 time=0.056 ms ___________________________________________
that's the "lo" config shipped with Fedora
[root@rh:/etc/sysconfig/network-scripts]$ cat /etc/sysconfig/network-scripts/ifcfg-lo DEVICE=lo IPADDR=127.0.0.1 NETMASK=255.0.0.0 NETWORK=127.0.0.0 # If you're having problems with gated making 127.0.0.0/8 a martian, # you can change this to something else (255.255.255.255, for example) BROADCAST=127.255.255.255 ONBOOT=yes NAME=loopback
Email had 1 attachment:
- signature.asc 1k (application/pgp-signature)
On Thu, Aug 29, 2013 at 08:32:56AM -0700, John Chludzinski wrote:
Both 127.0.0.7 and 127.0.0.10 exist in /etc/hosts for the client apps to use when connecting to the server. The clients use both gethostbyname() and getservbyname() for connecting. Currently, there are *no* multiple loopback interfaces defined.
I wrote my own example TCP socket code to test the set up and found problems.
What problems?
Without defining multiple loopback interfaces using 127.0.0.7 and 127.0.0.10, are 127.0.0.7 and 127.0.0.10 simply the same interface?
Yes.
BTW, this is code I inherited.
---John
On Thu, Aug 29, 2013, at 06:49 AM, Reindl Harald wrote:
BTW:
try to ping 127.0.0.1, 127.0.0.2, 127.0.0.3............
here they are pingable as default
the instruction below if only needed if the application checks that a configured IP exists via ifconfig or lookalike
Am 29.08.2013 15:46, schrieb Reindl Harald:
Am 29.08.2013 15:38, schrieb John Chludzinski:
I need to used multiple loopback addresses (interfaces) for an server application that communicates with multiple clients running on the same machine. Since a loopback interface short circuits the network stack (looping back in the IP layer) it is a more efficient means of communication, hence better for my purpose.
How do I define multiple loopback interfaces?
BTW, I'm a newbie to this mailing mailing list. Hopefully this is an appropriate question?
if you are running network.service it's trivial NetworkManager -> no ida, i do not touch it ___________________________________________
[root@rh:/etc/sysconfig/network-scripts]$ cat /etc/sysconfig/network-scripts/ifcfg-lo:1 DEVICE=lo:1 IPADDR=127.0.0.2 ONPARENT=yes
[root@rh:/etc/sysconfig/network-scripts]$ ifup lo:1
[root@rh:/etc/sysconfig/network-scripts]$ ifconfig lo:1 lo:1: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.2 netmask 255.0.0.0 loop txqueuelen 0 (Lokale Schleife)
[root@rh:/etc/sysconfig/network-scripts]$ ping 127.0.0.2 PING 127.0.0.2 (127.0.0.2) 56(84) bytes of data. 64 bytes from 127.0.0.2: icmp_seq=1 ttl=50 time=0.056 ms ___________________________________________
that's the "lo" config shipped with Fedora
[root@rh:/etc/sysconfig/network-scripts]$ cat /etc/sysconfig/network-scripts/ifcfg-lo DEVICE=lo IPADDR=127.0.0.1 NETMASK=255.0.0.0 NETWORK=127.0.0.0 # If you're having problems with gated making 127.0.0.0/8 a martian, # you can change this to something else (255.255.255.255, for example)
Alternatively you can set /proc/net/ipv4/conf/l0/route_localnet to true
On Thu, 2013-08-29 at 15:46 +0200, Reindl Harald wrote:
Am 29.08.2013 15:38, schrieb John Chludzinski:
I need to used multiple loopback addresses (interfaces) for an server application that communicates with multiple clients running on the same machine. Since a loopback interface short circuits the network stack (looping back in the IP layer) it is a more efficient means of communication, hence better for my purpose.
How do I define multiple loopback interfaces?
BTW, I'm a newbie to this mailing mailing list. Hopefully this is an appropriate question?
if you are running network.service it's trivial NetworkManager -> no ida, i do not touch it
NM does nothing with lo, so the same procedure below would certainly apply if you're running NM. Touch lo all you want.
Dan
[root@rh:/etc/sysconfig/network-scripts]$ cat /etc/sysconfig/network-scripts/ifcfg-lo:1 DEVICE=lo:1 IPADDR=127.0.0.2 ONPARENT=yes
[root@rh:/etc/sysconfig/network-scripts]$ ifup lo:1
[root@rh:/etc/sysconfig/network-scripts]$ ifconfig lo:1 lo:1: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.2 netmask 255.0.0.0 loop txqueuelen 0 (Lokale Schleife)
[root@rh:/etc/sysconfig/network-scripts]$ ping 127.0.0.2 PING 127.0.0.2 (127.0.0.2) 56(84) bytes of data. 64 bytes from 127.0.0.2: icmp_seq=1 ttl=50 time=0.056 ms ___________________________________________
that's the "lo" config shipped with Fedora
[root@rh:/etc/sysconfig/network-scripts]$ cat /etc/sysconfig/network-scripts/ifcfg-lo DEVICE=lo IPADDR=127.0.0.1 NETMASK=255.0.0.0 NETWORK=127.0.0.0 # If you're having problems with gated making 127.0.0.0/8 a martian, # you can change this to something else (255.255.255.255, for example) BROADCAST=127.255.255.255 ONBOOT=yes NAME=loopback
El Jueves, 29 de agosto de 2013 06:38:00 John Chludzinski escribió:
I need to used multiple loopback addresses (interfaces) for an server application that communicates with multiple clients running on the same machine. Since a loopback interface short circuits the network stack (looping back in the IP layer) it is a more efficient means of communication, hence better for my purpose.
How do I define multiple loopback interfaces?
BTW, I'm a newbie to this mailing mailing list. Hopefully this is an appropriate question?
---John
In IPv4 you can get any IP in the 127.0.0.0/8 subnet for the lo interface.
What are you trying to do? binding more than one process to the same port number?
PS. It's probably better to use the fedora-users list for this kind of topics.
On Thu, Aug 29, 2013 at 9:47 AM, Juan Orti Alcaine juan.orti@miceliux.com wrote:
In IPv4 you can get any IP in the 127.0.0.0/8 subnet for the lo interface.
And in current fedora, they are already assigned to localhost. You can ping 127.0.0.22 if you want.
AIUI, you can bind to it freely, too.
m
devel@lists.stg.fedoraproject.org