Howdy, Stranger!

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


Assigning an additional IP to a Dedicated
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.

Assigning an additional IP to a Dedicated

AsuraHostingAsuraHosting Member
edited February 2012 in Help

Hey guys, I just got a new server and I was trying to assign a secondary IP to the dedicated server; but every time I restart the networking, it cuts me off from the server; so I'm sure that I'm probably just doing it wrong.

The server is on Debian 6.0.4 (Squeeze); and I was following this: http://wiki.debian.org/NetworkConfiguration#A.2BAC8-etc.2BAC8-network.2BAC8-interfaces

It doesn't seem to work... if anyone could help point out how to do it, I'd appreciate it a lot! Thanks in advance.

Comments

  • AldryicAldryic Member
    edited February 2012

    I'm guessing your editing /etc/network/interfaces manually? If so, you either need to do auto eth0:1, etc, or when you restart networking, do it with /etc/init.d/networking restart && ifup eth0 && ifup eth0:1, etc, since restarting networking in this fashion doesn't auto-up the interfaces unless that auto flag is set.

    Example:

    -22:14:26- Inhert:~ :: aldryic % cat /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
    
    # The primary network interface
    allow-hotplug eth0
    auto eth0
    iface eth0 inet static
            address 12.34.56.78
            network 12.34.56.0
            gateway 12.34.56.1
            netmask 255.255.255.0
            broadcast 12.34.56.255
            dns-nameservers 8.8.8.8 8.8.4.4 4.2.2.1 4.2.2.2
    
    auto eth0:0
    iface eth0:0 inet static
            address 23.45.67.89
            network 23.45.67.0
            gateway 23.45.67.1
            netmask 255.255.255.0
            broadcast 23.45.67.255
            dns-nameservers 8.8.8.8 8.8.4.4 4.2.2.1 4.2.2.2
    Thanked by 1AsuraHosting
  • @Aldryic

    Yeah I'm a bit confused; I tried to add the following, but it locked me out of my server and I was forced to access it through KVM...

    auto eth0:1

    allow-hotplug eth0:1
    iface eth0:1 inet static
    address sec.on.dar.y
    netmask 255.255.255.0

  • eth0:1 is a virtual interface, you can't "allow hotplug" it :P Remove that line, add the network, gateway, and broadcast, and you should be set.

    Thanked by 1AsuraHosting
  • @Aldyric; I don't have a broadcast, it should work fine right?

    By the way, thanks a lot for the help; really appreciate this man =)

  • No worries, I fought with the same thing myself :P Broadcast isn't always necessary... but if you're not running DHCP you do need to declare a gateway.

    Thanked by 1AsuraHosting
  • AsuraHostingAsuraHosting Member
    edited February 2012

    @Aldryic

    I'm trying to fix it up, but it seems to be not working correctly...

    root@debian:~# /etc/init.d/networking restart && ifup eth0 && ifup eth0:1

    Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces ... (warning).
    Reconfiguring network interfaces...SIOCDELRT: No such process
    SIOCADDRT: No such process
    Failed to bring up eth0:1.
    done.

    My /etc/init.d/networking looks like this

    # 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
    
    # The primary network interface
    allow-hotplug eth0
    iface eth0 inet static
            address 173.208.228.x
            netmask 255.255.255.0
            gateway 173.208.228.y
    
    auto eth0:1
    iface eth0:1 inet static
            address 173.208.228.x+1
            netmask 255.255.255.0
            gateway 173.208.228.y
    
  • Ah, I found out the solution... just needed to remove gateway.

    Thanks for everything @Aldryic =)!

  • AldryicAldryic Member
    edited February 2012

    No worries :3

    Thanked by 1AsuraHosting
Sign In or Register to comment.