虽然网上有很多关于这方面的资料,但是没有点到关键的地方,不能解除现实中的难题。

    有不少的人按照操作修改完了,却总是不生效,为什么呢?关键就是没有创建 defaultrouter文件(系统默认是没有这个文件的,原因是 solaris默认开启的是什么包转发的功能),这里面只需填写你的路由网关即可,一般是所在网段的 *.*.*.254
如果只是修改 IP地址,需要设置的文件就只有 hostsnetmasks以及 defaultrouter了,如果是多网卡还需要修改 hostname.interfaceX
对于主机名的修改,也并不复杂,只需要修改 nodename即可。
希望下面的这篇文章能给你带来帮助……


    配置静态 ip {

      内网: inner 192.168.1.1 255.255.255.0

      外网: outer 192.168.224.251 255.255.255.0

                }

    外网接口已在安装界面配置完成,现在配置内网接口。

查看双网卡是否已安装:
     ls /dev | grep rtls

     rtls

     rtls0

    rtls1
网卡型号决定了网卡的名称,我的网卡名称是: rtls开头

上面显示安装了两个网卡, rtls1就是我们下面的要配置的网卡!

配置网卡接口名称:
  vi /etc/hostname.rtls1

  inner

  配置子网掩码:

  chmod 644 /etc/inet/netmasks

  vi /etc/inet/netmasks

  192.168.224.0 255.255.255.0

  192.168.1.0 255.255.255.0

  配置网卡接口地址: chmod 644 /etc/inet/hosts

  vi /etc/inet/hosts

  127.0.0.1 localhost
 
  192.168.224.251 outer outer.c204.com loghost

  192.168.1.1 inner inner.c204.com

  统一配置文件: chmod 644 /etc/inet/ipnodes

  vi /etc/inet/ipnodes

  ::1 localhost

  127.0.0.1 localhost

  192.168.224.251 outer outer.c204.com loghost

  192.168.1.1 inner inner.c204.com

  重启:

  init 6

  网络配置完成后,相关文件的内容: more /etc/nodename

  outer
  more /etc/hostname.rtls0

  outer

  more /etc/hostname.rtls1

  inner

  more /etc/hosts

  127.0.0.1 localhost

  192.168.224.251 outer outer.c204.com loghost

  192.168.1.1 inner inner.c204.com

  more /etc/netmasks

  192.168.224.0 255.255.255.0

  192.168.1.0 255.255.255.0

  more /etc/defaultrouter

  192.168.224.1

  more /etc/resolv.conf

  domain c204.com

  nameserver 202.96.134.133

  nameserver 202.96.128.68

  search c204.com

  more /etc/nsswitch.conf

  hosts: files dns
  错误排除

   如果出现如下错误信息,说明主机名没有在主机列表中指定:

  nov 20 15:25:04 unix /usr/lib/snmp/snmpdx: [id 702911 daemon.error] unable to get my ip address: gethostbyname(unix) failed [h_errno: host not found(1)]

可以这样解决,将主机名加入到主机列表: more /etc/nodename

   unix

   vi /etc/hosts

    127.0.0.1 localhost unix loghost
如果出现如下错误信息,说明你在安装后配置网卡接口名称时使用了主机名:

    nov 20 15:36:32 unix ip: [id 482227 kern.notice] ip_arp_done: init failed

   可以这样解决,更改网卡接口名:

   vi /etc/hostname.rtls0

   litchi

   vi /etc/hosts

   192.168.1.1 litchi litchi.c204.com

    如果出现如下错误信息,说明 sendmail在发出警告信息,不是什么错误:

    nov 20 15:37:21 unix sendmail[318]: [id 702911 mail.crit] my unqualified host name (localhost) unknown; sleeping for retry

    可以尝试这样配置 hosts文件,要求全名称且注意 loghost的位置:

   more /etc/hosts

   127.0.0.1 localhost

   192.168.224.251 outer outer.c204.com loghost

   192.168.1.1 inner inner.c204.com

   如果你的系统不必运行 sendmail服务,可以停掉它: svcs disable /network/smtp:sendmail

   查看系统引导信息: dmesg

   完全限定域名错误

    错误信息: nov 29 21:40:37 wan sendmail[712]: [id 702911 mail.crit]

my unqualified host name (wan) unknown; sleeping for retry

nov 29 21:41:37 wan sendmail[712]: [id 702911 mail.alert]

   unable to qualify my own domain name (wan) -- using short name

   解决方法:

    这是 sendmail发出的警告信息,是由于 /etc/inet/hosts文件的配置引起的,下面是正确配置: 127.0.0.1 localhost

192.168.224.111 wan wan.c204.com loghost

    注意:主机名后有完全限定域名,可以随意选择域名;loghost要标识在完全限定域名行;

建议:/etc/inet/hosts/etc/inet/ipnodes配置内容相同。<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

希望这篇文章能帮你解除技术上的困扰,O(∩_∩)O~。