2023年11月21日 星期二

在windows 設定多個IP

 

因為Windows 11 22H2 112/‎1/‎21 22621.2715找不到以前可以設定多個IP,所以使用Command line的方式增加IP設定,使用"netsh"

使用方式: netsh [-a AliasFile] [-c Context] [-r RemoteMachine] [-u [DomainName\]UserName] [-p Password | *]
             [Command | -f ScriptFile]

exp:
設定IP
netsh interface ip set address "3USB-1N-White" static 10.254.1.25 255.255.255.0

增加IP
netsh interface ip add address "3USB-1N-White" 10.254.1.25 255.255.255.0

 
增加多個IP
netsh interface ip set address "3USB-1N-White" static 10.254.1.25 255.255.255.0

netsh interface ip add address "3USB-1N-White" 10.254.2.25 255.255.255.0
netsh interface ip add address "3USB-1N-White" 10.254.3.25 255.255.255.0
...

如果要設定包含gateway
netsh interface ip set address "3USB-1N-White" 10.254.1.25 255.255.255.0 10.254.1.1
netsh interface ip add address "3USB-1N-White" 10.254.2.25 255.255.255.010.254.2.1
netsh interface ip add address "3USB-1N-White" 10.254.3.25 255.255.255.010.254.3.1
...

netsh ?可查詢所有可用的命令:

這個內容中的命令:
?              - 顯示命令清單。
add            - 新增項目清單中的設定項目。
advfirewall    - 變更到 `netsh advfirewall' 內容。
bridge         - 變更到 `netsh bridge' 內容。
delete         - 刪除項目清單中的設定項目。
dhcpclient     - 變更到 `netsh dhcpclient' 內容。
dnsclient      - 變更到 `netsh dnsclient' 內容。
dump           - 顯示設定指令檔。
exec           - 執行指令檔。
firewall       - 變更到 `netsh firewall' 內容。
help           - 顯示命令清單。
http           - 變更到 `netsh http' 內容。
interface      - 變更到 `netsh interface' 內容。
ipsec          - 變更到 `netsh ipsec' 內容。
lan            - 變更到 `netsh lan' 內容。
mbn            - 變更到 `netsh mbn' 內容。
namespace      - 變更到 `netsh namespace' 內容。
netio          - 變更到 `netsh netio' 內容。
nlm            - 變更到 `netsh nlm' 內容。
p2p            - 變更到 `netsh p2p' 內容。
ras            - 變更到 `netsh ras' 內容。
rpc            - 變更到 `netsh rpc' 內容。
set            - 更新組態設定。
show           - 顯示資訊。
trace          - 變更到 `netsh trace' 內容。
wcn            - 變更到 `netsh wcn' 內容。
wfp            - 變更到 `netsh wfp' 內容。
winhttp        - 變更到 `netsh winhttp' 內容。
winsock        - 變更到 `netsh winsock' 內容。
wlan           - 變更到 `netsh wlan' 內容。

下列是可使用的子內容:
 advfirewall bridge dhcpclient dnsclient firewall http interface ipsec lan mbn namespace netio nlm p2p ras rpc trace wcn wfp winhttp winsock wlan

如果您要檢視命令的說明,請輸入該命令,後面接著一個空格,
 然後輸入 ?。

2023年7月21日 星期五

windows 11 開啟Wireshark 顯示網卡錯誤,"turn off promiscuous mode"

 在windows11更換Wireshark到4.0.7版,結果開啟時發生錯誤,如下圖



要如何關閉promiscuous mode呢?

我是由windows 10 升級到windows 11的,查詢網路後有效的解決方法如下

將網卡的驅動程式更換成舊的

操作如下,避免下次狀況又來(USB轉RS232也是如此)
開啟檔案總管,選擇本機按右鍵,選擇顯示其他選項,選擇管理,選擇裝置管理員,選網路介面卡,選到有問題的網卡名稱。

按右鍵,選擇更新驅動程式,選擇瀏覽電腦上的驅動程式,再選擇讓我從電腦上的可用驅動程式清單中挑選,選擇網卡公司的驅動程式(盡量不要選擇microsoft的),更新完成後再開啟Wireshark選擇原來有問題的網卡,如果還是不行,請再重複以上動作,直到選擇到可以正常使用Wireshark 為止。
我使用這方式是OK的,所以記錄下來提供參考,如果試過不行的,請再爬其他的,如果最後成功了也請分享給大家,否則一出狀況,搞個好幾天也是很煩。祝順利!