Windows—Routing_Table

Situation

# 觀察Windows的路由表變化
To observe changes in the Windows routing table.

Solution

[1]
# 開啟CMD
Win + R > CMD > Type "route print"

[2]
# 新增靜態路由,設定Metric但Windows算出來的會不一樣,重開機會被重製
route add "Network" MASK 255.255.255.0 "Gateway" metric "正整數" IF "網卡介面Index"

# 永久新增靜態路由
route -p add 192.168.2.0 mask 255.255.255.0 192.168.2.254 metric 1 if 4

[3]
# 如何查詢網卡Index
CMD > type "netsh interface ipv4 show interfaces"