Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How to add a new IP (/32 block) to a server
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How to add a new IP (/32 block) to a server

Recently I've ordered a new IP for my dedi box from my provider. After receiving it, I've added it to /etc/sysconfing/network-scripts as eth0:1

But even after restarting my network interface, I cant ping it from outside (Pingable from inside of the box)

Here is my eth0:1 config file content

DEVICE=eth0 :1
BOOTPROTO=none
ONBOOT=yes
NETWORK=a.b.c.d
NETMASK=255.255.255.255
IPADDR=a.b.c.d

What could possibly goes wrong here.
(OS - CentOS 6)

(Sorry for my bad english)

Comments

  • Install debian save 3 hours on average

  • edited May 2015

    TinyTunnel_Tom said: Install debian save 3 hours on average

    The problem is, it needs cPanel. So no debian for me.

  • Are you sure it's a /32 block instead of a single IP from a larger block (say /26)?

    Try adding broadcast and gateway values and try again.

  • Awmusic12635Awmusic12635 Member, Host Rep

    @sdglhm said:

    If you are using cPanel it can add the IPs for you if you give it the information

  • PetaByet said: Are you sure it's a /32 block instead of a single IP from a larger block (say /26)?

    They've said it's /32. I've tried several times using same values and different values. But no luck

    Awmusic12635 said: If you are using cPanel it can add the IPs for you if you give it the information

    I've tried it. No luck

  • Awmusic12635Awmusic12635 Member, Host Rep

    @sdglhm said:
    I've tried it. No luck

    Then something must be wrong with the way you are entering it or with what you have been given.

    Have you tried pinging the gateway IP from inside your server?

  • edited May 2015

    Awmusic12635 said: Have you tried pinging the gateway IP from inside your server?

    Yes. I've tried. It can be pinged from inside. But cannot be pinged from outside.

    Here's how I added ip address

    Navigated to > Home »IP Functions »Add a New IP Address

    Entered new IP (199.2x.x.x) and marked subnet as 255.255.255.255

    Then click "submit" (I've rebuilt the IP address pool also)

  • KuJoeKuJoe Member, Host Rep

    ipconfig eth0 199.204.187.160/32 up

    This is what I use on my CentOS 6 servers and it works correctly. If it's not working for you then contact your data center for help.

  • Yes I can ping it using "ping 255.255.255.255 -b"

  • KuJoeKuJoe Member, Host Rep

    @sdglhm said:
    Yes I can ping it using "ping 255.255.255.255 -b"

    That's not a real IP (well it is, but not for you it isn't). Try to ping the gateway.

  • edited May 2015

    @Kuljoe -

    Here is the netstat -r output. It seems like everything is configured from the inside.

    Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 199.2x.x.x * 255.255.255.255 UH 0 0 0 eth0 199.2x.x.x * 255.255.255.255 UH 0 0 0 eth0 199.204.186.0 * 255.255.255.192 U 0 0 0 eth0 link-local * 255.255.0.0 U 0 0 0 eth0 default 199.2x.x.x 0.0.0.0 UG 0 0 0 eth0

    Here is the ping result

    ~ ping 199.2x.x.x PING 199.2x.x.x (199.2x.x.x) 56(84) bytes of data. 64 bytes from 199.2x.x.x: icmp_seq=1 ttl=64 time=0.066 ms 64 bytes from 199.2x.x.x: icmp_seq=2 ttl=64 time=0.015 ms

  • edited May 2015

    KuJoe said: ipconfig eth0 199.2x.x.x.x/32 up

    After adding this, my server connection did failed. (ifconfig eth0 x.x.x.x/32) I can't even ping my main IP address.

  • KuJoeKuJoe Member, Host Rep
    edited May 2015

    What did your provider say when you opened a ticket?

  • KuJoeKuJoe Member, Host Rep

    I just realized you said a /32, are you 100% sure your provider gave you a /32 and not a /30?

  • KuJoe said: What did your provider say when you opened a ticket?

    They've said they do not support Unmanaged dedicated servers. Tough luck

  • edited May 2015

    AFAIK, It's all set

    UnRouting 199.2x.x.x [ OK ] Shutting down eth0:cp1 [ OK ] Bringing up eth0:cp1 [ OK ] Routing 199.2x.x.x [ OK ]

    Still can't figure out what's wrong.

  • KuJoeKuJoe Member, Host Rep

    So it's working? Can you paste your ipconfig here for us so we can see what the problem was?

  • KuJoe said: So it's working? Can you paste your ipconfig here for us so we can see what the problem was?

    No it still not working. I've tried proxies and vpn's also. (I'm using OpenDNS) but still cant ping it from outside.

  • MikePTMikePT Moderator, Patron Provider, Veteran

    @Awmusic12635 said:
    If you are using cPanel it can add the IPs for you if you give it the information

    This. If this isn't working, then contact the DC.

  • MrGeneral said: This. If this isn't working, then contact the DC.

    I've opened them a ticket. Seems like something bit off with my IP. It should be working now.

    Thanked by 1MikePT
  • pechspilzpechspilz Member
    edited May 2015

    The reason why it doesn't work is because the additional /32 you've got is most likely not on the same network as your default gateway.

    Try something like this

    DEVICE="eth0:1" BOOTPROTO=static ONBOOT=yes TYPE="Ethernet" IPADDR=199.204.187.160 NETMASK=255.255.255.255 GATEWAY=199.204.186.62 NETWORK=199.204.186.0

    If this doesn't work, you probably have to use the route commands (or whatever they use in CentOS) to make sure the IP address knows its gateway.

  • What is the output of:

    1. ifconfig -a
    2. netstat -rn

    Probably best to PM me as publishing your IPs is one sure way to get attacked.

  • PetaByet said: Try adding broadcast and gateway values and try again.

    /32 is normal for individual IPs. No gateway should be set.

    KuJoe said: ipconfig eth0 199.204.187.160/32 up

    That will stop his networking working. It will dump the default route too.

  • MarkTurner said: That will stop his networking working.

    Yeah. It did. I had to login using iLO interface.

  • iptables was the culprit

  • MarkTurner said: iptables was the culprit

    Thank you @Mark for helping me out. Even after two flushes it was the problem all along.

    Thanked by 1MikePT
Sign In or Register to comment.