Unix Study--Solaris 10 modifies the host IP and master
Unix Study--Solaris 10 modifies host IP and host name
For the Solaris system, the host ip and hostname information are stored and managed through a series of configuration files (text), and the relevant configuration can be completed by modifying these configuration files through the editor.
1. Modify the host ip
1. Configure the hosts file
[root@solaris186:/] # cat / etc/hosts# Internet host table::1 localhost127.0.0.1 localhost192.168.8.11 solaris186 loghost [root@solaris186:/] # hostnamesolaris186 [root@solaris186:/] # vi / etc/hosts# Internet host table#::1 localhost127.0.0.1 localhost192.168.8.11 node1 loghost
2. View the network card information
[root@solaris186:/] # ifconfig-alo0: flags=2001000849 mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 e1000g0: flags=1000843 mtu 1500 index 2 inet 192.168.8.11 netmask ffffff00 broadcast 192.168.255 ether 8:0:27:28:b1:8c
3. Modify hostname.e1000g0
[root@solaris186:/] # cat / etc/hostname.e1000g0 solaris186 [root@solaris186:/] # vi / etc/hostname.e1000g0 node1 [root@solaris186:/] # cat / etc/hostname.e1000g0 node1
4. Modify netmasks (subnet mask)
[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.0192.168.8.0255.255.255.0
5. Modify the gateway configuration
[root@solaris186:/] # vi / etc/defaultrouter192.168.8.1 [root@solaris186:/] # cat / etc/defaultrouter192.168.8.1 [root@solaris186:/] # netstat-nrRouting Table: IPv4 Destination Gateway Flags Ref Use Interface- -192.168.8.0 192.168.11 U 11 e1000g0 224.0.0.0 192.168.11 U 10 e1000g0 127.0.0.1 127.0.0.1 UH 1 50 lo0
Summary:
Configuration files related to host ip
/ etc/hosts
/ etc/hostname.xxxx (network card name)
/ etc/netmaks
/ etc/defaultrouter
/ etc/inet/ipnodes
Second, modify the host name
1. Configure the hosts file
[root@solaris186:/] # cat / etc/hosts# Internet host table::1 localhost 127.0.0.1 localhost 192.168.8.11 node1 loghost
2. Modify hostname.e1000g0
[root@solaris186:/] # cat / etc/hostname.e1000g0 solaris186 [root@solaris186:/] # vi / etc/hostname.e1000g0 node1 [root@solaris186:/] # cat / etc/hostname.e1000g0 node1
3. Modify nodename
[root@solaris186:/] # cat / etc/nodenamesolaris186 [root@solaris186:/] # vi / etc/nodenamenode1 [root@solaris186:/] # cat / etc/nodenamenode1
4. View ipnodes
[root@solaris186:/] # cat / etc/inet/ipnodes # # Internet host table#::1 localhost 127.0.0.1 localhost 192.168.8.11 node1 loghost
Summary:
Configuration files related to hostname
/ etc/hosts
/ etc/hostname.xxxx (network card name)
/ etc/nodename
/ etc/inet/ipnodes