出处:51CTO论坛
阅读提示:本文介绍如何在Solaris 10操作系统下调整设置IP地址信息。
操作环境
配置静态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 |
重启:
网络配置完成后,相关文件的内容:
more /etc/nodename outermore /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 |
查看系统引导信息:
完全限定域名错误
错误信息:
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配置内容相同。
阅读(363) | 评论(0) | 转发(0) |