您好,登錄后才能下訂單哦!
Unix Study--Solaris 10修改主機IP和主機名
對于Solaris系統,是通過一系列配置文件(文本)來存儲和管理主機ip和主機名信息,通過編輯器修改這些配置文件就可以完成相關的配置。
一、修改主機ip
1、配置hosts文件
[root@solaris186:/]# cat /etc/hosts # Internet host table ::1 localhost 127.0.0.1 localhost 192.168.8.11 solaris186 loghost [root@solaris186:/]# hostname solaris186 [root@solaris186:/]# vi /etc/hosts # Internet host table # ::1 localhost 127.0.0.1 localhost 192.168.8.11 node1 loghost
2、查看網卡信息
[root@solaris186:/]# ifconfig -a lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2 inet 192.168.8.11 netmask ffffff00 broadcast 192.168.8.255 ether 8:0:27:28:b1:8c
3、修改hostname.e1000g0
[root@solaris186:/]# cat /etc/hostname.e1000g0 solaris186 [root@solaris186:/]# vi /etc/hostname.e1000g0 node1 [root@solaris186:/]# cat /etc/hostname.e1000g0 node1
4、修改netmasks(子網掩碼)
[root@solaris186:/]# cat /etc/netmasks # # The netmasks file associates Internet Protocol (IP) address # masks with IP network numbers. # # network-number netmask # # The term network-number refers to a number obtained from the Internet Network # Information Center. # # Both the network-number and the netmasks are specified in # "decimal dot" notation, e.g: # # 128.32.0.0 255.255.255.0 # 192.168.8.0 255.255.255.0
5、修改網關配置
[root@solaris186:/]# vi /etc/defaultrouter 192.168.8.1 [root@solaris186:/]# cat /etc/defaultrouter 192.168.8.1 [root@solaris186:/]# netstat -nr Routing Table: IPv4 Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ---------- --------- 192.168.8.0 192.168.8.11 U 1 1 e1000g0 224.0.0.0 192.168.8.11 U 1 0 e1000g0 127.0.0.1 127.0.0.1 UH 1 50 lo0
總結:
和主機ip有關的配置文件
/etc/hosts
/etc/hostname.xxxx(網卡名)
/etc/netmaks
/etc/defaultrouter
/etc/inet/ipnodes
二、修改主機名
1、配置hosts文件
[root@solaris186:/]# cat /etc/hosts # Internet host table ::1 localhost 127.0.0.1 localhost 192.168.8.11 node1 loghost
2、修改hostname.e1000g0
[root@solaris186:/]# cat /etc/hostname.e1000g0 solaris186 [root@solaris186:/]# vi /etc/hostname.e1000g0 node1 [root@solaris186:/]# cat /etc/hostname.e1000g0 node1
3、修改nodename
[root@solaris186:/]# cat /etc/nodename solaris186 [root@solaris186:/]# vi /etc/nodename node1 [root@solaris186:/]# cat /etc/nodename node1
4、查看ipnodes
[root@solaris186:/]# cat /etc/inet/ipnodes # # Internet host table # ::1 localhost 127.0.0.1 localhost 192.168.8.11 node1 loghost
總結:
和主機名有關的配置文件
/etc/hosts
/etc/hostname.xxxx(網卡名)
/etc/nodename
/etc/inet/ipnodes
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。