Debian and Ubuntu pre-18.04 instructions
Posted: Mon Jun 13, 2011 12:35 pm
To add an IP in Ubuntu or Debian,
- Log in to your server as the "root" user via the "VNC console" page in your control panel.
- Open up the "/etc/network/interfaces" file in your favorite editor -- for instance, type "nano /etc/network/interfaces" to use nano.
- Cursor down to the end of the file and look for the last "auto eth0" or "auto eth0:x" line, where "x" is some number. On a dedicated machine, "eth0" may be something else like "p1p1"; if so, you'll need to use that different name.
- If you had the ":x", pick a number one higher than the "x". If you didn't, use "0". We'll call that number "y".
- Add a set of lines using "y" to the end of the file in the following format:
Replace "your.ip.address", "your.netmask", and "your.gateway" with the corresponding information for the IP that you are adding, from your control panel "IP list" page.Code: Select all
auto eth0:y iface eth0:y inet static address your.ip.address netmask your.netmask gateway your.gateway
- Save the file. In the "nano" editor, you can do this by hitting Control-X, then telling it "y" to save before it closes.
- Enter the following command to restart your networking system:
Code: Select all
/etc/init.d/networking restart