歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Solaris修改主機名及網卡配置

Solaris修改主機名及網卡配置

日期:2017/2/28 15:34:03   编辑:Linux教程

Solaris系統中修改hostname不是一件容易的事情,妥善的更改主機名需要改動7個文件,這些文件彼此關聯。

/etc/nodename:填上主機名
/etc/hostname.bge0:主機名,hme0為網卡接口名
/etc/hosts:IP配置
/etc/defaultrouter:缺省網關
/etc/netmasks:子網掩碼
/etc/nsswitch.conf:在host的行末加上dns,要與files用分隔符隔開
/etc/resolv.conf:配置域名服務器

1. 主機名文件/etc/nodename
內容為主機名

2. 網卡配置文件
/etc/hostname.bge0,內容為:solaris1
/etc/hostname.bge1,內容為:solaris2

3. 主機列表文件/etc/hosts
::1 localhost
127.0.0.1 localhost
10.83.25.145 solaris1 loghost //說明:外網IP對應主機名solaris1
192.168.1.15 solaris2 loghost //說明:內網IP對應主機名solaris2

4. 子網掩碼/etc/netmasks
10.83.25.0 255.255.255.0
192.168.1.0 255.255.255.0

5. 默認網關/etc/defaultrouter
10.83.25.254

6. DNS服務器/etc/resolv.conf
nameserver 10.83.0.150
nameserver 10.83.0.151

7. 修改/etc/nsswitch.conf
hosts: files dns 只要在hosts一項添加dns項就可以

Copyright © Linux教程網 All Rights Reserved