{"id":169202,"date":"2026-06-19T08:29:51","date_gmt":"2026-06-19T05:29:51","guid":{"rendered":"https:\/\/computingforgeeks.com\/?p=169202"},"modified":"2026-06-19T08:29:51","modified_gmt":"2026-06-19T05:29:51","slug":"opensuse-leap-static-ip-nmcli","status":"publish","type":"post","link":"https:\/\/computingforgeeks.com\/opensuse-leap-static-ip-nmcli\/","title":{"rendered":"Set Up a Static IP Address on openSUSE Leap 16"},"content":{"rendered":"<p>A server that gets its address from DHCP is fine until the lease changes and every firewall rule, DNS record, and SSH config that pointed at it goes stale. For anything other hosts connect to, you want a fixed address. On openSUSE Leap 16 the network is managed by NetworkManager, so the clean way to set a static IP is <code>nmcli<\/code>, editing the connection profile rather than dropping ifcfg files the way older SUSE releases did.<\/p>\n\n<p>We ran every command below on a Leap 16 host in June 2026, so the output is real. The approach is the same whether this is a bare-metal server, a VM, or a cloud instance with a NetworkManager-managed NIC.<\/p>\n\n<h2>Find the interface and its connection profile<\/h2>\n\n<p>NetworkManager separates the physical device from the connection profile applied to it, and <code>nmcli<\/code> edits the profile, not the device. So start by listing both:<\/p>\n\n\n<pre class=\"wp-block-code code\"><code>nmcli device status<\/code><\/pre>\n\n\n<p>The output pairs each device with the profile currently bound to it:<\/p>\n\n\n<pre class=\"wp-block-code code\"><code>DEVICE   TYPE      STATE      CONNECTION\nenp6s18  ethernet  connected  Wired connection 1<\/code><\/pre>\n\n\n<p>Here the device is <code>enp6s18<\/code> and the profile is <code>Wired connection 1<\/code>. That profile name has spaces in it, which is the single most common reason these commands fail, so it must be quoted every time it appears below. Your device and profile names will differ; use what this command reports.<\/p>\n\n<h2>Decide static at the host or a reservation at the DHCP server<\/h2>\n\n<p>There are two ways to give a host a fixed address, and the right one depends on where you want the source of truth. Pinning the address on the host, which is what this guide does, keeps the configuration with the machine and works even on a network you do not control. A DHCP reservation instead binds the address to the NIC&#8217;s MAC at the DHCP server, which centralizes management across many hosts but means the address lives in someone else&#8217;s config. In practice, pin it on the host for servers you administer directly, and use reservations when a central team owns the network. The trade-off is autonomy versus central control.<\/p>\n\n<h2>Set the static address<\/h2>\n\n<p>One <code>nmcli connection modify<\/code> call sets the address, gateway, DNS servers, and switches the profile from DHCP to manual. Pick an address outside your DHCP pool so the server cannot hand it to another machine:<\/p>\n\n\n<pre class=\"wp-block-code code\"><code>sudo nmcli connection modify \"Wired connection 1\" ipv4.addresses 192.168.1.50\/24 ipv4.gateway 192.168.1.1 ipv4.dns \"1.1.1.1,8.8.8.8\" ipv4.method manual<\/code><\/pre>\n\n\n<p>A few details matter here. The address carries its prefix as <code>\/24<\/code>, not a separate netmask. Multiple DNS servers go in one quoted, comma-separated value. And <code>ipv4.method manual<\/code> is the switch that tells NetworkManager to stop asking DHCP; set the addresses but forget this and the profile stays on DHCP. The command writes the profile but does not apply it yet.<\/p>\n\n<h2>Apply and verify<\/h2>\n\n<p>Bring the connection up to activate the change. If you are setting the static address to the same value the host already holds, the session continues uninterrupted. If you are switching to a different address while connected over SSH, run this from the console instead, or expect to reconnect on the new IP:<\/p>\n\n\n<pre class=\"wp-block-code code\"><code>sudo nmcli connection up \"Wired connection 1\"<\/code><\/pre>\n\n\n<p>NetworkManager confirms the activation:<\/p>\n\n\n<pre class=\"wp-block-code code\"><code>Connection successfully activated<\/code><\/pre>\n\n\n<p>Confirm the profile now holds the values you set:<\/p>\n\n\n<pre class=\"wp-block-code code\"><code>nmcli -f ipv4.method,ipv4.addresses,ipv4.gateway connection show \"Wired connection 1\"<\/code><\/pre>\n\n\n<p>The method reads <code>manual<\/code> and the address is fixed:<\/p>\n\n\n<pre class=\"wp-block-code code\"><code>ipv4.method:     manual\nipv4.addresses:  192.168.1.50\/24\nipv4.gateway:    192.168.1.1<\/code><\/pre>\n\n\n<p>The clearest proof is the routing table, where the default route flips from <code>proto dhcp<\/code> to <code>proto static<\/code> once the change applies:<\/p>\n\n\n<pre class=\"wp-block-code code\"><code>ip route | grep default<\/code><\/pre>\n\n\n<p>The origin field reads <code>static<\/code> instead of <code>dhcp<\/code>, which is the definitive sign the change is live:<\/p>\n\n\n<pre class=\"wp-block-code code\"><code>default via 192.168.1.1 dev enp6s18 proto static metric 100<\/code><\/pre>\n\n\n<p>The screenshot below shows the device lookup, the modify command, and the verification together.<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1020\" height=\"520\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/wm-nmcli-static-ip-opensuse-leap.png\" alt=\"nmcli connection modify static IP gateway DNS on openSUSE Leap 16 terminal\" class=\"wp-image-169201\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/wm-nmcli-static-ip-opensuse-leap.png 1020w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/wm-nmcli-static-ip-opensuse-leap-300x153.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/wm-nmcli-static-ip-opensuse-leap-768x392.png 768w\" sizes=\"auto, (max-width: 1020px) 100vw, 1020px\" \/><\/figure>\n\n\n<p>Switching back is a single profile change when a host no longer needs a fixed address.<\/p>\n\n<h2>Revert to DHCP if you need to<\/h2>\n\n<p>If you need to hand the address selection back to DHCP, switch the method to auto and clear the manual values so they do not linger in the profile:<\/p>\n\n\n<pre class=\"wp-block-code code\"><code>sudo nmcli connection modify \"Wired connection 1\" ipv4.method auto ipv4.addresses \"\" ipv4.gateway \"\" ipv4.dns \"\"\nsudo nmcli connection up \"Wired connection 1\"<\/code><\/pre>\n\n\n<p>The method returns to <code>auto<\/code> and the default route goes back to <code>proto dhcp<\/code>. Clearing the values matters: leave a stale <code>ipv4.gateway<\/code> behind and you can end up with a host that pulls a DHCP address but still tries to route through an old gateway.<\/p>\n\n<h2>What to watch in production<\/h2>\n\n<p>Two things bite once a static host is live. First, the DNS you set on the profile is the only resolver the host has; if it points at a single internal server and that server is down, name resolution fails completely, so give it a second resolver as we did with the two addresses above. Second, a static address only helps if nothing else on the network can claim it, so confirm the address sits outside the DHCP pool and document it wherever you track host addresses. From here, lock the host down with the <a href=\"https:\/\/computingforgeeks.com\/opensuse-leap-initial-server-setup\/\">initial server setup and hardening<\/a> steps, and if you prefer a browser over the terminal, <a href=\"https:\/\/computingforgeeks.com\/cockpit-web-console-opensuse-leap\/\">Cockpit<\/a> can edit the same NetworkManager profile from its Networking page.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A server that gets its address from DHCP is fine until the lease changes and every firewall rule, DNS record, and SSH config that pointed at it goes stale. For anything other hosts connect to, you want a fixed address. On openSUSE Leap 16 the network is managed by NetworkManager, so the clean way to &#8230; <a title=\"Set Up a Static IP Address on openSUSE Leap 16\" class=\"read-more\" href=\"https:\/\/computingforgeeks.com\/opensuse-leap-static-ip-nmcli\/\" aria-label=\"Read more about Set Up a Static IP Address on openSUSE Leap 16\">Read more<\/a><\/p>\n","protected":false},"author":17,"featured_media":169203,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[299,47,50],"tags":[282,223,9986],"cfg_series":[39887],"class_list":["post-169202","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to","category-linux","category-linux-tutorials","tag-linux","tag-linux-networking","tag-opensuse","cfg_series-opensuse-leap-16"],"_links":{"self":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/169202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/comments?post=169202"}],"version-history":[{"count":1,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/169202\/revisions"}],"predecessor-version":[{"id":169224,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/169202\/revisions\/169224"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media\/169203"}],"wp:attachment":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media?parent=169202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/categories?post=169202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/tags?post=169202"},{"taxonomy":"cfg_series","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/cfg_series?post=169202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}