close

近日因協助某銀行新機安裝,
須手動設定DNS及WINS,
雖不困難但想做的更有效率,
於是就將之前相關文章找出來查閱,
各位也可於command line 輸入netsh指令,
再下?號即可查閱相關指令說明列表,
以下我僅介紹基本用法。

1.設定 IP Address:
   netsh interface ip set address "網卡裝置名稱" [source] [ip address] [subnet mask]
   [gateway] [gwmetric]
   source=dhcp、static,後面的欄位為static時才可使用,如要設定gateway則gwmetric
   需設值為1。
   ex.
   netsh interface ip set address "區域連線" dhcp
   netsh interface ip set address "區域連線" static 192.168.1.10 255.255.255.0
   192.168.1.254 1

2.設定DNS:
   netsh interface ip set dns "網卡裝置名稱" [source] [dns address]
   ex.
   netsh interface ip set dns "區域連線" dhcp
   netsh interface ip set dns "區域連線" static 192.168.1.1
   此設定方式只能設定一筆DNS,無法追加第二筆DNS,以下說明如何追加第二、三筆,
   甚至更多筆。
   netsh interface ip add dns "網卡裝置名稱" [dns address] [index]
   index為第N筆的值,若為2即為第二筆DNS。
   ex.
   netsh interface ip add dns "區域連線" 192.168.1.100 2

3.設定WINS:
   netsh interface ip set wins "網卡裝置名稱" [source] [ address]
   ex.
   netsh interface ip set wins "區域連線" static 192.168.1.5
   此設定方式只能設定一筆WINS,如要追加則與DNS追加方式相同。
   ex.
   netsh interface ip add wins "區域連線" 192.168.1.105 2

最後再利用Notepad將需要執行之指令打上,在更改副檔名為.bat執行即可自動完成。

arrow
arrow
    全站熱搜

    sirano7164 發表在 痞客邦 留言(1) 人氣()