ubuntu20.04 set static IP (wired connection and unlimited connection two setting methods)
1. Wired connection
Open the terminal and type: ip addr
view card, wired LAN: enp1s0
Wireless LAN: wlp2s0
enter the catalog: cd /etc/netplan/
,
terminal input: sudo vi 01-network-manager-all.yaml
edit
:wq
Save and exit, apply the settings, enter in the terminal:sudo netplan apply
2. Wireless connection
Configure a static IP address on the Ubuntu desktop
In the "Activity" screen, search for "Settings" and click the icon. This will open the GNOME settings window. According to the interface to be modified, click on the "Network" or "Wi-Fi" tab. To open the interface settings, click the gear icon next to the interface name.
In the "IPV4" method tab, select "Manual" and then enter your static IP address, netmask and gateway. When finished, click the "Apply" button.
Done!
Hope to help you!