Configure static IP in ubuntu system

From Notes_Wiki
Revision as of 05:37, 15 February 2023 by Saurabh (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Home > Ubuntu > Server or Desktop administration > Configure static IP in ubuntu system

To configure static IP in ubuntu edit /etc/network/interfaces as follows:

   auto eth0
   iface eth0 inet static
    address 192.168.3.3
    netmask 255.255.255.0
    gateway 192.168.3.1
    dns-search example.com
    dns-nameservers 192.168.3.45 192.168.8.10

Restart using:

   systemctl restart networking

as use of /etc/init.d/networking restart is deprecated

For DNS we can also create /etc/resolvconf/resolv.conf.d/tail file with desired "resolv.conf" static contents and do

   resolvconf -u

for settings to take effect.


Refer:




Home > Ubuntu > Server or Desktop administration > Configure static IP in ubuntu system