免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3027 | 回复: 4
打印 上一主题 下一主题

请问怎么添加路由啊! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-06-27 10:59 |只看该作者 |倒序浏览
各位,我有一台机器要和别的系统连。\r\n我主机的IP:135.64.255.3\r\n我要加一条静态路由:135.64.128.0\r\n掩码       :255.255.255.192\r\n网关       :135.64.255.60\r\n  \r\n请问怎么加啊,用什么命令啊,最好详细一点。谢谢了

论坛徽章:
2
双鱼座
日期:2014-02-23 12:10:03操作系统版块每日发帖之星
日期:2015-12-17 06:20:00
2 [报告]
发表于 2003-06-27 11:05 |只看该作者

请问怎么添加路由啊!

/etc/defaulrouter文件 \r\n配置缺省网关 \r\n防止不必要的路由进程 \r\n适用于只有一个路由器通向其它网段 \r\n单一路由占用较小的路由表资源 \r\n\r\n该文件保存了缺省路由得信息。系统安装时并没有该文件,是用户自己创建的。文件内容是缺省路由的地址。 \r\n#cat /etc/defaultrouter \r\n172.16.255.254 \r\n\r\n优点: \r\n占用资源少,只有一条路由条目。 \r\n\r\n/etc/gateways文件 \r\n路由表文件 \r\nnet gateway metric \r\ndest. net 目标网段 \r\nrouter 下一跳路由器的地址 \r\ncount 跳数 \r\n\r\n\r\nroute命令 \r\n\r\nroute add|delete [host|net] destination [gateway ] \r\nAdd a route \r\n#route add net 128.50.3.0 192.168.1.1 1 \r\nDelete a route \r\n#route delete net 128.50.2.0 192.168.12.2 \r\n\r\n查看路由表 \r\n# netstat -r \r\nRouting Table: \r\nDestination Gateway Flags Ref Use Interface \r\n----------- ---------- ----- --- --- --------- \r\nlocalhost localhost UH 0 2272 lo0 \r\n202.96.0.0 192.168.12.1 U 3 562 le0 \r\n10.103.0.0 192.168.12.2 U 3 562 le0 \r\n# \r\nDestination 目标网络或主机 \r\nGateway 转发数据包的主机 \r\nFlags 这条路由的状态,这个参数有这样几个选项: \r\nU 端口处于激活状态(up) \r\nH 目标是个主机,而不是网段 \r\n\r\nRef 同一个网络接口地址拥有的路由条目数量 \r\nUse 通过这条路由的包数量,对于localhost来说,这个数字代表 所以接收的包数量 \r\nInterface 路由的网络接口

论坛徽章:
0
3 [报告]
发表于 2003-06-27 11:08 |只看该作者

请问怎么添加路由啊!

修改/etc/gateways文件,格式为\r\nnet  gateway  metric

论坛徽章:
0
4 [报告]
发表于 2003-06-27 11:27 |只看该作者

请问怎么添加路由啊!

各位,我用的是route命令\r\n请问:下面的状态是不是说已经好了?\r\n# netstat -r\r\n\r\nRouting Table:\r\n  Destination           Gateway           Flags  Ref   Use   Interface\r\n-------------------- -------------------- ----- ----- ------ ---------\r\n135.64.128.0         135.64.255.60         UG       0      6  \r\n135.64.255.0         smp01                 U        3   5336  hme0\r\n224.0.0.0            smp01                 U        3      0  hme0\r\ndefault              135.64.255.9          UG       0      3  \r\nlocalhost            localhost             UH       01319401  lo0\r\n#

论坛徽章:
0
5 [报告]
发表于 2003-06-27 11:56 |只看该作者

请问怎么添加路由啊!

有个问题想问:能不能指定掩码??
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP