Addtional ip address for centos

Discussion in 'Installation/Configuration' started by sfimedia, Oct 28, 2009.

  1. sfimedia

    sfimedia New Member

    I have a additional ip address which I purchased. I have gone into your how to setup additional ip address. Only to fine the file I have is using dhcp not static.

    DEVICE=eth0
    BOOTPROTO=dhcp
    TYPE=Etherne
    ONBOOT=yes

    When I set up the second IP address if I copy this file wont it get confused? Do I need to configure the primary ip address as static first and then the secondary or will this just screw things up? Or just setup the secondary as static leaving this first as is?

    Steve
     
  2. matey

    matey New Member

    sorry I dont know centos but in ubuntu there is a file in;
    /etc/network/interfaces
    which you can edit and configure your NICs to either have static or dynamic IP.
    for dynamic IP using DHCP it goes like this:
    (the lo is for local loop back i.e (127.0.0.1))

    auto lo
    iface lo inet loopback
    auto eth0
    iface eth0 inet dhcp

    #the eth0 is the first NIC(if you have more than one)
    And for static IP we do this:
    (eth1 is the second NIC because you cannot configure the same Network Card with 2 different settings (i.e stati and dynamic) I think if you do it will take the last configuration.
    so:

    auto eth1
    iface eth1 inet static
    address 10.0.52.110
    netmask 255.255.255.0
    network 10.0.52.0
    broadcast 10.0.52.255
    gateway 10.0.52.1

    Of course the IP address on the 1st line is the one you purchased along with the other info like netmask...

    So hopefully someone with CentOS experience will correct me in here.

    good luck!
     
  3. falko

    falko Super Moderator Howtoforge Staff

    I'd try to configure both addresses as static ones. Are the IPs from the same subnet?
     

Share This Page