Adding an IP address: Difference between revisions

From BitFolk
Jump to navigation Jump to search
No edit summary
No edit summary
Line 10: Line 10:


<code>
<code>
# The primary network interface
    # The primary network interface
auto eth0
    auto eth0
iface eth0 inet static
    iface eth0 inet static
     address 85.119.12.34
     address 85.119.12.34
     netmask 255.255.248.0
     netmask 255.255.248.0
Line 22: Line 22:
<code>
<code>


# The secondary network interface
    # The secondary network interface
auto eth0:0
    auto eth0:0
iface eth0:0 inet static
    iface eth0:0 inet static
     address 85.119.56.78
     address 85.119.56.78
     netmask 255.255.255.255
     netmask 255.255.255.255
Line 34: Line 34:


<code>
<code>
sudo shutdown now
    sudo shutdown now
</code>
</code>


Line 40: Line 40:


<code>
<code>
ssh you@you.vps.bitfolk.com
    ssh you@you.vps.bitfolk.com
</code>
</code>


Line 46: Line 46:


<code>
<code>
boot
    boot
</code>
</code>


If it complains that an instance already exists, and you've waited sufficiently long that the machine should have shut down, do
If it complains that an instance already exists, and you've waited sufficiently long that the machine should have shut down, do
<code>
<code>
destroy
    destroy
</code>
</code>
then
then
<code>
<code>
boot
    boot
</code>
</code>


You can now log back in to your VPS and your new IPs should work.
You can now log back in to your VPS and your new IPs should work.

Revision as of 14:11, 10 December 2015

If you've been assigned one or more additional IP addresses, here is how to add them.

Adding an IPv4 address on a Ubuntu 14.04 LTS VPS

First open your interfaces file for editing:

sudo nano /etc/network/interfaces

You should see your main IP address described for IPv4 and IPv6. The IPv4 part looks something like:

   # The primary network interface
   auto eth0
   iface eth0 inet static
   address 85.119.12.34
   netmask 255.255.248.0
   gateway 85.119.80.1

Go to the end of the file and add information about your new IP. It doesn't need a gateway and you can use 255.255.255.255 for netmask:

   # The secondary network interface
   auto eth0:0
   iface eth0:0 inet static
   address 85.119.56.78
   netmask 255.255.255.255

For each additional IP, use eth0:1, eth0:2 etc.

Once you're finished, press Ctrl-X and save your file. Then shutdown your machine:

   sudo shutdown now

You will then need to reboot your machine by logging in via the Xen console. Get your details from the Bitfolk Panel:

   ssh you@you.vps.bitfolk.com

Once logged in you will see the Xen command line prompt. Try

   boot

If it complains that an instance already exists, and you've waited sufficiently long that the machine should have shut down, do

   destroy

then

   boot

You can now log back in to your VPS and your new IPs should work.