How to Configure Static IP Address on Ubuntu 22.04 LTS and 22.10
Reading Time: 3 minutesSwitching from dynamic IP allocation to static IP addresses is easy on Ubuntu 22.04 ‘Jammy Jellyfish’ and 22.10.
The IP address of most devices today is generated by the Dynamic Host Configuration Protocol (DHCP) server. A DHCP server assigns a dynamic IP address to your device when it’s connected to a network. Thus, you have the chance to change this IP address from time to time.
On the other hand, a static IP refers to a fixed, immutable address, different from dynamic IPs. You can set static IP settings for Ubuntu versions 22.04 LTS and 22.10 in three different ways. Here’s how to get started.
Set a Static IP on Ubuntu With the nmcli Command
It’s pretty easy to configure Ubuntu 22.04 static IP settings using the nmcli command. nmcli is a text-based utility used to check the status of the wired connections you are using on your device.
With this command, you can access additional networking information such as your connection status, the name of your host device, and general permissions in your network configuration. Also, this command is very useful in your Ubuntu server static IP settings.
You can get information about your connection with the following command:
nmcli connection show
The output of this command will be as follows:
NAME UUID TYPE DEVICE
Wired connection 1 12f312a7-f0e7-334a-8ab4-c7b3f8249c7e ethernet enp0s3
Create a static link with the command given below. Then, manually configure the enp0s3 and ipv4 settings with the appropriate parameters in the nmcli command:
sudo nmcli con add type ethernet con-name 'static' ifname enp0s3 ipv4.method manual ipv4.addresses 192.168.1.89/24 gw4 192.168.1.1
If you use the nmcli connection show command again, you can see that the static link has been added.
After this process, add the static connection you created to the DNS IP:
sudo nmcli con mod static ipv4.dns 192.168.*.*
Now use the command below to activate the connection:
sudo nmcli con up id 'static'
If the output displays ‘connection successfully activated,’ you’ve successfully set up a static IP address on your machine.
You can verify the static IP you want to assign to your device by running the following command:
ip route
Using Netplan for Static IP Settings on Ubuntu
Just like nmcli, another command you can use for setting a static IP on Ubuntu is netplan. You can easily make Ubuntu static IP settings using the netplan command in 22.04 LTS and 22.10 versions. To do this, follow the steps below.
First, find out the name of your network interface using the command below:
sudo ip a
What you see here is your network interface name. This name may be different on each device.
Now, create a file named 01-netcfg.yaml in the /etc/netplan folder. Edit it with your favorite text editor.
sudo vim /etc/netplan/01-netcfg.yaml
Add the following lines to the file:
network:
version: 2
renderer: networkd
ethernets:
eth0: #Edit this line according to your network interface name.
dhcp4: no
addresses:
- 192.168.1.10/24
gateway4: 192.168.1.1
nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4
As you can see, you have disabled the DHCP IP setting with the dhcp4: no statement. You’ve then added the IP address and DNS settings assigned by Google.
After saving this file, run the following command to apply the changes:
sudo netplan apply
Configure Static IP Settings on Ubuntu Graphically
The graphical network interface in Ubuntu 22.04 is quite useful if you don’t want to use the command line. So much so that you can easily set the Ubuntu static IP address using this interface.
To do this, click on the Network icon in the upper right corner of your desktop. Then, select Wired Settings from the drop-down menu. Click on the Gear icon to open the settings window.
Then, switch to the IPv4 tab in the window that opens.
As you can see, DHCP is enabled by default. Change the IPv4 Method to Manual as you want to use a static IP instead of a dynamic one. Next, change your address, netmask, and gateway settings. Finally, modify your DNS setting and click the Apply button.
You must restart this wired connection for all these actions to take effect. To do this, simply toggle the switch next to the network name on and then off.
Why Should You Use Static IP Addresses?
You learned how to configure static IP settings in ‘Jammy Jellyfish’ 22.04, the latest LTS version of Ubuntu, and 22.10, using both the graphical settings interface and the two terminal commands: nmcli and netplan. Also, now you know how to set a static IP on Ubuntu server 22.04.
Due to insufficient IP addresses, some service providers may assign the same address to two different users. In this case, connection problems can occur. Using static IP addresses instead does not cause such problems as it is user-specific, but beware as someone can misuse your IP address in several ways.
Reference: https://www.makeuseof.com/configure-static-ip-address-settings-ubuntu-22-04/
Ref: makeuseof
MediaDownloader.net -> Free Online Video Downloader, Download Any Video From YouTube, VK, Vimeo, Twitter, Twitch, Tumblr, Tiktok, Telegram, TED, Streamable, Soundcloud, Snapchat, Share, Rumble, Reddit, PuhuTV, Pinterest, Periscope, Ok.ru, MxTakatak, Mixcloud, Mashable, LinkedIn, Likee, Kwai, Izlesene, Instagram, Imgur, IMDB, Ifunny, Gaana, Flickr, Febspot, Facebook, ESPN, Douyin, Dailymotion, Buzzfeed, BluTV, Blogger, Bitchute, Bilibili, Bandcamp, Akıllı, 9GAG