Ubuntu: Setup a static IP allocated to dedicated server



Question:

So, I bought a new IP for my dedicated server from a reseller of Psychz Networks. This is the only information they gave me:

IP: 104.206.231.109  Gateway: 104.206.231.1  Netmask: 255.255.255.128  

So, I've set my Interfaces file up 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  auto p4p1  iface p4p1 inet dhcp  iface eth0 inet static  address 104.206.231.109  netmask 255.255.255.128  gateway 104.206.231.1  

... annnd I ran

 services networking restart  

and got:

 stop: Job failed while stopping   start: Job is already running: networking  

Oh, and my resolv.conf:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)  #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN  nameserver 8.8.8.8  search dal.us.mpgs.system  

Oh, and here's ifconfig

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:27306645 errors:0 dropped:0 overruns:0 frame:0            TX packets:27306645 errors:0 dropped:0 overruns:0 carrier:0            collisions:0 txqueuelen:0            RX bytes:2978675193 (2.9 GB)  TX bytes:2978675193 (2.9 GB)    p4p1      Link encap:Ethernet  HWaddr 00:25:90:76:c3:ba            inet addr:104.206.231.47  Bcast:104.206.231.63  Mask:255.255.255.192            inet6 addr: fe80::225:90ff:fe76:c3ba/64 Scope:Link            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1            RX packets:18388696 errors:0 dropped:0 overruns:0 frame:0            TX packets:13534048 errors:0 dropped:0 overruns:0 carrier:0            collisions:0 txqueuelen:1000            RX bytes:6282692826 (6.2 GB)  TX bytes:2823775361 (2.8 GB)            Interrupt:16 Memory:fb900000-fb920000  

How can I fix this? I've got it all setup correctly as far as I can see.


Solution:1

According to your ifconfig, your relevant interface is p4p1. I suggest you amend your /etc/network/interfaces file to read:

# 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  auto p4p1  iface p4p1 inet static  address 104.206.231.109  netmask 255.255.255.128  gateway 104.206.231.1  dns-nameservers 8.8.8.8 104.206.231.1  

Restart the interface:

sudo ifdown p4p1 && sudo ifup p4p1  

Did you get the desired address?

ifconfig  

Can you reach the internet?

ping -c3 www.ubuntu.com  

If you get the desired address and ping returns, you're all set.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »