移至網頁之主要內容區位置
::: 桃園市桃園區文山國民小學

資訊組維修日誌_公告

network網路設定IP_netsh

{{ $t('FEZ002') }} 教務處|

cmd網路設定指令
動態的DHCP位址,後輸入下列的命令
>netsh interface ip set address "" dhcp

想要將設定改變回來,也就是想要將連線或是界面卡從DHCP設定的位址
改成靜態位址--可以輸入下面的命令:
netsh interface setaddress "" static
其中 ip_address 是您想要指定給連線的靜態IP位址.
netmask則是與IP位址相關的子網路遮罩(如255 255.255.O)
gateway則是本IP子網路預設的閘道器(如果有)
metrc則是選擇性的數字值(例如1、2),可以用來設定使用的預設閘道器(如果有)。

我先將網路設定打開的 "區域網路" 字樣改成 "Lan" 之後.

就可以在文字模式下 寫個快速的批次檔

使用DHCP, 批次檔名為 dhcp.bat

netsh interface ip set address Lan dhcp

使用固定IP, 指定IP為 163.15.196.50 網路遮罩(Netmask)為 255.255.255.0 閘道(Gateway)為 163.15.196.254 的語法為

netsh interface ip set address Lan static 163.15.196.50 255.255.255.0 163.15.196.254 1

如果要設定DNS, 則指令為
netsh interface ip set dns     "Lan" static 10.10.1.1 primary
或者
netsh interface ip set dnsserver     "Lan" static 10.10.1.1 primary

{{ $t('FEZ013') }}


{{ $t('FEZ003') }} Invalid date

{{ $t('FEZ004') }} 2022-04-07|

{{ $t('FEZ005') }} 760|