DHCP ให้ IP เปลี่ยนไปเรื่อยๆ ทำให้ Share ไฟล์/Printer หรือ Port Forwarding ยุ่งยาก การตั้ง Static IP ช่วยจัดการอุปกรณ์ในเครือข่ายง่ายขึ้น
4 วิธีตั้ง Static IP ใน Windows 11/10
- Control Panel (Classic)
- Windows Settings (Modern)
- PowerShell
- Command Prompt (netsh)
1. Control Panel
- คลิกขวาไอคอน Network/Taskbar > Open Network & Internet settings
- Wi-Fi settings > Related Settings > Change adapter options
- คลิกขวา Adapter ที่ใช้ > Properties
- เลือก Internet Protocol Version 4 (TCP/IPv4) > Properties
- เลือก Use the following IP address กรอก:
IP Address (จากipconfig /all)
Subnet Mask (บ้านทั่วไป 255.255.255.0)
Default Gateway (IP Router) - ติ๊ก 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" staticnetsh interface ip set dns name="Ethernet0" static exit
เปลี่ยน "Ethernet0" เป็นชื่อ Adapter จริง (ดูจาก ipconfig)
Static IP คืออะไร? ใช้ทำไม?
IP ที่ไม่เปลี่ยน ใช้กับ Server/อุปกรณ์สำคัญ ช่วย Remote Access (VPN), VoIP, Port Forwarding ให้เสถียร