การ fix IP Address บน Debian Linux

การ fix IP Address บน Debian Linux

การตรวจสอบบริการ Network ที่ Debian ใช้อยู่

ตั้งแต่ Debian 9 ขึ้นไป ระบบเครือข่ายใช้ systemd-networkd หรือ NetworkManager แล้วแต่การตั้งค่า

– เช็กว่าเครื่องใช้ NetworkManager ไหม

systemctl status NetworkManager

– เช็กว่าใช้ systemd-networkd ไหม

systemctl status systemd-networkd
 

ตรวจสอบว่าระบบได้ IP หรือยัง

– หลังจาก restart network ให้ตรวจสอบ:

ip a

– ดูสถานะ routing

ip route

– ทดสอบ DNS

dig google.com

หรือ

nslookup google.com

– ลองตรวจอุปกรณ์

ip link
  • ถ้ายังไม่เห็น ให้ตรวจ dmesg
dmesg | grep -i enp0s3

แล้วตรวจว่า VirtualBox / VMware / Hyper-V เปิด Network Adapter ไว้หรือไม่


หากต้องการ Static IP สำหรับ enp0s3

ตัวอย่างสำหรับระบบ legacy /etc/network/interfaces

auto enp0s3
iface enp0s3 inet static
address 192.168.1.20
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1 8.8.8.8 1.1.1.1
 

รีสตาร์ท

sudo systemctl restart networking
 

– ตรวจสอบสถานะ

ip a show enp0s3
 
—–
SYSADMIN KNOWLEDGE
https://www.sysadmin.in.th