Unix Study--Solaris 10修改主機(jī)IP和主機(jī)名
創(chuàng)新互聯(lián)成都企業(yè)網(wǎng)站建設(shè)服務(wù),提供成都網(wǎng)站建設(shè)、成都做網(wǎng)站網(wǎng)站開發(fā),網(wǎng)站定制,建網(wǎng)站,網(wǎng)站搭建,網(wǎng)站設(shè)計(jì),成都響應(yīng)式網(wǎng)站建設(shè)公司,網(wǎng)頁設(shè)計(jì)師打造企業(yè)風(fēng)格網(wǎng)站,提供周到的售前咨詢和貼心的售后服務(wù)。歡迎咨詢做網(wǎng)站需要多少錢:028-86922220
對于Solaris系統(tǒng),是通過一系列配置文件(文本)來存儲(chǔ)和管理主機(jī)ip和主機(jī)名信息,通過編輯器修改這些配置文件就可以完成相關(guān)的配置。
一、修改主機(jī)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、查看網(wǎng)卡信息
[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(子網(wǎng)掩碼)
[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、修改網(wǎng)關(guān)配置
[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
總結(jié):
和主機(jī)ip有關(guān)的配置文件
/etc/hosts
/etc/hostname.xxxx(網(wǎng)卡名)
/etc/netmaks
/etc/defaultrouter
/etc/inet/ipnodes
二、修改主機(jī)名
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
總結(jié):
和主機(jī)名有關(guān)的配置文件
/etc/hosts
/etc/hostname.xxxx(網(wǎng)卡名)
/etc/nodename
/etc/inet/ipnodes
當(dāng)前標(biāo)題:UnixStudy--Solaris10修改主機(jī)IP和主
本文URL:http://muchs.cn/article26/jcpsjg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信小程序、關(guān)鍵詞優(yōu)化、建站公司、、網(wǎng)頁設(shè)計(jì)公司、電子商務(wù)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)