How to set static IP address in Ubuntu

I like to have a static IP address for my Ubuntu notebook computer when it is connected to the home network. This is useful because with a static IP address other devices on the home network know how to talk to my notebook. Setting up a static IP address for a specific network is easy in Ubuntu.

  1. By default, my notebook is connected to my home wireless router using DHCP. I would like to use the same settings but with a static IP address. First, I decide what static IP address to use. Then I note down the network mask (check ifconfig output), the network gateway (check route -n output) and DNS servers (Google or OpenDNS). One way to do this is by running nm-tool. You can see these details at the end of its output.

  2. Click the network icon in the Panel and choose Edit connections. Here pick the network connection you are using (wired or wireless) and click Edit. Under IPv4 settings, change Automatic (DHCP) to Manual and enter the static IP address you want, the netmask, gateway and DNS servers. If you want to provide two DNS server addresses, separate them with a comma.

  3. Disconnect from the network and connect back again. If everything is working fine, you have configured your static IP address.

Tried with: Ubuntu 16.04

2 thoughts on “How to set static IP address in Ubuntu

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.