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



On Fri, Apr 20, 2012 at 9:34 PM, Ed Greshko <Ed.Greshko@xxxxxxxxxxx> wrote:
On 04/21/2012 11:20 AM, Sam Varshavchik 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?


Well.....  I think you can only do this with static IP addresses....

But, all you have to do is modify /etc/sysconfig/network-scripts/ifcfg-whatever  to have

IPADDR0=192.168.0.225
IPADDR1=192.168.0.226

for example....

Then you'd see...

2: p2p1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
   link/ether 08:00:27:36:bf:b0 brd ff:ff:ff:ff:ff:ff
   inet 192.168.0.225/24 brd 192.168.0.255 scope global p2p1
   inet 192.168.0.226/24 brd 192.168.0.255 scope global secondary p2p1
   inet6 fe80::a00:27ff:fe36:bfb0/64 scope link
      valid_lft forever preferred_lft foreve



--
Never be afraid to laugh at yourself, after all, you could be missing out on the joke
of the century. -- Dame Edna Everage

Then the documentation [1] is either wrong or did I completely read it wrong?


[1] http://docs.fedoraproject.org/en-US/Fedora/16/html/System_Administrators_Guide/s2-networkscripts-interfaces-alias.html
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


Relevant Pages

  • RE: Multiple IPs to a single NIC
    ... NM_CONTROLLED=no (NetworkManager is mostly conflicting) ... Multiple IPs to a single NIC ... but brings down eth0. ...
    (RedHat)
  • ifcfg-ethX voodoo for a second IP on the same interface
    ... For testing purposes I need to add a second IP address to eth0. ... 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. ...
    (Fedora)
  • Re: ifcfg-ethX voodoo for a second IP on the same interface
    ... eth0 is managed by NetworkManager, and uses dhcp. ... valid_lft forever preferred_lft foreve ...
    (Fedora)
  • Re: NetworkManager Problem
    ... I by accident loaded NM on this computer which has only one source of the Internet from eth0. ... Jul 5 08:17:45 localhost NetworkManager: nm_signal_handler: Caught signal 15, ...
    (Fedora)
  • Re: Intermittent internet since upgrading to squeeze
    ... I'm using dhcp. ... I don't know if I'm using networkmanager. ... iface eth0 inet dhcp ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)