如題,2種方法
一。使用sys-unconfig。
我想裝過Solaris系統的人都應該知道這個命令吧?它可以使系統的一系列設定恢複到出廠狀態,然後讓你重新設定.很方便,不過比較危險,什麼DNS,TIMEZONE等等統統歸位!具體使用man查看,我只複製關係此命令修改哪些設定:
sys-unconfig does the following:
o Saves current /etc/inet/hosts file information in
/etc/inet/hosts.saved.
o If the current /etc/vfstab file contains NFS mount
entries, saves the /etc/vfstab file to
/etc/vfstab.orig.
o Restores the default /etc/inet/hosts file.
o Removes the default hostname in /etc/hostname.interface
files for all interfaces configured when this command
is run. To determine which interfaces are configured,
run the command 'ifconfig-a'. The
/etc/hostname.interface files corresponding to all of
the interfaces listed in the resulting output, with the
exception of the loopback interface (lo0), will be
removed.
o Removes the default domainname in /etc/defaultdomain.
o Restores the timezone to PST8PDT in /etc/TIMEZONE.
o Disables the Network Information Service (NIS) and Net-
work Information Service Plus (NIS+) if either NIS or
NIS+ was configured.
o Removes the file /etc/inet/netmasks.
o Removes the file /etc/defaultrouter.
o Removes the password set for root in /etc/shadow.
o Removes the file /etc/.rootkey.
--以上就是這個SYS-UNCONFIG做的事情,英文不好的同學要加強點,畢竟你是管理員man文檔的基本英文要能應付吧?--
好了,接著講使用SYS-UNCONFIG,全是英文了哦:
Select the language you want to use: <select your language>
Select a Locale,
Please make a choice (0 - 59), or press h or ? for help:
<select your location>
What type of terminal are you using?
Type the number of your choice and press Return:
<select your terminal type, I use a DEC VT100>
F2 continue, F2 continue
Network Connectivity
Networked [X] Yes
DHCP
Use DHCP [X] No
Primary Network Interface
Primary network interface [X] eri0
Host Name <hostname>
IP Address <ipaddress>
Subnets
System part of a subnet [X] Yes
Netmask
<netmask>
IPv6
Enable IPv6 [X] No
Set a default Route
[X] Specify one
Default Route IP Address
Router IP Address: <defaultrouter>
Confirm Information
F2 continue
Configure Security Policy:
Configure Kerberos Security [X] No
Confirm Information
F2 continue
Name Service
Name service [X] DNS
Domain Name
<dnsdomain>
DNS Server Address
Servers IP Address: <nameserver1>
Servers IP Address: <nameserver2>
Servers IP Address:
DNS Search List
Search Domain: <dnsdomain>
Search Domain:
Search Domain:
Search Domain:
Search Domain:
Confirm Information
F2 continue
Time Zone
Regions [X] <select your region>
Time Zone
Time zones [X] <select your time zone>
Date and Time
> Accept the default date and time or enter new values.
二,使用編輯檔案並重啟
1.修改主機名稱
Solaris7, 之前的版本(不包括7):
/etc/inet/hosts/etc/nodename/etc/hostname.<interface>
<interface> 是你住網卡裝置的名稱, 比如:bge0.
Refer:用$grep network /etc/path_into_inst查看有哪些網卡
/etc/net/ticlts/hosts/etc/net/ticots/hosts/etc/net/ticotsord/hosts
修改好以後重啟系統.
Solaris7到9:
/etc/inet/hosts/etc/nodename/etc/hostname.<interface>
<interface>解釋同上
/etc/net/ticlts/hosts/etc/net/ticots/hosts/etc/net/ticotsord/hosts/etc/inet/ipnodes
重啟系統
Solaris10:
/etc/inet/hosts/etc/nodename/etc/hostname.<interface>
<interface> 解釋同上.
/etc/inet/ipnodes
重啟系統.
2.修改IP地址
Solaris7之前的版本(不包括7):
/etc/inet/hosts/etc/hostname.<interfaces>
<interfaces> are the names of the interfaces, e.g. bge0, bge1, eri0.
/etc/net/ticlts/hosts/etc/net/ticots/hosts/etc/net/ticotsord/hosts
如果你需要移動到不同的子網時,你還需要修改:
/etc/inet/netmasks
/etc/defaultrouter
/etc/resolv.conf
修改好以後,重啟系統就OK了.
Solaris7 to 9:
/etc/inet/hosts/etc/hostname.<interfaces>
where <interfaces> are the names of the interface, e.g. bge0, bge1, eri0.
/etc/net/ticlts/hosts/etc/net/ticots/hosts/etc/net/ticotsord/hosts/etc/inet/ipnodes
如果你需要移動到不同的子網時,你還需要修改:
/etc/inet/netmasks
/etc/defaultrouter
/etc/resolv.conf
修改好以後,重啟系統就OK了.
Solaris10:
/etc/inet/hosts/etc/hostname.<interfaces>
where <interfaces> are the names of the interface, e.g. bge0, bge1, eri0.
/etc/inet/ipnodes
如果你需要移動到不同的子網時,你還需要修改:
/etc/inet/netmasks
/etc/defaultrouter
/etc/resolv.conf
修改好以後,重啟系統就OK了.
好了,祝你順利.
################################################
相關資料請查看sun infoDoc 21252:
"How to Change the hostname and/or IP Address Without Running the sys-unconfig Command". (Editor's note: For more information, please see SunSolve; content is available to registered users with a Sun Service Plan.)