Home > Article > Computer Tutorials > How to set a fixed IP address on Ubuntu 22.04 system.
To set a fixed IP address on Ubuntu 22.04, you can follow the steps below:
Open the terminal and edit the network configuration file with administrator privileges:
sudo nano /etc/netplan/00-installer-config.yaml
In the file, you will see a configuration similar to:
network: ethernets: enp0s3: dhcp4: true version: 2
dhcp4: true
modified to dhcp4: no
, to disable DHCP and enable manual configuration. Add static IP address configuration, for example:
network: ethernets: enp0s3: addresses: [192.168.0.100/24] gateway4: 192.168.0.1 nameservers: addresses: [8.8.8.8, 8.8.4.4] version: 2
Replace enp0s3
with your network interface name. Specify the fixed IP address, subnet mask, gateway and DNS server address you want to use.
Apply new network configuration:
sudo netplan apply
Restart network service:
sudo systemctl restart systemd-networkd
After completing the above steps, your Ubuntu 22.04 system will use the fixed IP address you specified for network connection. Please ensure that the selected IP address does not conflict with other devices on the network and is configured appropriately according to your network environment.
Please note that depending on the Ubuntu version and network management tool you are using, the location and naming of the network configuration file may change, and corresponding adjustments may be required.
The above is the detailed content of How to set a fixed IP address on Ubuntu 22.04 system.. For more information, please follow other related articles on the PHP Chinese website!