Howdy, Stranger!

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


OVH VPS Multi IP Configuration
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.

OVH VPS Multi IP Configuration

Chong83Chong83 Member
edited November 2016 in Help

Hi, Guy

i need help for OVH VPS Debian 8 add a 2nd IP, i am trying many time buy always fail and cannot connect to server again T_T i only know reinstall ^^

this is my ifconfig detail

eth0      Link encap:Ethernet  HWaddr fa:16:3e:e4:02:e5
          inet addr:144.217.XXX.28  Bcast:144.217.XXX.28  Mask:255.255.255.255
          inet6 addr: fe80::f816:3eff:fee4:2e5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:16013 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9874 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:21673164 (20.6 MiB)  TX bytes:735678 (718.4 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:9 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1008 (1008.0 B)  TX bytes:1008 (1008.0 B)

and this is my "/etc/network/interfaces"

 # The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 144.217.XXX.28
        netmask 255.255.255.255
        post-up /sbin/ip route add 144.217.XXX.1 dev eth0
        post-up /sbin/ip route add default via 144.217.XXX.1
        pre-down /sbin/ip route del default via 144.217.XXX.1
        pre-down /sbin/ip route del 144.217.XXX.1 dev eth0
        dns-nameserver 213.186.33.99
        dns-search vps.ovh.ca

netstat -rn

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         144.217.XXX.1    0.0.0.0         UG        0 0          0 eth0
144.217.XXX.1    0.0.0.0         255.255.255.255 UH        0 0          0 eth0

i need add this 2 IP into my VPS
198.100.XXX.61 & 198.100.XXX.62

Anybody Can Help ??

Comments

  • Make sure you've also assigned/generated a Virtual MAC for the IP. Otherwise I think they will shut you down in case you add an IP without "register" a MAC for it.

    That may be what is happening.

  • In /etc/network/interfaces :

    post-up /sbin/ifconfig eth0:0 198.100.XXX.61 netmask 255.255.255.255 broadcast 198.100.XXX.61
    post-down /sbin/ifconfig eth0:0 down
    post-up /sbin/ifconfig eth0:1 198.100.XXX.62 netmask 255.255.255.255 broadcast 198.100.XXX.62
    post-down /sbin/ifconfig eth0:1 down
    
  • Chong83Chong83 Member
    edited November 2016

    @nullnothere said:
    Make sure you've also assigned/generated a Virtual MAC for the IP. Otherwise I think they will shut you down in case you add an IP without "register" a MAC for it.

    That may be what is happening.

    thanks for your help bro,
    My Virtual Mac List is grey color can not click

    "please start by associating this IP to a server"

  • @elwebmaster said:
    In /etc/network/interfaces :

    > post-up /sbin/ifconfig eth0:0 198.100.XXX.61 netmask 255.255.255.255 broadcast 198.100.XXX.61
    > post-down /sbin/ifconfig eth0:0 down
    > post-up /sbin/ifconfig eth0:1 198.100.XXX.62 netmask 255.255.255.255 broadcast 198.100.XXX.62
    > post-down /sbin/ifconfig eth0:1 down
    > 

    thanks for your help bro,
    you mean like this ?

    auto eth0
    iface eth0 inet static
            address 144.217.XXX.28
            netmask 255.255.255.255
            post-up /sbin/ip route add 144.217.XXX.1 dev eth0
            post-up /sbin/ip route add default via 144.217.XXX.1
            pre-down /sbin/ip route del default via 144.217.XXX.1
            pre-down /sbin/ip route del 144.217.XXX.1 dev eth0
            dns-nameserver 213.186.33.99
            dns-search vps.ovh.ca
            post-up /sbin/ifconfig eth0:0 198.100.XXX.61 netmask 255.255.255.255 broadcast 198.100.XXX.61
            post-down /sbin/ifconfig eth0:0 down
            post-up /sbin/ifconfig eth0:1 198.100.XXX.62 netmask 255.255.255.255 broadcast 198.100.XXX.62
            post-down /sbin/ifconfig eth0:1 down
    
  • @Chong83 said:

    @elwebmaster said:
    In /etc/network/interfaces :

    > > post-up /sbin/ifconfig eth0:0 198.100.XXX.61 netmask 255.255.255.255 broadcast 198.100.XXX.61
    > > post-down /sbin/ifconfig eth0:0 down
    > > post-up /sbin/ifconfig eth0:1 198.100.XXX.62 netmask 255.255.255.255 broadcast 198.100.XXX.62
    > > post-down /sbin/ifconfig eth0:1 down
    > > 

    thanks for your help bro,
    you mean like this ?

    auto eth0
    iface eth0 inet static
            address 144.217.XXX.28
            netmask 255.255.255.255
            post-up /sbin/ip route add 144.217.XXX.1 dev eth0
            post-up /sbin/ip route add default via 144.217.XXX.1
            pre-down /sbin/ip route del default via 144.217.XXX.1
            pre-down /sbin/ip route del 144.217.XXX.1 dev eth0
            dns-nameserver 213.186.33.99
            dns-search vps.ovh.ca
            post-up /sbin/ifconfig eth0:0 198.100.XXX.61 netmask 255.255.255.255 broadcast 198.100.XXX.61
            post-down /sbin/ifconfig eth0:0 down
            post-up /sbin/ifconfig eth0:1 198.100.XXX.62 netmask 255.255.255.255 broadcast 198.100.XXX.62
            post-down /sbin/ifconfig eth0:1 down
    

    Yes, then run /etc/init.d/networking restart .

    Thanked by 1Chong83
  • thanks elwebmaster,
    after /etc/init.d/networking restart
    i can ping from VPS local now, but i cannot ping the new IP from WAN

  • @Chong83 said:
    thanks elwebmaster,
    after /etc/init.d/networking restart
    i can ping from VPS local now, but i cannot ping the new IP from WAN

    Are you sure the IPs are assigned to your server in the control panel? Double check to make sure you copied them correctly. I don't know, these instructions worked for GRV, BHS may be different...

  • @Chong83 said:

    "please start by associating this IP to a server"

    I think they do give you the answer, do they?

  • This is my trouble T_T

  • See: http://help.ovh.com/DedieMac and help.ovh.ie/IpAlias

    It looks like you're using a VPS and not a Dedi. So I'm not sure if the Virtual MAC rule applies at all or how it works.

    Hopefully someone else can help with the specifics for the VPS in case the above guides don't help resolve the matter.

    Good Luck!

  • JabJabJabJab Member
    edited November 2016

    Last time I did it I just added the new IPs to /etc/network/interfaces as subinterfaces

    auto eth0:0

    allow-hotplug eth0:0

    iface eth0:0 inet static

    address 151.80.XX.X

    netmask 255.255.255.255

    auto eth0:1

    allow-hotplug eth0:1

    iface eth0:1 inet static

    address 94.23.XX.X

    netmask 255.255.255.255

    then /etc/init.d/networking restart and everything works.

  • depending on how new the IPs are, it may take some time, till they are fully routed to your VPS from OVh's end.

    instead of using eth0:1 and such you may simply use

    up ip addr add 198.X.X.62/32 dev eth0

    in your config.

  • Thanks for sharing this great info with us.

  • VinnyletjeVinnyletje Member
    edited November 2016

    askubuntu.com/revisions/547300/2

    This answer helped me. Apparently using the old method like eth0:0, eth0:1 is well old...
    The new method is using iproute2. Use the /32 netmask instead of the /24 like the answer says.

    Here is full documentation about it. Its replacing ifconfig, arp, route, etc.
    baturin.org/docs/iproute2/

  • i just reinstall my VPS
    now my 1st step is

    # up ip addr add 198.100.XXX.61/32 dev eth0
    # up ip addr add 198.100.XXX.62/32 dev eth0
    

    2nd step

    ip address show eth0

    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether fa:16:3e:9c:00:90 brd ff:ff:ff:ff:ff:ff
        inet 144.217.XXX.28/32 brd 144.217.84.28 scope global eth0
           valid_lft forever preferred_lft forever
        inet 198.100.XXX.61/32 scope global eth0
           valid_lft forever preferred_lft forever
        inet 198.100.XXX.62/32 scope global eth0
           valid_lft forever preferred_lft forever
        inet6 fe80::f816:3eff:fe9c:90/64 scope link
           valid_lft forever preferred_lft forever
    

    i can ping from local VPS but cannot ping from outsite too said T_T

  • anybody can help ? T_T

  • Best to contact support, it's a problem on OVH's side.

  • this is how I have it on my OVH VPS 2016 (Ubuntu 16.04 LTS):

    /etc/network/interfaces

    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # Source interfaces
    # Please check /etc/network/interfaces.d before changing this file
    # as interfaces may have been defined in /etc/network/interfaces.d
    # See LP: #1262951
    # source /etc/network/interfaces.d/*.cfg
    
    auto ens3
    iface ens3 inet dhcp
    
    auto ens3:1
    iface ens3:1 inet static
    address xx.xx.xx.xx/32  #this is the additional IP
    

    save and then issue:

    ifup ens3:1
    
  • Thanks Mik997, i am trying install ubuntu 16.04 now

    i am try config same as you ....... but still fail
    only can ping by Local , outside cannot

    auto lo
    iface lo inet loopback
    
    # Source interfaces
    # Please check /etc/network/interfaces.d before changing this file
    # as interfaces may have been defined in /etc/network/interfaces.d
    # See LP: #1262951
    # source /etc/network/interfaces.d/*.cfg
    
    
    auto ens3
    iface ens3 inet dhcp
    
    auto ens3:1
    iface ens3:1 inet static
    address 198.XXX.157.61/32
    
    auto ens3:2
    iface ens3:2 inet static
    address 198.XXX.157.62/32
    
  • derekyangderekyang Member
    edited November 2016

    Last time i added broadcast and it worked for me
    e.g

    auto ens3:2 iface ens3:2 inet static address 198.XXX.157.62/32 broadcast 198.XXX.157.62

Sign In or Register to comment.