Solaris10 修改主机名和IP地址

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Solaris10 修改主机名和IP地址相关的知识,希望对你有一定的参考价值。

一、修改主机ip

1、配置hosts

[email protected]:/ # cat /etc/hosts

#

# Internet host table

#

::1             localhost

127.0.0.1       localhost

172.16.251.130  solaris10       loghost

 

2、查看网卡信息

[email protected]:/ # ifconfig -a

lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1

        inet 127.0.0.1 netmask ff000000

e1000g0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 index 2

        inet 172.16.251.130 netmask ffffff00 broadcast 172.16.251.255

        ether 0:c:29:44:3b:b9

 

3、修改hostname.e1000g0

[email protected]:/ # cat /etc/hostname.e1000g0

solaris10

 

4、修改netmask

 

[email protected]:/ # 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

#

172.16.251.0 255.255.255.0

 

5、修改网关信息

[email protected]:/ # cat /etc/defaultrouter

172.16.251.2

 

[email protected]:/ # netstat -nr

 

Routing Table: IPv4

  Destination           Gateway           Flags  Ref     Use     Interface

-------------------- -------------------- ----- ----- ---------- ---------

default              172.16.251.2         UG        1          0 e1000g0  

172.16.251.0         172.16.251.130       U         1          2 e1000g0  

224.0.0.0            172.16.251.130       U         1          0 e1000g0  

127.0.0.1            127.0.0.1            UH        3         86 lo0      

 

二、修改主机名

1、配置hosts

[email protected]:/ # cat /etc/hosts

#

# Internet host table

#

::1             localhost

127.0.0.1       localhost

172.16.251.130  solaris10       loghost

 

2、修改hostname.e1000g0

 

[email protected]:/ # cat /etc/hostname.e1000g0

solaris10

 

3、修改nodename

[email protected]:/ # cat /etc/nodename

solaris10

 

4、查看ipnodes

[email protected]:/ # cat /etc/inet/ipnodes

#

# Internet host table

#

::1             localhost

127.0.0.1       localhost

172.16.251.130  solaris10       loghost

 


以上是关于Solaris10 修改主机名和IP地址的主要内容,如果未能解决你的问题,请参考以下文章

单实例asm,修改主机名和ip地址后的重配置

Solaris - 修改IP和主机名

powershell修改主机名和IP

配置服务主机名和域名IP解析

配置服务主机名和域名IP解析

配置服务主机名和域名IP解析