cmd下解决网关问题

时间:2008-08-29 22:09:21   来源:  作者:  点击:次  出处:技术无忧
关键字:cmd 命令 网关

最近和广州做的VPN,,,网关只有改成254才能上,面我们平时用的都是1的网关,非常不方便,
所以还有一个办法,,就是让网关自动切换!
 
查看:
C:\>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 13 8f 5d dc 73 ...... NVIDIA nForce Networking Controller - 数据包计划
程序微型端口
===========================================================================
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0    192.168.100.1  192.168.100.14       20
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
    192.168.100.0    255.255.255.0   192.168.100.14  192.168.100.14       20
   192.168.100.14  255.255.255.255        127.0.0.1       127.0.0.1       20
  192.168.100.255  255.255.255.255   192.168.100.14  192.168.100.14       20
        224.0.0.0        240.0.0.0   192.168.100.14  192.168.100.14       20
  255.255.255.255  255.255.255.255   192.168.100.14  192.168.100.14       1
Default Gateway:     192.168.100.1
===========================================================================
Persistent Routes:
  None
 
和和,反正看着有些晕,,意思就是0.0.0.0/0.0.0.0  从192.168.100.1网关走
我们再加上
 
 
C:\>route -p add 192.168.3.0 mask 255.255.255.0 192.168.100.254
 
好了,就加上这几个,意思就是192.168.1.0/24  这5段的IP都从24的网关走,这样就不用老把网关换来换去了
 
C:\>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 13 8f 5d dc 73 ...... NVIDIA nForce Networking Controller - 数据包计
程序微型端口
===========================================================================
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0    192.168.100.1  192.168.100.14       20
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
      192.168.3.0    255.255.255.0  192.168.100.254  192.168.100.14       1
    192.168.100.0    255.255.255.0   192.168.100.14  192.168.100.14       20
   192.168.100.14  255.255.255.255        127.0.0.1       127.0.0.1       20
  192.168.100.255  255.255.255.255   192.168.100.14  192.168.100.14       20
        224.0.0.0        240.0.0.0   192.168.100.14  192.168.100.14       20
  255.255.255.255  255.255.255.255   192.168.100.14  192.168.100.14       1
Default Gateway:     192.168.100.1
===========================================================================
Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
      192.168.3.0    255.255.255.0  192.168.100.254       1
 
这样就成了,VPN上网两不误了

讨论 http://bbs.pc51.net


相关文章

文章评论

共有 0 位网友发表了评论 此处只显示部分留言 点击查看完整评论页面