dazz100
Posts: 37
Joined: Mon Apr 17, 2017 4:54 am

What are the side effects of multiple IP addresses on one port???

Thu Oct 03, 2019 8:49 am

Hi

I have figured out that I can add multiple IP addresses to the eth0 port using the command:

Code: Select all

ip address add 192.168.1.69/24 dev eth0 
and delete with

Code: Select all

ip address del 192.168.1.69/24 dev eth0 
I have confirmed this works on Buster.


I am concerned that the side effect of adding multiple IP addresses to a single port is the risk of generating multiple packets from the port.
If I have two IP addresses on one port, does that cause two packets to be generated for each packet to be transmitted from eth0?
How would I measure this?

Dazz

User avatar
topguy
Posts: 5894
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: What are the side effects of multiple IP addresses on one port???

Thu Oct 03, 2019 9:06 am

Is the other ip-address also on the same 192.168.1.x sub-net address ?
If I have two IP addresses on one port, does that cause two packets to be generated for each packet to be transmitted from eth0?
No usually not.
When any program opens a local socket to talk to a socket on a different computer, you bind that socket to only one IP/port combination.

Linux doesnt really much care which physical device this IP-address is connected to ( eth0, wan0, wlan0, ppp0 ).
So programs that choose to send out broadcast packets on all IP addresses will generate double the traffic, but if they need to reach machines on different sub-nets that is necessary.

User avatar
B.Goode
Posts: 8865
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: What are the side effects of multiple IP addresses on one port???

Thu Oct 03, 2019 9:12 am

dazz100 wrote:
Thu Oct 03, 2019 8:49 am
Hi

I have figured out that I can add multiple IP addresses to the eth0 port using the command:

Code: Select all

ip address add 192.168.1.69/24 dev eth0 
and delete with

Code: Select all

ip address del 192.168.1.69/24 dev eth0 
I have confirmed this works on Buster.


I am concerned that the side effect of adding multiple IP addresses to a single port is the risk of generating multiple packets from the port.
If I have two IP addresses on one port, does that cause two packets to be generated for each packet to be transmitted from eth0?
How would I measure this?

Dazz

port is an unfortunate choice of vocabulary, since that word has a specific meaning in the context of the IP network protocols. 'interface' would be clearer.


Using IP, data packets are generated for a duple of ip_ address and ip_port, and are passed to an appropriate network interface for transmission. So no, this will not of itself generate duplicates.


To measure for yourself, look at tools like tcpdump or wireshark.


Edit: unintended echo of what @topguy said as I was typing this. Left to show we are on the same wavelength - pun intended!

epoch1970
Posts: 3794
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: What are the side effects of multiple IP addresses on one port???

Thu Oct 03, 2019 10:37 am

In other words, no side-effect.
Only the normal effects of having an IP address on a network.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “Raspbian”