Wissensdatenbank

How to set a Static IP in Ubuntu Linux Print

  • 0

How to set a Static IP in Ubuntu Linux

Open the terminal command line application or ssh into the remote server. Type the following command:

sudo vi /etc/network/interfaces


OR


sudo nano /etc/network/interfaces

Make the changes as follows:

auto eth0
iface eth0 inet static
 address 10.10.29.66
 netmask 255.255.255.192
 network 10.10.29.65
 broadcast 10.10.29.127
 gateway 10.10.29.65
# Google dns server for our network
 dns-nameservers 8.8.8.8 8.8.4.4

Save and close the file. Restart networking on Ubuntu Linux 14.04 LTS or older:

$ sudo /etc/init.d/networking restart

If you are using a system based Ubuntu Linux version such as 16.04 LTS or above, enter:

$ sudo systemctl restart networking

 

War diese Antwort hilfreich?
Back