ifcfg-ethX voodoo for a second IP on the same interface

Tommy Pham tommyhp2 at gmail.com
Sat Apr 21 04:04:00 UTC 2012


On Fri, Apr 20, 2012 at 8:20 PM, Sam Varshavchik <mrsam at courier-mta.com> wrote:
> For testing purposes I need to add a second IP address to eth0.
>
> eth0 is managed by NetworkManager, and uses dhcp.
>
> I know that if I get rid of NetworkManager and put static IP addresses in
> ifcfg-eth0, I can also sprinkle some magic dust into ifcfg-eth0:1, and have
> the second IP address come up together with the first one.
>
> This does not seem to work with a NetworkManager-managed DHCP-based
> interface.
>
> Basically, is there some voodoo I can throw in a file somewhere that would
> perform the equivalent of:
>
> ip addr add 192.168.0.5 dev eth0 label eth0:1
>
> when eth0 comes up via DHCP, by NetworkManager?
>
>

How about:

#file ifcfg-eth0
#UUID
#HWADDR
#device
ONBOOT=yes
BOOTPROTO=dhcp
NM_CONTROLLED=yes

#file ifcfg-eth0:1
#UUID
#HWADDR
#device
ONBOOT=yes
BOOTPROTO=none
NM_CONTROLLED=no
# static IP settings...


More information about the users mailing list