To change your IP form dynamic to static, we will need to look into the /etc/networks/interfaces -file.
sudo nano /etc/networks/interfaces
This will open up the configuration file in which you can tweak your IP setting. It will look a bit like this:
You will need to change a few lines in order to make your IP static. Add these changes into the file:
auto eth0 iface eth0 inet static address 10.5.5.1 netmask 255.255.255.0 #network 10.5.5.0 #broadcast 10.5.5.31
Depending on your needs, you can also configure netmask and other necessary configurations here.
# – means that the setting is commented out, and will not apply.
Save the file and run these commands:
sudo ifdown eth0 sudo ifup eth0
This will apply the changes made and give you a new IP. Now if you run
ifconfig your IP should display as
10.5.5.1 – you now have a static IP.