Re: How to configure a DHCP + (2nd) Static address (eg on eth0+eth0:0)?



On Wed, 2015-09-30 at 06:26 +0300, Andrei Borzenkov wrote:
29.09.2015 20:54, Dan Williams пишет:

Basically I want to automate NM doing, effectively:

   ifconfig eth0:0 192.168.x.y

Don't do this with interface aliases; the kernel is perfectly capable of
using more than one address on the same interface.  Simply do:

ip addr add 192.168.x.y/24 dev eth0

and magically you'll have two.



This makes addresses invisible in ifconfig output and that may confuse 
legacy software (I know about at least one such case). Adding "label 
xxx" will emulate legacy aliases enough to make them appear as "normal" 
interface.

Yes, that is a downside.  However, the kernel functionality underlying
this, address labels, is only for tricking ifconfig.  The alias
interfaces are not normal interfaces and changes made to them affect all
other alias interfaces.  No other tools present this view of the world,
and the upstream kernel is only keeping this functionality for backwards
compatibility.

Dan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]