Canonical ได้ทำการเปลี่ยนแปลง Network บน Ubuntu ตั้งแต่เวอร์ชั่น 17.04 ครั้งใหญ่ทำให้การตั้งค่า Network ทำได้ง่ายขึ้น โดยกำหนด Configuration แบบ YAML File ด้วย Netplan ซึ่งมันจะทำการเลือก Renderer Tool ที่เหมาะสม
แสดง Network Interface
ifconfig -a
ทำการแก้ไขไฟล์ /etc/netplan/01-netcfg.yaml
vi /etc/netplan/01-netcfg.yaml
network: version: 2 renderer: networkd ethernets: eth0: dhcp4: no addresses: [192.168.1.10/24] gateway4: 192.168.1.1 nameservers: addresses: [8.8.8.8, 8.8.4.4]
ทำการ Apply
netplan apply
แก้ไขไฟล์ /etc/hosts
vi /etc/hosts
::1 localhost 127.0.0.1 localhost 192.168.1.10 lab-ubuntu.lab.local lab-ubuntu
ทำการกำหนด Hostname
hostnamectl set-hostname lab-ubuntu.lab.local
Last updated 1 year ago
Was this helpful?
อ่านเพิ่มเติม :