一、路由和网关
1)通过文件增加
文件:/etc/gateways
格式:<dest. net>; <gateway>; <netmasks>; metric <count>;
描述:添加路由表记录
     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
        功能:管理系统的各种服务
        格式:                  <service_name>;  <socket_type>;  <proto>;  <flags>;  <user>;  <server_pathname>;  <args>;
         举例:
 # 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