How to Configure Network Static IP Address in Ubuntu 18.04

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Aaron Kili

Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

12 Responses

  1. johan says:

    Interesting tutorial but at the netplan part you are going to fast for me. I don’t have that file, i do have a 50cloudminitmyaml does this mean i need to add my ipaddress in the 5-cloud file?

  2. Jasper Frumau says:

    After adding ens7 to

    version:  2
    rendereder: networkd
    dhcp4: yes
    dhcp6: yes 
    dhcp4: no
    dhcp6: no

    and checking with:

    $ sudo netplan apply --debug

    all seemed well, but I can no longer ssh into my box now. Why?

    • Pabs says:

      Can you try this >>

      # telnet yournewipaddress 22

      that should tell you if open or available, also change the yes and no to true and false.

  3. Troy Starkey says:

    How is it, that in 2018 the configuration of your networks is decades behind Redhat 6?? Since when have we been reduced to config file editing, when the old classic blue and red config menu’s were fantastic. I dunno, even Raspberry Pi has better tools out of the box…..

  4. Ton Lagerway says:


    Looking to set up a static IP address in preparation for setting up a personal VPN via raspberry Pi

    Cannot find not generate a netplan file at all

    Configuration of ethernet looks as follows:

    [email protected]:~$ ifconfig -a
    enp3s0f1: flags=4163  mtu 1500
    inet  netmask  broadcast
    inet6 fd80:1382:3798:a000:6868:a0df:eda4:255f  prefixlen 64  scopeid 0x0
    inet6 fe80::8947:42e1:8a88:66c9  prefixlen 64  scopeid 0x20
    inet6 fd80:1382:3798:a000:2dfb:4728:37a3:42a9  prefixlen 64  scopeid 0x0
    ether 88:d7:f6:2f:a1:2b  txqueuelen 1000  (Ethernet)
    RX packets 593  bytes 359039 (359.0 KB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 642  bytes 87846 (87.8 KB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    lo: flags=73  mtu 65536
    inet  netmask
    inet6 ::1  prefixlen 128  scopeid 0x10
    loop  txqueuelen 1000  (Local Loopback)
    RX packets 298  bytes 22474 (22.4 KB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 298  bytes 22474 (22.4 KB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    wlp2s0: flags=4098  mtu 1500
    ether dc:53:60:f0:13:3d  txqueuelen 1000  (Ethernet)
    RX packets 0  bytes 0 (0.0 B)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 0  bytes 0 (0.0 B)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    Just a “Rank-Pensioner” amateur who can copy & past but does not understand much about Linux!


    • Aaron Kili says:


      If there is no default netplan config file, try to generate one as shown in the article, then put your config in there. For more information, read the netplan man page.

  5. Pabs says:

    dhcp4: yes
    dhcp6: yes

    dhcp4: no
    dhcp6: no

    has to be changed to
    dhcp4: true
    dhcp6: true

    dhcp4: false
    dhcp6: false

    • Aaron Kili says:


      Yes, this is correct but yes or no values also work. After i installed Ubuntu 18.04, one of the default interfaces using dhcp4 had a value of yes(see the screenshot in article).

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

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