免费注册 查看新帖 |

Chinaunix

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

网络 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-03-15 09:21 |只看该作者 |倒序浏览

一、路由和网关
1)通过文件增加
文件:/etc/gateways
格式:; ; ; metric ;
描述:添加路由表记录
     dest. net                目标网段
     gateway                下一跳路由器的地址
     count                跳数
2)route命令
命令格式:route add|delete [host|net] destination [gateway
举例:
Add a route
        #route add  -net 10.50.3.0 10.168.1.1 1
Delete a route
        #route delete -net  10.50.2.0 10.168.1.2
3)缺省路由
文件:/etc/defaultrouter
描述:防止不必要的路由进程
适用于只有一个路由器通向其它网段
单一路由占用较小的路由表资源
4)查看路由
举例:
# 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
                二、网络地址和掩码
1)文件:/etc/hostname.interface
接口描述:
网卡型号
十兆网卡:le
百兆网卡:hme
2)文件:/etc/hosts
功能描述:
系统名与IP地址的映射
与/etc/hostname.interface 协同工作,配置本机网卡地址
举例:
# more /etc/hosts
127.0.0.1        localhost        loghost
10.12.255.1        xiaojg
10.13.255.1        xiaojg
3)文件:/etc/netmasks
功能描述:
将网络的IP地址与网络地址联系一起,划分子网
如果是标准网段,则不需要配置
4)命令:ifconfig
举例:
检测网络端口状态
        #ifconfig -a
配置网络端口地址
        #ifconfig le0 10.16.25.1 netmask 255.255.255.0
配置网络端口状态
        #ifconfig le0 up/down
配置网络端口是否可用
        #ifconfig le0 plumb/unplumb
5)文件:/etc/services
功能描述:
网络服务协议的端口号
网络协议的服务类型
举例:
#more /etc/inet/services
ftp-data        20/tcp
ftp        21/tcp
telnet        23/tcp
smtp        25/tcp        mail
sunrpc        111/udp        rpcbind
sunrpc        111/tcp        rpcbind
6)文件:/etc/inetd.conf
功能:管理系统的各种服务
格式:
;  ;  ;  ;  ;  ;  ;
举例:
# cat /etc/inet/inetd.conf
ftp        stream        tcp        nowait        root        /usr/sbin/in.ftpd        in.ftpd
telnet        stream        tcp        nowait        root        /usr/sbin/in.telnetd        in.telnetd
login        stream        tcp        nowait        root        /usr/sbin/in.rlogind        in.rlogind
talk        dgram        udp        wait        root        /usr/sbin/in.talkd        in.talkd  


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/32935/showart_258851.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP