Ubuntu 14.04 Set Static IP address

Posted on Friday, September 26, 2014






It looks like setting up a static IP address in Ubuntu 14.04 has changed since 12.04/10.04.    Here are some notes on how to set your static IP address in Ubuntu 14.04.








First update your interfaces file


    > sudo vi /etc/network/interfaces


My internal network is the generic 192.168.0.X.  I want to set this static IP address to 192.168.0.198.  I updated the interfaces file to


auto lo
iface lo inet loopback
#
#
auto eth0
iface eth0 inet static
         address 192.168.0.198
         netmask 255.255.255.0
         broadcast 192.168.1.255
         gateway 192.168.0.1
         dns-nameservers 8.8.8.8


The dns-nameservers is now required.  I set it to googles dns server.

Save the file.


This is totally new to me

I found this site which discusses the resolv.conf information

Edit the /etc/resolvconf/resolv.conf.d/base  file


    > sudo vi /etc/resolvconf/resolv.conf.d/base


And place the following in it



dns-nameservers 8.8.8.8


Update resolvconf


    > sudo resolvconf -u




The old

sudo /etc/init.d/networking restart
not longer works.



To reload the settings run this



    > sudo ifdown eth0 && sudo ifup eth0






Now check the updated information


    > ifconfig -a







References
[1]        How do I set my DNS on Ubuntu 14.04?
                Accessed 09/2014
[2]        How to successfully restart a network without reboot over SSH?           
                Accessed 09/2014


No comments:

Post a Comment