A-A+

windows 配置默认网关(路由)的方法

2015年11月26日 站长资讯 暂无评论

windows自身的表述再形象不过了。

语法格式:ROUTE [-f] [-p] [command [destination] [MASK netmask] [gateway] [METRIC metric] [IF interface]

  1. ROUTE [-f] [-p] [command [destination]  [MASK netmask]  [gateway] [METRIC metric]  [IF interface]  
  2.    
  3. command      One of these:  
  4.                  PRINT     Prints  a route  
  5.                  ADD       Adds    a route  
  6.                  DELETE    Deletes a route  
  7.                  CHANGE    Modifies an existing route  
  8.    
  9. >route   
  10. > route PRINT  
  11. > route ADD 157.0.0.0 MASK 255.0.0.0  157.55.80.1 METRIC 3 IF 2  
  12. > route PRINT  
  13. > route PRINT 157*          .... Only prints those matching 157*  
  14. > route CHANGE 157.0.0.0 MASK 255.0.0.0 157.55.80.5 METRIC 2 IF 2  
  15.    
  16.   CHANGE is used to modify gateway and/or metric only.  
  17. > route PRINT  
  18. > route DELETE 157.0.0.0  
  19. > route PRINT  
  20. > route -f        (会清除路由表信息,重启后还是生效的。使用  
  21.                     ipconfig命令显示有ip,没有网关,机器也不能上网。)  
  22. > route add 0.0.0.0 mask 0.0.0.0 192.168.0.2 metric 1 if 2 (重启后,设置失效)  
  23. > route -p add 0.0.0.0 mask 0.0.0.0 192.168.0.2 metric 1 if 2  
标签:

给我留言