DarkHole 发表于 2006-8-26 08:22:25

求助,写路由表

在校内,单网卡接交换机,交换机接ADSL,和学校的交换机. 从202.118.80.0-202.118.95.255是学校的IP,走172.19.76.1这个网关.请问这样写对么?

route -p add 202.118.80.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.81.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.82.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.83.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.84.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.85.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.86.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.87.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.88.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.89.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.90.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.91.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.92.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.93.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.94.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.95.0 mask 255.255.255.0 172.19.76.1 metric 10


很重要的想问一下,如何写一个BAT的文件,以后直接运行就行了? 先谢谢了

[ 本帖最后由 DarkHole 于 2006-8-26 08:25 编辑 ]

seywong 发表于 2006-8-26 10:13:56

@echo off
route -p add 202.118.80.0 mask 255.255.240.0 172.19.76.1 metric 10

这样就行了!不用打那么多句的,因为你们学校的Ip段是202.118.80.0/20

DarkHole 发表于 2006-8-26 12:06:15

谢谢楼上大哥,我学校的IP段是202.118.80-95的,没你想象的那么少,呵呵

主页就是202.118.88.88,要是写202.118.80.0那样的话81-95的可就进不去了,呵呵

[ 本帖最后由 DarkHole 于 2006-8-26 12:07 编辑 ]

DarkHole 发表于 2006-8-27 17:32:48

我用文本写了个BAT文件,
@echo off
route -p add 202.118.80.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.81.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.82.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.83.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.84.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.85.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.86.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.87.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.88.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.89.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.90.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.91.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.92.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.93.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.94.0 mask 255.255.255.0 172.19.76.1 metric 10
route -p add 202.118.95.0 mask 255.255.255.0 172.19.76.1 metric 10



为什么运行后什么窗口里全是黑的,什么也不出来呢?只有光标在闪

[ 本帖最后由 DarkHole 于 2006-8-27 17:43 编辑 ]

DarkHole 发表于 2006-8-28 08:10:46

请知道的大哥帮帮忙,谢谢了

seywong 发表于 2006-9-17 11:19:10

原帖由 seywong 于 2006-8-26 10:13 发表
@echo off
route -p add 202.118.80.0 mask 255.255.240.0 172.19.76.1 metric 10

这样就行了!不用打那么多句的,因为你们学校的Ip段是202.118.80.0/20


你看清楚掩码再算,用不着打那么多句
页: [1]
查看完整版本: 求助,写路由表