Chinaunix首页 | 论坛 | 博客
  • 博客访问: 101430374
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-04-27 13:57:45

出处:豆豆技术网  
 
阅读提示:本文介绍在Solaris操作系统中与网络路由和网关相关的几个文件。

/etc/defaulrouter文件

配置缺省网关,防止不必要的路由进程,适用于只有一个路由器通向其它网段,单一路由占用较小的路由表资源

该文件保存了缺省路由得信息。系统安装时并没有该文件,是用户自己创建的。文件内容是缺省路由的地址。

#cat /etc/defaultrouter

172.16.255.254

优点:

占用资源少,只有一条路由条目。

/etc/gateways文件

路由表文件

net gateway metric

dest. net 目标网段

router 下一跳路由器的地址

count 跳数

route命令

route add|delete [host|net] destination [gateway ]

Add a route

#route add net 128.50.3.0 192.168.1.1 1

delete a route

#route delete net 128.50.2.0 192.168.12.2

查看路由表

# netstat -r

Routing Table:

Destination Gateway Flags Ref Use Interface

----------- ---------- ----- --- --- ---------

localhost localhost UH 0 2272 lo0

202.96.0.0 192.168.12.1 U 3 562 le0

10.103.0.0 192.168.12.2 U 3 562 le0

#

Destination 目标网络或主机

Gateway 转发数据包的主机

Flags 这条路由的状态,这个参数有这样几个选项:

U 端口处于激活状态(up)

H 目标是个主机,而不是网段

Ref 同一个网络接口地址拥有的路由条目数量

Use 通过这条路由的包数量,对于localhost来说,这个数字代表 所以接收的包数量

Interface 路由的网络接口

阅读(653) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~