1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Adding additional IP in centos 6.9

Discussion in 'Site & Server Administration' started by jhashan, Aug 30, 2017.

  1. #1
    Recently I bought a VPS from OVH with 16 additional IP address but cant add those IP in my server.

    I read that I will need to add ifcfg-eth0:0 file under /etc/sysconfig/network-scripts and put
    DEVICE="eth0:0"
    BOOTPROTO=static
    IPADDR="xxx.xxx.xxx.xxx"
    NETMASK="255.255.255.255"
    BROADCAST="xxx.xxx.xxx.xxx"
    ONBOOT=yes

    So I did it and run "ifup eth0:0" but I got error, full output like this
    ipcalc: bad IPv4 address: 142.44.xxx.xx
    ipcalc: bad IPv4 address: 142.44.xxx.xx
    ipcalc: bad IPv4 address: 142.44.xxx.xx
    is already in use for device eth0...96
    /".or: an inet prefix is expected rather than "142.44.xxx.xx
    .for eth0:0g address 142.44.xxx.xx
    bind: Cannot assign requested address

    When I restart network I am getting this error "error in ifcfg-eth0:0: invalid alias number"

    Can anyone tell me where I am doing wrong?

    FYI: my primary IP is 149.56.xxx.xx and all 16 additional IP is 142.44.xxx.xx
     
    jhashan, Aug 30, 2017 IP
  2. BenZ-AMS

    BenZ-AMS Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    21
    #2
    Are the additional IPs using the same gateway? Strange that they would be completely different Class A IP addresses that use the same gateway.

    You would also need to know the netmask for the IP range that has been assigned to you
     
    BenZ-AMS, Aug 30, 2017 IP
  3. jhashan

    jhashan Well-Known Member

    Messages:
    246
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    108
    #3
    well I am just following there docs but not getting any result
    http://docs.ovh.ca/en/guides-network-ipaliasing.html#redhat-7-2-centos-fedora
     
    jhashan, Aug 30, 2017 IP
  4. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #4
    Your netmask is probably NOT 255.255.255.255 - that is the first thing. And as @BenZ-AMS says, it's weird that you have one external IP in one range, and all the others in a completely different range - normally they would all be in the same range, and you would buy a set of them, so you could set up a separate subnet for those addresses. For a 16-address one, that would be /28, or 255.255.255.240 as netmask. I think your config isn't matching up with what you want to do.
     
    PoPSiCLe, Aug 30, 2017 IP
  5. BenZ-AMS

    BenZ-AMS Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    21
    #5
    Do you have a second ethernet interface on the server? Perhaps the other IPs are suppose to be running through that Ethernet interface?

    Typically when you get additional IP addresses they will come listed with:

    IP Range:
    Netmask:
    Broadcast:
    Gateway:
     
    BenZ-AMS, Aug 31, 2017 IP