安装:
 
在VMware中安装Solaris 10,很简单,下载cd1、cd2、cd3、cd4、cd-lang
按照VMware的提示一步一步来,30分钟时间搞掂
 
配置网络:
 
确保网卡已经正常安装了,例如:ls /dev | grep pcn
在这里,我们的网卡名称是pcn开头的
# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
pcn0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 10.1.1.90 netmask ffffff00 broadcast 10.1.1.255
        ether 0:c:29:25:8e:37
#
配置网卡接口的名称:
#vi /etc/hostname.pcn0
 
SUN
 
必须和/etc/inet/hosts文件中的名字相同,否则不能启动网络IP地址的。
 
#vi /etc/inet/hosts
 
# Internet host table
#
127.0.0.1       localhost
10.1.1.90       SUN     loghost
 
配置掩码:
#vi /etc/inet/netmasks
 
#
# The netmasks file associates Internet Protocol (IP) address
# masks with IP network numbers.
#
#       network-number  netmask
#
# The term network-number refers to a number obtained from the Internet Network
# Information Center.
#
# Both the network-number and the netmasks are specified in
# "decimal dot" notation, e.g:
#
#               128.32.0.0 255.255.255.0
#
10.1.1.0        255.255.255.0
配置网卡接口地址:
#vi /etc/inet/hosts
 
#
# Internet host table
#
127.0.0.1       localhost
10.1.1.90       SUN     loghost
配置网关:
 
#vi /etc/defaultrouter
10.1.1.254
 
配置DNS:
# vi /etc/resolv.conf
nameserver 61.144.56.101
nameserver 202.96.128.166
 
#vi /etc/nsswitch.conf
#
# /etc/nsswitch.files:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# does not use any naming service.
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.
passwd:     files
group:      files
hosts:      files dns
ipnodes:    files
networks:   files
protocols:  files
rpc:        files
ethers:     files
netmasks:   files
bootparams: files
publickey:  files
# At present there isn't a 'files' backend for netgroup;  the system will
#   figure it out pretty quickly, and won't use netgroups at all.
netgroup:   files
automount:  files
aliases:    files
services:   files
printers:       user files
在hosts:      files 这一行添加dns,SUN客户机缺省使用files作为服务器名字的解析,为了使用DNS名称解析服务器,必须在/etc/nsswitch.conf指明使用DNS服务。
 
OK,配置完成,重启系统:
#init 6
 
启动完毕,测试网络:
# ping 10.1.1.254
10.1.1.254 is alive
# ping yahoo.com.cn
yahoo.com.cn is alive
#
搞掂,可以上网了,哈哈
 
最后,介绍一下Solaris网络配置的相关配置文件,主要包括:

    1. /etc/hostname.interface

    该文件是物理网卡的配置文件,这个文件包括一个主机名称或者主机的IP地址。有le、hme等后缀等。le是十兆网卡,hme为百兆网卡等等。后面跟一个数字,第一个十兆网卡为le0,第二个为le1;第二个百兆网卡为hme0,第二个为hme1等。Solaris 安装程序要求您在安装过程中至少配置一个接口。自动配置的第一个接口将成为主网络接口。安装程序为主网络接口和在安装时选择配置的任何其他接口创建 /etc/hostname.interface 文件。 如果在安装过程中配置了其他接口,请验证每个接口是否有对应的 /etc/hostname.interface 文件。在 Solaris 安装过程中,无需配置多个接口。但是,如果稍后要将更多接口添加到系统中,则必须手动配置它们。

    说明:如一台SUN工作站连接了Internet网和内部网,则可对应创建两个文件分为hostname.le0和hostname.le0:2。

    2. /etc/nodename

    在 Solaris 安装过程中指定系统的主机名时,该主机名将输入到 /etc/nodename 文件中。确保节点名称项是系统的正确主机名。如果计算机名称是cjh ,那么/etc/nodename 文件中肯定包括一行:cjh 。

    3. /etc/defaultdomain

    /etc/defaultdomain文件包括本地主机的域名。如,假定主机 tenere 是域 deserts.worldwide.com 的一部分。则在 /etc/defaultdomain 中包括 以下信息:deserts.worldwide.com。

    4. /etc/defaultrouter

    /etc/defaultrouter包括主机的路由地址。选用动态路由协议,则可将/etc/defaultrouter文件置为空。若选择静态协议,只需在/etc/defaultrouter文件中填入缺省路由器名,这样当Unix路由器找不到寻径路由时便将IP包发往缺省路由器。

    5. /etc/inet/hosts

    /etc/inet/hosts是主机数据库文件。主机数据库包含网络中各系统的IPv4 地址和主机名。如果使用NIS 或DNS 名称服务,或者使用LDAP 目录服务,则hosts 数据库在专门存储主机信息的数据库中进行维护。例如,在运行NIS 的网络中,hosts 数据库在hostsbyname 文件中进行维护。如果使用本地文件提供名称服务,则hosts 数据库将在/etc/inet/hosts 文件中维护。此文件包含主网络接口的主机名和IPv4 地址、连/etc/inet/hosts 文件格式:
    IPv4-address hostname [nicknames] [#comment]
    IPv4-address 包含本地主机必须识别的每个接口的IPv4 地址。
    hostname 包含设置期间指定给系统的主机名,以及指定给本地主机必须识别的
    其他网络接口的主机名。
    [nickname] 包含主机昵称的可选字段。
    [#comment] 是可选的注释字段。接到系统的其他网络接口的主机名和IPv4 地址以及系统必须检查的其他网络地址。
    一个典型文件如下:
    # Internet host table
    127.0.0.1 localhost
    10.1.1.8 suncjh loghost
    说明:其中127.0.0.1 是回送地址。回送地址是本地系统用来允许进程间通信的保留网络接口。主机可使用此地址将数据包发送给自己。ifconfig 命令使用回送地址进行配置和测试。

    6. /etc/inet/ipnodes

    /etc/inet/ipnodes 文件同时存储IPv4 和IPv6 地址。此外,也可以存储以传统的点分十进制或CIDR 表示法表示的IPv4 地址。此文件作为将主机名与其IPv4 和IPv6 地址进行关联的本地数据库。

    7. /etc/inet/netmasks

    /etc/inet/netmasks是子网掩码数据库。如果在网络中设置了子网,则配置网络时只需要编辑netmasks 数据库。netmasks数据库由网络及其关联的子网掩码的列表组成。创建子网时,每个新网络必须是单独的物理网络。不能在单个物理网络中设置子网。

    对于 C 类网络号 192.168.83,请键入:192.168.83.0 255.255.255.0;对于 CIDR 地址,将网络前缀转换为等效的用点分十进制表示法表示的项。例如,使用以下内容可以表示 CIDR 网络前缀 192.168.3.0/22。