Archive for the ‘Ubuntu’ Category

ตั้งค่า Static IP ให้กับ Linux Ubuntu

#cd /etc/netplan# ls -l

#nano 50-cloud-init.yaml

network:
version: 2
ethernets:
ens160:
dhcp4: true
addresses:
– 192.168.100.22/24 # Replace with your desired IP and subnet
routes:
– to: default
via: 192.168.100.1 # Replace with your gateway IP
nameservers:
addresses:
– 8.8.8.8 # Google DNS
– 8.8.4.4 # Google DNS

 

# Restart Interface Card

#netplan apply

หรือให้ใช้งาน DHCP

network:
version: 2
ethernets:
ens160:      # Replace with your Interface name
dhcp4: true

#netplan apply