A-A+
windows 配置默认网关(路由)的方法
windows自身的表述再形象不过了。
语法格式:ROUTE [-f] [-p] [command [destination] [MASK netmask] [gateway] [METRIC metric] [IF interface]
- ROUTE [-f] [-p] [command [destination] [MASK netmask] [gateway] [METRIC metric] [IF interface]
- command One of these:
- PRINT Prints a route
- ADD Adds a route
- DELETE Deletes a route
- CHANGE Modifies an existing route
- >route
- > route PRINT
- > route ADD 157.0.0.0 MASK 255.0.0.0 157.55.80.1 METRIC 3 IF 2
- > route PRINT
- > route PRINT 157* .... Only prints those matching 157*
- > route CHANGE 157.0.0.0 MASK 255.0.0.0 157.55.80.5 METRIC 2 IF 2
- CHANGE is used to modify gateway and/or metric only.
- > route PRINT
- > route DELETE 157.0.0.0
- > route PRINT
- > route -f (会清除路由表信息,重启后还是生效的。使用
- ipconfig命令显示有ip,没有网关,机器也不能上网。)
- > route add 0.0.0.0 mask 0.0.0.0 192.168.0.2 metric 1 if 2 (重启后,设置失效)
- > route -p add 0.0.0.0 mask 0.0.0.0 192.168.0.2 metric 1 if 2