UnixStudy--Solaris10修改主机IP和主-创新互联

Unix Study--Solaris 10修改主机IP和主机名

创新互联公司是一家专业提供市中企业网站建设,专注与网站设计、成都网站设计、H5建站、小程序制作等业务。10年已为市中众多企业、政府机构等服务。创新互联专业网站设计公司优惠进行中。

  对于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

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。

网站题目:UnixStudy--Solaris10修改主机IP和主-创新互联
网址分享:https://www.cdcxhl.com/article16/ccehdg.html

成都网站建设公司_创新互联,为您提供响应式网站网站导航网站设计公司小程序开发App设计网页设计公司

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

绵阳服务器托管