Nội dung
1. Change Hostname
hostnamectl set-hostname newhostname
2. Change IP Address trên Ubuntu 20.04 LTS
- Tạo một file /etc/netplan/01-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: no
addresses:
- 192.168.121.221/24
gateway4: 192.168.121.1
nameservers:
addresses: [8.8.8.8, 1.1.1.1]
- Apply changes
netplay apply
3. Change IP Address trên Ubuntu 22.04 LTS
Có sự thay đổi trên Ubuntu 22.04
- Tạo một file /etc/netplan/01-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: no
addresses:
- 192.168.121.221/24
routes:
- to: default
via: 192.168.121.1
nameservers:
addresses: [8.8.8.8, 1.1.1.1]
- Apply changes
netplay apply