Setting up a static ip address is useful for a lot of things, especially if you run a web server for example and don’t want to change the port forwarding rules on your router each time it allocates a different ip to your Ubuntu server.
Only use this guide if you already know the working network configuration (ip, mask, gateway and dns servers).
First of all, open a terminal window and edit the network interfaces file:
1
sudo nano /etc/network/interfaces
You will find here something like this:
1
2
auto eth0
iface eth0 inet dhcp
Edit that file accordingly and replace with your own ip configuration. The dns nameservers are actually Google’s dns servers so if you don’t know your own ISP ones, you can use those: