在boot阶段配置IPv4接口
1、/etc/rcS.d/S30network.sh
2、/etc/hostname.xxn
3、/etc/inet/hosts
这个文件是在启动阶段的一个启动脚本,用于搜索/etc/hostname.xxn文件,这个脚本使用ifconfig使用/etc/hostname.xxn文件的IP地址和其他需要的网络信息来配置每一个接口。
不知道为什么在我的10中(x86)中没有找到这个文件。
/etc/hostname.xxn中存放着相关接口的配置入口。
# ls /etc/hostname.*
/etc/hostname.pcn0
/etc/hostname.xxn:xx代表接口类型,n代表接口的一个实例.
/etc/hostname.hme0就是一个例子,还有
/etc/hostname.le0(le是lance ethernet的缩写),
/etc/hostname.qfe0(qfe是quadfast ethernet的缩写),
/etc/hostname.hme0文件里面包括了主机名或者是IP地址.
# cat /etc/hostname.pcn0
unix
#
这里面包含着主机的名称
/etc/inet/hosts
这个文件是联系IP地址和主机名的一个本地数据库,它列出了每台主机的IP地址和主机名
/etc/hosts文件是对/etc/inet/hosts文件的符号链接
# ls -l /etc/hosts
lrwxrwxrwx 1 root root 12 2月 9 2006 /etc/hosts -> ./inet/host
s
#
# cat /etc/inet/hosts # # Internet host table # 127.0.0.1 localhost 192.168.0.10 unix loghost # |
改变主机名称
主机名包含在六个文件中,要更改主机名必须更改所有文件:
1、/etc/nodename
2、/etc/hostname.xxn
3、/etc/inet/hosts
4、/etc/net/ticlts/hosts
5、/etc/net/ticots/hosts
6、/etc/net/ticotsord/hosts
/etc/nodename:
这里存放在是一个canonical名(别名记录),一般的情况下这个名称金额/etc/inet/hosts上名称是一致的。可以通过编辑这个文件来修改主机名,然后重启系统.如果一台电脑受DHCP或RPC启动协议远程管理,那么这个文件不能被编辑.
# cat /etc/inet/hosts
#
# Internet host table
#
127.0.0.1 localhost
192.168.0.10 unix loghost
# cat /etc/nodename
unix
#
/etc/hostname.xxn
/etc/inet/hosts
(这里谈到了主机名的规范化问题,一般说来,主机名是由字母数字下划线组成的,第一个字符必须是字母,最后一个字符不能是下划线或者一个句号.主机名最多包含24个字符,没有大小写的区分)
/etc/net/ticlts/hosts
/etc/net/ticots/hosts
/etc/net/ticotsord/hosts
这三个文件在Solaris 10上已经不使用了。
# cat /etc/net/ticots/hosts
#
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)hosts 1.3 03/12/07 SMI"
#
# NOTE: This file is no longer consulted and may be removed from a future
# release of Solaris.
以上三个子目录包含在/etc/net目录中.每个目录包含一个hosts文件,如果执行sys-unconfig命令则删除这三个文件.文件格式是:hostname hostanme.中间以空格为间.
系统配置包括主机名,域名,时区,IP地址,子网掩码,root密码
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/222350/viewspace-925073/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/222350/viewspace-925073/