Results 1 to 7 of 7
  1. #1

    CentOS 4 Adding a 2nd IP

    Heres the setup:

    BoxA has 123.123.123.123 as its main IP

    Request another IP allocation from provider, they grant it, how do I add 124.124.124.124 to the box (preferrably without a reboot required) so it is pingable/loadable etc?

    Thanks

  2. #2
    Join Date
    Dec 2002
    Location
    Chicago
    Posts
    375
    cd over to /etc/sysconfig/network-scripts

    make a file called ifcfg-eth0-range.0 containing:
    IPADDR_START=1.2.3.4
    IPADDR_END=1.2.3.6
    CLONENUM_START=0

    save, and restart networking, service network restart The file will create the aliases for you and it's pretty fast and easy.
    -DPI
    Chicago's #1 Datacenter Technician

  3. #3
    What if its not a range?
    Liek one IP is 12.12.13.148
    2nd IP is 12.12.13.154

    Dont have the rangers 149-153

    Thanks in advance

  4. #4
    Join Date
    Nov 2005
    Location
    Minneapolis, MN
    Posts
    1,646
    In the /etc/sysconfig/network-scripts directory

    cp ifcfg-eth0 ifcfg-eth0:1

    edit ifcfg-eth0:1, and remove "HWADDR" if present, and adjust the IP address settings to match the IP you want to add, add "ONPARENT=yes".

    Then just issue a:

    service network restart

    and you should be set.
    Last edited by spaethco; 02-19-2007 at 12:09 AM.
    Eric Spaeth
    Enterprise Network Engineer :: Hosting Hobbyist :: Master of Procrastination
    "The really cool thing about facts is they remain true regardless of who states them." -SpaethCo

  5. #5
    Its only accepting connections now on the second IP.... ?
    Last edited by -[OnTarget]-; 02-19-2007 at 12:11 AM.

  6. #6
    Join Date
    Nov 2005
    Location
    Minneapolis, MN
    Posts
    1,646
    Quote Originally Posted by -[OnTarget]-
    Its only accepting connections now on the second IP.... ?
    Is "ONPARENT=yes" listed in the eth0:1 config file?
    Eric Spaeth
    Enterprise Network Engineer :: Hosting Hobbyist :: Master of Procrastination
    "The really cool thing about facts is they remain true regardless of who states them." -SpaethCo

  7. #7
    Nervermind, forgot to add a :1 after eth0

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •