{"id":20697,"date":"2020-11-30T05:12:22","date_gmt":"2020-11-29T21:12:22","guid":{"rendered":"https:\/\/web.mwwsb.com.my\/pjci\/?post_type=kb&#038;p=20697"},"modified":"2023-01-18T09:54:11","modified_gmt":"2023-01-18T01:54:11","slug":"how-to-configure-static-ip-address-on-ubuntu-18-04","status":"publish","type":"kb","link":"https:\/\/www.casbay.com\/guide\/kb\/how-to-configure-static-ip-address-on-ubuntu-18-04","title":{"rendered":"How to Configure Static IP Address on Ubuntu 18.04"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"20697\" class=\"elementor elementor-20697\" data-elementor-post-type=\"kb\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-ddff292 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"ddff292\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-30c0b39\" data-id=\"30c0b39\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-0df5a63 elementor-widget elementor-widget-text-editor\" data-id=\"0df5a63\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>In this tutorial, we\u2019ll explain how to set up a static IP address on Ubuntu 18.04.<\/p><p>Do you know that:<\/p><p>Your router DHCP server would assign the IP addresses dynamically? In different situations such as configuring port forwarding or running a media server on your network, it may be necessary to set a static IP address on your Ubuntu computer.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-abfbbe0 elementor-widget elementor-widget-heading\" data-id=\"abfbbe0\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Configuring Static IP address using DHCP<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f0ba254 elementor-widget elementor-widget-text-editor\" data-id=\"f0ba254\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>The easiest way to assign a static IP address to a device on your LAN is by setting up a Static DHCP on your router. Static DHCP or DHCP reservation is a feature that we find on most routers which makes the DHCP server automatically assign the same IP address to a specific network device, every time the device requests an address from the DHCP server. This works by assigning a static IP to the device&#8217;s unique MAC address. However, the steps for configuring a DHCP reservation vary from router to router and it\u2019s advisable to consult the vendor\u2019s documentation.<span id=\"ezoic-pub-ad-placeholder-138\" class=\"ezoic-adpicker-ad\"><\/span><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8e205e7 elementor-widget elementor-widget-heading\" data-id=\"8e205e7\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Netplan<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-72ce144 elementor-widget elementor-widget-text-editor\" data-id=\"72ce144\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\"><p>Starting with the 17.10 release, Netplan is the default network management tool on Ubuntu, replacing the configuration file \/etc\/network\/interfaces that had previously been used to configure the network on Ubuntu.<\/p><p>Netplan uses configuration files with YAML syntax. To configure a network interface with Netplan you simply create a YAML description for that interface and Netplan generates the required configuration files for the renderer tool that you choose.<\/p><p>Moreover, Netplan currently supports two renderers NetworkManager and Systemd-networkd. We use NetworkManager mostly on desktop machines. For System-network, we use it when a GUI is absent on servers.<\/p><\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-16a7b0a elementor-widget elementor-widget-heading\" data-id=\"16a7b0a\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Configuring Static IP address on Ubuntu Server<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-86ee8e6 elementor-widget elementor-widget-text-editor\" data-id=\"86ee8e6\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>To configure a static IP address, you will need a <strong><a href=\"https:\/\/www.casbay.com\/vps-hosting-malaysia\">VPS<\/a> <\/strong>or <strong><a href=\"https:\/\/www.casbay.com\/asia-dedicated-server\/malaysia\">Dedicated Server<\/a><\/strong> that runs on Ubuntu. The newer versions of Ubuntu uses \u2018Predictable Network Interface Names\u2019 that start with <code>en[letter][number]<\/code>. by default. The first step is to identify the name of the ethernet interface you want to configure. You can use the following IP link command:<span id=\"ezoic-pub-ad-placeholder-140\" class=\"ezoic-adpicker-ad\"><\/span><\/p><pre class=\"console-bash\"><code class=\"language-console-bash\" data-lang=\"console-bash\"><span class=\"line\">ip link\n<\/span><\/code><\/pre><p>The command will print a list of all the available network interfaces. In this case, the name of the interface is\u00a0<code>ens3<\/code>:<\/p><pre><code class=\"language-output\" data-lang=\"output\">1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000\n    link\/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00\n3: ens3: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\n    link\/ether 56:00:00:60:20:0a brd ff:ff:ff:ff:ff:ff\n<\/code><\/pre><p>The location of the Netplan configuration files is in the <code>\/etc\/netplan<\/code>\u00a0directory and have the extension\u00a0<code>.yaml<\/code>. You\u2019ll probably find one or two YAML files in this directory. The file may differ from setup to setup. Usually, the file is named either\u00a0<code>01-netcfg.yaml<\/code>,\u00a0<code>50-cloud-init.yaml<\/code>\u00a0or\u00a0<code>NN_interfaceName.yaml<\/code>, but in your system, it may be different.<\/p><p>Next, open the YAML configuration file with your text editor:<\/p><pre class=\"console-bash\"><code class=\"language-console-bash\" data-lang=\"console-bash\"><span class=\"line\">sudo nano \/etc\/netplan\/01-netcfg.yaml\n<\/span><\/code><\/pre><div class=\"code-label\">\/etc\/netplan\/01-netcfg.yaml<\/div><div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-yaml\" data-lang=\"yaml\">network<span class=\"p\">:<\/span>\n  version<span class=\"p\">:<\/span> <span class=\"m\">2<\/span>\n  renderer<span class=\"p\">:<\/span> networkd\n  ethernets<span class=\"p\">:<\/span>\n    ens3<span class=\"p\">:<\/span>\n      dhcp4<span class=\"p\">:<\/span> yes\n<\/code><\/pre><\/div><p>Copy<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3e2ef84 elementor-widget elementor-widget-heading\" data-id=\"3e2ef84\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-large\">Before\u00a0changing\u00a0the\u00a0configuration<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8f01b9d elementor-widget elementor-widget-text-editor\" data-id=\"8f01b9d\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Let\u2019s explain the code in a short time before changing the configuration.<\/p><p>Each Netplan Yaml file starts with the <code>network<\/code>\u00a0key that has at least two required elements. The first required element is the version of network configuration format and the second one is the device type. Device types values can be\u00a0<code>ethernets<\/code>,\u00a0<code>bonds<\/code>,\u00a0<code>bridges<\/code>, and\u00a0<code>vlans<\/code>.<\/p><p>Furthermore, the configuration above also includes the <code>renderer<\/code>\u00a0type. Out of the box, if you installed Ubuntu in server mode the renderer is configured to use\u00a0<code>networkd<\/code>\u00a0as the back end.<span id=\"ezoic-pub-ad-placeholder-160\" class=\"ezoic-adpicker-ad\"><\/span><\/p><p>Under the device\u2019s type ( in this case\u00a0<code>ethernets<\/code>) we can specify one or more network interfaces. In this example, we have only one interface <code>ens3<\/code>\u00a0that is configured to obtain IP addressing from a DHCP server\u00a0<code>dhcp4: yes<\/code>.<\/p><p>To assign a static IP address to\u00a0<code>ens3<\/code> the interface edit the file as follows:<\/p><ul><li>Set DHCP to no\u00a0<code>dhcp4: yes<\/code><\/li><li>Specify the static IP address\u00a0<code>192.168.121.199\/24<\/code>. Under\u00a0<code>addresses:<\/code>\u00a0you can add one or more IPv4 or IPv6 IP addresses that will be assigned to the network interface.<\/li><li>Specify the gateway\u00a0<code>gateway4: 192.168.121.1<\/code><\/li><li>Under\u00a0<code>nameservers<\/code>, specify the nameservers\u00a0<code>addresses: [8.8.8.8, 1.1.1.1]<\/code><\/li><\/ul><div class=\"code-label\"><div class=\"code-label\">\/etc\/netplan\/01-netcfg.yaml<\/div><div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-yaml\" data-lang=\"yaml\">network<span class=\"p\">:<\/span>\n  version<span class=\"p\">:<\/span> <span class=\"m\">2<\/span>\n  renderer<span class=\"p\">:<\/span> networkd\n  ethernets<span class=\"p\">:<\/span>\n    ens3<span class=\"p\">:<\/span>\n<span class=\"hl\">      dhcp4<span class=\"p\">:<\/span> no\n<\/span><span class=\"hl\">      addresses<span class=\"p\">:<\/span>\n<\/span><span class=\"hl\">        - <span class=\"m\">192.168<\/span><span class=\"m\">.121<\/span><span class=\"m\">.199<\/span>\/<span class=\"m\">24<\/span>\n<\/span><span class=\"hl\">      gateway4<span class=\"p\">:<\/span> <span class=\"m\">192.168<\/span><span class=\"m\">.121<\/span><span class=\"m\">.1<\/span>\n<\/span><span class=\"hl\">      nameservers<span class=\"p\">:<\/span>\n<\/span><span class=\"hl\">          addresses<span class=\"p\">:<\/span> <span class=\"p\">[<\/span><span class=\"m\">8.8<\/span><span class=\"m\">.8<\/span><span class=\"m\">.8<\/span><span class=\"p\">,<\/span> <span class=\"m\">1.1<\/span><span class=\"m\">.1<\/span><span class=\"m\">.1<\/span><span class=\"p\">]<\/span><\/span><\/code><\/pre><\/div><p>Copy<\/p><p><span class=\"word\">Make\u00a0<\/span><span class=\"word\">sure\u00a0<\/span><span class=\"word\">you\u00a0<\/span><span class=\"word\">follow\u00a0<\/span><span class=\"word\">the\u00a0<\/span><span class=\"word\">YAML\u00a0<\/span><span class=\"word\">code\u00a0<\/span><span class=\"word\">indent\u00a0<\/span><span class=\"word\">requirements\u00a0<\/span><span class=\"word\">when\u00a0<\/span><span class=\"word\">editing\u00a0<\/span><span class=\"word\">Yaml\u00a0<\/span><span class=\"word\">files\u00a0<\/span><span class=\"word\">as\u00a0<\/span><span class=\"word\">it\u00a0<\/span><span class=\"word\">may <\/span><span class=\"word\" style=\"font-size: 18px; color: var( --e-global-color-text );\">not\u00a0<\/span><span class=\"word\" style=\"font-size: 18px; color: var( --e-global-color-text );\">work <\/span><span class=\"word\" style=\"font-size: 18px; color: var( --e-global-color-text );\">if\u00a0<\/span><span class=\"word\" style=\"font-size: 18px; color: var( --e-global-color-text );\">the c<\/span><span class=\"word\" style=\"font-size: 18px; color: var( --e-global-color-text );\">onfiguration\u00a0<\/span><span class=\"word\" style=\"font-size: 18px; color: var( --e-global-color-text );\">includes\u00a0<\/span><span class=\"word\" style=\"font-size: 18px; color: var( --e-global-color-text );\">a\u00a0<\/span><span class=\"word\" style=\"font-size: 18px; color: var( --e-global-color-text );\">syntax\u00a0<\/span><span class=\"word\" style=\"font-size: 18px; color: var( --e-global-color-text );\">error.<\/span><\/p><p><span class=\"word\">Once you save and closed <\/span><span class=\"word\">the\u00a0<\/span><span class=\"word\">file, <\/span><span class=\"word\">and\u00a0<\/span><span class=\"word\">the\u00a0<\/span><span class=\"word\">changes\u00a0<\/span><span class=\"word\">are\u00a0<\/span><span class=\"word\">applied\u00a0<\/span><span class=\"word\">with:<\/span><\/p><pre class=\"console-bash\"><code class=\"language-console-bash\" data-lang=\"console-bash\"><span class=\"line\">sudo netplan apply\n<\/span><\/code><\/pre><p>Then verify the changes by typing:<\/p><pre class=\"console-bash\"><code class=\"language-console-bash\" data-lang=\"console-bash\"><span class=\"line\">ip addr show dev ens3\n<\/span><\/code><\/pre><pre><code class=\"language-output\" data-lang=\"output\">3: ens3: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc mq state UP group default qlen 1000\n    link\/ether 56:00:00:60:20:0a brd ff:ff:ff:ff:ff:ff\n    inet 192.168.121.199\/24 brd 192.168.121.255 scope global dynamic ens3\n       valid_lft 3575sec preferred_lft 3575sec\n    inet6 fe80::5054:ff:feb0:f500\/64 scope link \n       valid_lft forever preferred_lft forever\n<\/code><\/pre><p>That\u2019s it! You have assigned a static IP to your Ubuntu server.<\/p><\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e4f0192 elementor-widget elementor-widget-heading\" data-id=\"e4f0192\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Configuring Static IP address on Ubuntu Desktop<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f159350 elementor-widget elementor-widget-text-editor\" data-id=\"f159350\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Setting up a static IP address on Ubuntu Desktop computers requires no technical knowledge.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-28ad65a elementor-widget elementor-widget-text-editor\" data-id=\"28ad65a\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>1.In the Activities screen, search for \u201cnetwork\u201d and click on the <strong>Network<\/strong> icon. This will open the GNOME Network configuration settings. Click on the <strong>cog<\/strong> icon.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0eb8ea2 elementor-widget elementor-widget-image\" data-id=\"0eb8ea2\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/casbay.com\/guide\/wp-content\/uploads\/2021\/02\/linux01.jpg\" title=\"\" alt=\"\" loading=\"lazy\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d3f7aa5 elementor-widget elementor-widget-text-editor\" data-id=\"d3f7aa5\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<figure class=\"relative\"><div class=\"w-full mx-auto my-0 block relative\"><div class=\"block\"><figure id=\"attachment_6010\" class=\"wp-caption alignnone\" aria-describedby=\"caption-attachment-6010\"><figcaption id=\"caption-attachment-6010\" class=\"wp-caption-text\">Select Network icon<\/figcaption><\/figure><\/div><\/div><\/figure>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-cb461d4 elementor-widget elementor-widget-text-editor\" data-id=\"cb461d4\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<figure class=\"relative\"><div class=\"w-full mx-auto my-0 block relative\"><div class=\"block\">2. This will open the Network interface settings dialog box.<\/div><\/div><\/figure>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ddb178f elementor-widget elementor-widget-image\" data-id=\"ddb178f\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/casbay.com\/guide\/wp-content\/uploads\/2021\/02\/linux02.jpg\" title=\"\" alt=\"\" loading=\"lazy\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8a00d99 elementor-widget elementor-widget-text-editor\" data-id=\"8a00d99\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<figure class=\"relative\"><div class=\"w-full mx-auto my-0 block relative\"><div class=\"w-full h-full absolute inset-0 m-auto overflow-hidden text-center\"><figure id=\"attachment_6012\" class=\"wp-caption alignnone\" aria-describedby=\"caption-attachment-6012\"><figcaption id=\"caption-attachment-6012\" class=\"wp-caption-text\">Network interface settings dialog box<\/figcaption><\/figure><\/div><\/div><\/figure>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1f80ddb elementor-widget elementor-widget-text-editor\" data-id=\"1f80ddb\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<figure class=\"relative\"><div class=\"w-full mx-auto my-0 block relative\">\u00a0<\/div><\/figure><p>3. In \u201cIPV4\u201d Method\u201d section select \u201cManual\u201d, and enter your static IP address, Netmask and Gateway.\u00a0<span class=\"word\">Click\u00a0<\/span><span class=\"word\">on\u00a0<\/span><span class=\"word\">the\u00a0<\/span><span class=\"word\">\u201cApply\u201d\u00a0<\/span><span class=\"word\">button\u00a0<\/span><span class=\"word\">once\u00a0<\/span><span class=\"word\">completed.<\/span><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9171e5b elementor-widget elementor-widget-image\" data-id=\"9171e5b\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/casbay.com\/guide\/wp-content\/uploads\/2021\/02\/linux03.jpg\" title=\"\" alt=\"\" loading=\"lazy\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-cb4b79e elementor-widget elementor-widget-text-editor\" data-id=\"cb4b79e\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<figure class=\"relative\"><\/figure><figure class=\"relative\"><div class=\"w-full mx-auto my-0 block relative\"><div class=\"block\"><figure id=\"attachment_6011\" class=\"wp-caption alignnone\" aria-describedby=\"caption-attachment-6011\"><figcaption id=\"caption-attachment-6011\" class=\"wp-caption-text\">Select \u201cManual\u201d in \u201cIPV4\u201d Method\u201d section<\/figcaption><\/figure><\/div><\/div><\/figure>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3340532 elementor-widget elementor-widget-text-editor\" data-id=\"3340532\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<figure class=\"relative\"><\/figure><p>Now that you have set up a static IP Address, open your terminal either by using the\u00a0<code>Ctrl+Alt+T<\/code>\u00a0keyboard shortcut or by clicking on the terminal icon and verify the changes by typing:<span id=\"ezoic-pub-ad-placeholder-157\" class=\"ezoic-adpicker-ad\"><\/span><\/p><pre class=\"console-bash\"><code class=\"language-console-bash\" data-lang=\"console-bash\"><span class=\"line\">ip addr\n<\/span><\/code><\/pre><p>The output will show the interface IP address:<span id=\"ezoic-pub-ad-placeholder-145\" class=\"ezoic-adpicker-ad\"><\/span><\/p><pre><code class=\"language-output\" data-lang=\"output\">...\n2: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc fq_codel state UP group default qlen 1000\n    link\/ether 52:54:00:e9:40:f2 brd ff:ff:ff:ff:ff:ff\n    inet 192.168.121.106\/24 brd 192.168.121.255 scope global dynamic noprefixroute eth0\n       valid_lft 3523sec preferred_lft 3523sec\n    inet6 fe80::5054:ff:fee9:40f2\/64 scope link \n       valid_lft forever preferred_lft forever<\/code><\/pre><div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\u00a0<\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-16eee30 elementor-widget elementor-widget-heading\" data-id=\"16eee30\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Conclusion<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2ece861 elementor-widget elementor-widget-text-editor\" data-id=\"2ece861\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>You have learned how to assign a static IP address on your Ubuntu 18.04 machine.<\/p><p>If you have any questions, please leave a comment below.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4e28f4e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4e28f4e\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1429d63\" data-id=\"1429d63\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-f6872d4 elementor-widget elementor-widget-text-editor\" data-id=\"f6872d4\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Looking for more guide articles on Ubuntu? Kindly visit our <a href=\"https:\/\/www.casbay.com\/guide\/?source=kb&#038;s=ubuntu\">Knowledge Base<\/a>.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we\u2019ll explain how to set up a static IP address on Ubuntu 18.04. Do you know that: Your router DHCP server would assign the IP addresses dynamically? In different situations such as configuring port forwarding or running a media server on your network, it may be necessary to set a static IP [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"no-sidebar","site-content-layout":"page-builder","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"disabled","ast-breadcrumbs-content":"","ast-featured-img":"disabled","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}}},"kbtopic":[110],"kbtag":[106,105],"mkb_version":[],"_links":{"self":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/20697"}],"collection":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/comments?post=20697"}],"version-history":[{"count":28,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/20697\/revisions"}],"predecessor-version":[{"id":38190,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/20697\/revisions\/38190"}],"wp:attachment":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/media?parent=20697"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=20697"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kbtag?post=20697"},{"taxonomy":"mkb_version","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/mkb_version?post=20697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}