Cấu hình IP tĩnh Ubuntu Server
Truy cập thư mục:
1#cd /etc/netplan
Sử dụng vi:
1#vi 00-installer-config.yaml
Bấm “i” để chỉnh sửa thông tin IP, chỉnh sửa xong nhấn “Esc” và nhấn :wq! để lưu lại và thoát khung thao tác
# This is the network config written by 'subiquity'
network:
ethernets:
eth0:
dhcp: no
addresses: [192.168.24.100/24]
gateway4: 192.168.24.1
nameservers:
addresses: [8.8.8.8]
version: 2
Sử dụng lệnh:
1# sudo netplan apply
Có thể dùng lệnh để khởi động lại dịch vụ hoặc reboot Server
Kiểm tra lại IP:
1#ip