Here is the guide to set static IP address on Linux Ubuntu by using the Nano text editor.
sudo nano /etc/network/interfaces
so do not miss out the s in interface word, else the Linux unable to recognize your command. Due to changing system setting, it may prompt you the password for root. Once you entered the password and you may see the something as below.
auto lo eth0 iface lo inet loopback iface eth0 inet dynamic
so you may manually to change the file by using the nano editor. Below is my example and please take note that the iface eth0 inet dynamic change to static.
auto lo eth0 iface lo inet loopback iface eth0 inet static address 192.168.1.101 netmask 255.255.255.0 gateway 192.168.1.1
after you complete change, press Ctrl + x to save the change. The editor will promt you
Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?
Type Y to accept the change then press enter to save the file.
After you save the config file, you may restart the interface to make change. Type below command to down the interface
sudo ifdown eth0
and
sudo ifup eth0
to up the interface.
No comments:
Post a Comment