1.在windows中, 可以使用route 命令来更改默认网关
route add [-p] 0.0.0.0. mask0.0.0.010.112.76.232
2.介绍route语法,及其使用实例:
语法:
route [-f] [-p] [Command[Destination] [mask Network] [Gateway][metric Metric]] [if Interface]]
-p : persistent 持久稳固的
例子:
显示IP路由:
route print
显示路由表中10开头的:
route print 10.*
添加192.168.12.1为默认网关的路由:
route add 0.0.0.0 mask 0.0.0.0 192.168.12.1
添加路由: 目的为:10.41.0.0子网:255.255.0.0 下一跳为:10.27.0.1
route add 10.41.0.0 mask 255.255.0.0 10.27.0.1
添加永久路由
route -p add 10.41.0.0 mask 255.255.0.0 10.27.0.1
route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 metric 7
route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 if 0×3
删除路由:
route delete 10.41.0.0 mask 255.255.0.0
删除所有以10开头的路由
route delete 10.*
将(10.41.0.0 mask 255.255.0.0)的路由改为10.27.0.25:
route change 10.41.0.0 mask 255.255.0.0 10.27.0.25