{"id":18885,"date":"2022-10-04T16:08:07","date_gmt":"2022-10-04T16:08:07","guid":{"rendered":"https:\/\/linuxways.net\/?p=18885"},"modified":"2022-11-04T02:44:37","modified_gmt":"2022-11-04T02:44:37","slug":"setup-static-ip-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/setup-static-ip-ubuntu-22-04\/","title":{"rendered":"Setup Static IP Ubuntu 22.04"},"content":{"rendered":"<p>We received the IP address in our devices from Dynamic Host Configuration Protocol (DHCP). A DHCP server assigns the device a temporary IP address once it is joined to the network. Therefore, we have the opportunity to occasionally modify the specified IP address with the static IP address. Static IP is very much different from dynamic IPs. Static IPs are fixed and unchangeable addresses. When the device is connected to the internet, the static IP provides us with a consistent identity and location.<\/p>\n<p>The network providers give the same IP addresses to the two separate users because there are not enough IP addresses available. Due to this, the users encounter connection issues. Alternatively, static IP addresses minimize these conflicts because they are user specific. Here, we will set up the static IP address for the Ubuntu 22.04 LTS using two different procedures. We have simple steps to configure static IP in Ubuntu 22.04.<\/p>\n<h2><strong>Set up static IP graphically in Ubuntu 22.04:<\/strong><\/h2>\n<p>We have demonstrated the steps to set up an IP address in Ubuntu 22.04 with its desktop environment as the user prefers activities graphically rather than the terminal command. To establish a static IP address in the GUI Network Settings of Ubuntu 22.04, follow the instructions below. We can go to the settings from the activities of Ubuntu and then click on the \u201cnetwork\u201d. We can also click the network icon from the top of the Ubuntu 22.04 screen.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"412\" height=\"437\" class=\"wp-image-18896\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-1.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-1.jpeg 412w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-1-283x300.jpeg 283w\" sizes=\"auto, (max-width: 412px) 100vw, 412px\" \/><\/strong><\/p>\n<p>The network icon here shows many features which we can set. But our concern is with the \u201cwired connected\u201d section. Wired connected provides two more features: one for turning on\/off wifi connection and the other one is setting the wired network. By clicking on the \u201cwired setting\u201d, the network setting page will be opened.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"348\" height=\"391\" class=\"wp-image-18900\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-2.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-2.jpeg 348w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-2-267x300.jpeg 267w\" sizes=\"auto, (max-width: 348px) 100vw, 348px\" \/><\/strong><\/p>\n<p>Now, we are in the settings of Ubuntu 22.04 \u201cNetwork\u201d. From here, we have to press the \u201cgearbox\u201d icon located at the bottom of the \u201cwired\u201d section.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"951\" height=\"406\" class=\"wp-image-18907\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-3.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-3.jpeg 951w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-3-300x128.jpeg 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-3-768x328.jpeg 768w\" sizes=\"auto, (max-width: 951px) 100vw, 951px\" \/><\/strong><\/p>\n<p>Once the setting icon is clicked, a dialog box will be generated which provides further information about the network IP. On the dialog box, we have an option \u201cIPv4\u201d or \u201cIPv6\u201d. We can switch to any of these options. Here, we have selected the IPv4 option.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"581\" height=\"473\" class=\"wp-image-18914\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-4.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-4.jpeg 581w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-4-300x244.jpeg 300w\" sizes=\"auto, (max-width: 581px) 100vw, 581px\" \/><\/strong><\/p>\n<p>The \u201cIPv4\u201d is set with the automatic (DHCP) which means that the DHCP server provides the IP address here automatically. But for the manual configuration of IP address, we have to select the option \u201cmanual\u201d. We have options here to set up the static IP address for our Ubuntu 22.04 system. We have to provide the values against \u201cAddress\u201d, \u201cNetmask\u201d, \u201cGateway\u201d and the \u201cDNS\u201d. Make sure to provide valid values against each portion. Then, to save the settings, click the &#8220;Apply&#8221; option.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"583\" height=\"472\" class=\"wp-image-18919\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-5.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-5.jpeg 583w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-5-300x243.jpeg 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-5-150x120.jpeg 150w\" sizes=\"auto, (max-width: 583px) 100vw, 583px\" \/><\/p>\n<p>To execute the actions above, we should have to restart the network interface by turning it off and then on the toggling icon in the wired section.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"692\" height=\"198\" class=\"wp-image-18923\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-6.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-6.jpeg 692w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-6-300x86.jpeg 300w\" sizes=\"auto, (max-width: 692px) 100vw, 692px\" \/><\/strong><\/p>\n<p>We can verify the static IP address which we have set manually by again clicking the gear icon that lies under the wired section. The values we have assigned for the IP address have been changed as shown in the dialog box below. As a result, we were able to use the GUI to set up the static IP address on our Ubuntu 22.04 server.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"585\" height=\"473\" class=\"wp-image-18926\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-7.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-7.jpeg 585w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-7-300x243.jpeg 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-7-150x120.jpeg 150w\" sizes=\"auto, (max-width: 585px) 100vw, 585px\" \/><\/strong><\/p>\n<h2><strong>Set up static IP with nmcli command in Ubuntu 22.04:<\/strong><\/h2>\n<p>We have seen the configuration of the static IP address with the desktop environment of Ubuntu 22.04 above. We can also configure the IP address through the commands in the Ubuntu 22.04 terminal. For setting the static IP address via terminal, we used the \u201cnmcli\u201d command. Linux allows users to manage the &#8220;Network Manager&#8221; by executing the &#8220;nmcli&#8221; command. We have used this command to create, edit, delete, activate, or deactivate network connections as well as output the information of specific network status. Here, the text-based interface nmcli is used to monitor the status of the Ubuntu 22.04 wired connections. With this command, we can access the advanced information of our device network.<\/p>\n<p>First, we launched the terminal and entered the \u201cnmcli connection show\u201d command to get the name of the device. Here, we have a device named \u201cenp0s3\u201d.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"711\" height=\"74\" class=\"wp-image-18930\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-8.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-8.jpeg 711w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-8-300x31.jpeg 300w\" sizes=\"auto, (max-width: 711px) 100vw, 711px\" \/><\/strong><\/p>\n<p>Then, we entered the nmcli command for the existing connection we have in our Ubuntu 22.04. The connection detail is displayed when the command is executed.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"714\" height=\"427\" class=\"wp-image-18933\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-9.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-9.jpeg 714w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-9-300x179.jpeg 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-9-501x300.jpeg 501w\" sizes=\"auto, (max-width: 714px) 100vw, 714px\" \/><\/strong><\/p>\n<p>With the sudo privilege, we have set the static IP address with the nmcli command. We have changed the wired connection name and also set the IPv4 address. The administrator permission is required to run the following command as shown in the Ubuntu 22.04 prompt screen.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"708\" height=\"58\" class=\"wp-image-18934\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-10.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-10.jpeg 708w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-10-300x25.jpeg 300w\" sizes=\"auto, (max-width: 708px) 100vw, 708px\" \/><\/strong><\/p>\n<p>The next <strong><em>nmcli<\/em><\/strong> command we have entered is for the DNS IP address for the static IP connection.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"40\" class=\"wp-image-18937\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-11.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-11.jpeg 707w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-11-300x17.jpeg 300w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><\/strong><\/p>\n<p>The configuration of the static IP connection is done. Now, we have given the two commands simultaneously. The command is for deactivation and activation of the wired connection. We have deactivated and also activated the connection here.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"698\" height=\"113\" class=\"wp-image-18939\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-12.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-12.jpeg 698w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-12-300x49.jpeg 300w\" sizes=\"auto, (max-width: 698px) 100vw, 698px\" \/><\/p>\n<p>With the \u201cip add show\u201d command, we have verified the connection\u2019s static IP address. The information of our static IP is displayed after we run the command.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"697\" height=\"290\" class=\"wp-image-18940\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-13.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-13.jpeg 697w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-13-300x125.jpeg 300w\" sizes=\"auto, (max-width: 697px) 100vw, 697px\" \/><\/strong><\/p>\n<p>We can also view the routing table of Ubuntu 22.04 by following the \u201cip route show\u201d command. The route table specifies the subnet and network traffic of our system. The current route table of Ubuntu 22.04 is below. By doing this, we may establish Ubuntu 22.04&#8217;s static IP.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"91\" class=\"wp-image-18943\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-14.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-14.jpeg 700w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18885-14-300x39.jpeg 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/strong><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>We have carried out the procedures of setting the static IP in our Ubuntu 22.04 using both the command line and a graphical user interface (GUI). It\u2019s all up to our preference whether to follow the steps of the GUI or the command line. From the GUI network setting of the current wired connection, we have configured the static IP. Then, we utilized the nmcli command for setting the static IP in Ubuntu 22.04. The most important thing is that we can revert the changes of the configuration of static IP to return to DHCP whenever we are required.<\/p>","protected":false},"excerpt":{"rendered":"<p>This article have carried out the procedures of setting the static IP in our Ubuntu 22.04 using both the command line and a graphical user interface (GUI).<\/p>","protected":false},"author":105,"featured_media":18950,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-18885","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/18885","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/105"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=18885"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/18885\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/18950"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=18885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=18885"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=18885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}