在 Oracle® Solaris 11.2 中管理 SAN 设备和多路径

退出打印视图

更新时间: 2014 年 12 月
 
 

如何将主机配置为自动网络配置

系统主机名在 svc:/system/identity:node 服务中设置。例如,主机名为 sys-A,IPFC 网络接口为 fcip0

  1. 成为管理员。
  2. 确认已设置主机名。
    # svccfg -s identity:node
    svc:/system/identity:node> listprop config/nodename
    config/nodename astring  sys-A

    如果需要设置主机名,请使用类似以下的语法:

    # svccfg -s identity:node setprop config/nodename = "neo-1"
  3. 将其他条目添加到 /etc/inet/hosts 文件。

    安装程序将以最少条目创建 /etc/inet/hosts 文件。您必须使用文本编辑器手动添加其他条目。有关其他信息,请参见 hosts(4)

    /etc/inet/hosts 文件包含主机数据库。此文件包含主机名和主网络接口 IP 地址,以及附加到系统的其他网络接口和计算机必须了解的任何其他网络接口的 IP 地址。

    以下示例所示为 etc/inet/host 文件。

    127.0.0.1      localhost     loghost
    192.168.200.70   neo-1     #This is the local host name
    192.168.201.10 fcip0 #Interface to network 192.168.201.10
  4. 确认已使用 files nis 为主机配置了名称服务 SMF 服务。
    # svccfg
    svc:> select network/nis/client:default
    svc:/network/nis/client:default> select name-service/switch
    svc:/system/name-service/switch> listprop config/host
    config/host astring     "files nis"
    svc:/system/name-service/switch> quit