wifi怎么綁定ip(Windows下使用netsh命令設(shè)置ip和wifi網(wǎng)絡(luò))
一、使用netsh命令設(shè)置IP/DNS
1、自動(dòng)獲取IP地址:
netsh interface ip set address [name=]"以太網(wǎng)" [source=]dhcp
2、手動(dòng)設(shè)置IP地址:例如設(shè)置 IP 為 192.168.1.198,掩碼為255.255.255.0,網(wǎng)關(guān)為192.168.0.254,那么 cmd 命令為:
netsh interface ip set address [name=]"本地連接" [source=]static [addr=]192.168.1.198 [mask=]255.255.255.0 [gateway=]192.168.0.254 [gwmetric=]1
name:網(wǎng)絡(luò)連接名稱(chēng),一般為“本地連接”。你可以在“控制面板” -> “網(wǎng)絡(luò)連接”中看到
source:獲取 IP 的途徑。動(dòng)態(tài)獲取,則為 dhcp;手動(dòng)設(shè)置,則為 static
addr:要設(shè)置的 IP 地址
mask:要設(shè)置的子網(wǎng)掩碼
gateway:要設(shè)置的網(wǎng)關(guān)地址
gwmetric:網(wǎng)關(guān)躍點(diǎn)數(shù),可以設(shè)置為整型數(shù)值,也可以設(shè)置為 auto
二、使用netsh命令連接wifi
1、顯示本機(jī)保存的 profiles,配置文件是以 wifi 的 ssid 命名的:
netsh wlan show profiles
2、然后連接其中一個(gè) profile:
netsh wlan connect name=xxxxx
3、斷開(kāi)連接
netsh wlan disconnect [[interface=]
如果系統(tǒng)中有兩個(gè)或多個(gè)可用接口,則參數(shù) interface 是必需的,否則無(wú)需指定參數(shù) interface??梢栽诮涌诿Q(chēng)中使用通配符字符以便指定多個(gè)接口。
三、netsh wlan幫助信息
四、其他netsh命令
其它常用的 netsh 命令:
設(shè)置配置文件屬性:Netsh WLAN set profileparameter name="" connectionmode=manual
列出配置文件:netsh wlan show profile
導(dǎo)出配置文件:netsh wlan export profile key=clear
刪除配置文件:netsh wlan delete profile name=""
添加配置文件:netsh wlan add profile filename=""
連接指定wifi:netsh wlan connect name="wifi name"
列出無(wú)線(xiàn)接口:netsh wlan show interface
開(kāi)啟無(wú)線(xiàn)接口:netsh interface set interface "Interface Name" enabled
禁用無(wú)線(xiàn)接口:netsh interface set interface "Interface Name" disable
五、使用netsh命令查看所有連接過(guò)的WIFI密碼
輸入命令:netsh wlan show profiles name="profileName" key=clear,就可以查看到某個(gè)具體 WiFi 的配置詳情,包括密碼。