Windows中 route 命令的运用

现在的电脑上一般至少都有两个网卡,有时候需要把这两个网卡连接到不一样的网络中,这时候就要给系统添加路由信息了。

windows里的route命令还是很好用的,主要是简单。

1.先把cmd窗口打开

2.看route 的帮助信息。 route -help,最常用的添加路由的格式如下:

route add 192.168.1.0 mask 255.255.255.0 172.16.1.1 metric 18 if 12

                destination               mask             gateway           metric  interface

如果不给出interface index的话,windows也会根据gateway来计算出从哪个网卡出去。但是如果电脑上的两个网卡虽然属于不一样的网络当中,但是网关的一样的,这样就必须指定interface了

3.查看interface index,是通过 route print 命令

======================================

interface list

12---------00 21 65 6a af fe----------Interl(R) WiFI Link 5300 AGN

1----------00 12 45 13 23 ee---------Interl(R) Gigabit Nework connection

 

这前面的数字就是Interface index了

posted @ 2013-11-12 13:33  sun sun  阅读(627)  评论(0编辑  收藏  举报