Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบ >> Windows

วิธีตั้งค่า Static IP Address (IP คงที่) ใน Windows 11/10

DHCP ให้ IP เปลี่ยนไปเรื่อยๆ ทำให้ Share ไฟล์/Printer หรือ Port Forwarding ยุ่งยาก การตั้ง Static IP ช่วยจัดการอุปกรณ์ในเครือข่ายง่ายขึ้น

4 วิธีตั้ง Static IP ใน Windows 11/10

  1. Control Panel (Classic)
  2. Windows Settings (Modern)
  3. PowerShell
  4. Command Prompt (netsh)

1. Control Panel

  1. คลิกขวาไอคอน Network/Taskbar > Open Network & Internet settings
  2. Wi-Fi settings > Related Settings > Change adapter options
  3. คลิกขวา Adapter ที่ใช้ > Properties
  4. เลือก Internet Protocol Version 4 (TCP/IPv4) > Properties
  5. เลือก Use the following IP address กรอก:
    IP Address (จาก ipconfig /all)
    Subnet Mask (บ้านทั่วไป 255.255.255.0)
    Default Gateway (IP Router)
  6. ติ๊ก Validate settings upon exit > OK

2. Windows Settings

Windows 11: Settings > Network & Internet > Wi-Fi > Current connection > IP assignment Edit > Manual > IPv4 On > กรอก IP, Subnet prefix length (24 = 255.255.255.0), Gateway, DNS > Save

Windows 10: Settings > Network & Internet > Wi-Fi > Current connection > IP settings Edit > Manual > IPv4 On > กรอกข้อมูลเหมือนกัน

3. PowerShell (Admin)

Get-NetIPConfiguration  # ดู InterfaceIndex, IPv4Address, Gateway, DNS
New-NetIPAddress -InterfaceIndex 15 -IPAddress 192.168.29.34 -PrefixLength 24 -DefaultGateway 192.168.29.1
Set-DnsClientServerAddress -InterfaceIndex 15 -ServerAddresses 10.1.2.1

เปลี่ยน InterfaceIndex, IP, Gateway, DNS ให้ตรงเครื่องคุณ

4. Command Prompt (Admin) - netsh

ipconfig /all  # บันทึก IPv4, Subnet, Gateway, DNS
netsh interface ip set address name="Ethernet0" static   
netsh interface ip set dns name="Ethernet0" static 
exit

เปลี่ยน "Ethernet0" เป็นชื่อ Adapter จริง (ดูจาก ipconfig)

Static IP คืออะไร? ใช้ทำไม?

IP ที่ไม่เปลี่ยน ใช้กับ Server/อุปกรณ์สำคัญ ช่วย Remote Access (VPN), VoIP, Port Forwarding ให้เสถียร