Thứ Sáu, 31 tháng 8, 2018

Thay đổi IP, hostname trên Solaris

  1. Assume the Primary Administrator role, or become superuser.
    The Primary Administrator role includes the Primary Administrator profile. To create the role and assign the role to a user, see Chapter 2, Working With the Solaris Management Console (Tasks), in System Administration Guide: Basic Administration.
  2. For Solaris 10 11/06 and earlier releases only, modify the IP address in the /etc/inet/ipnodes file or equivalent ipnodes database.
    Use the following syntax for each IP address that you add to the system:

    IP-address host-name, nicknames
    IP-address interface-name, nicknames
    The first entry should contain the IP address of the primary network interface and the host name of the system. You can optionally add nicknames for the host name. When you add additional physical interfaces to a system, create entries in /etc/inet/ipnodes for the IP addresses and associated names of those interfaces.
  3. If the system's host name must change, modify the host name entry in the /etc/nodename file.
  4. Modify the IP address and, if applicable, the host name in the /etc/inet/hosts file or equivalent hosts database.
  5. Modify the IP address in the /etc/hostname.interface file for the primary network interface.
    You can use any of the following as the entry for the primary network interface in the /etc/hostnameinterface file:
    • IPv4 address, expressed in traditional dotted decimal format
      Use the following syntax:

      IPv4 address subnet mask
      The netmask entry is optional. If you do not specify it, the default netmask is assumed.
      Here is an example:

      # vi hostname.eri0 netmask
    • IPv4 address, expressed in CIDR notation, if appropriate for your network configuration.

      IPv4 address/network prefix
      Here is an example:

      # vi hostname.eri0
      The CIDR prefix designates the appropriate netmask for the IPv4 address. For example, the /8 above indicates the netmask
    • Host name.
      To use the system's host name in the /etc/hostname.interface file, be sure that the host name and associated IPv4 address are also in the hosts database.
  6. If the subnet mask has changed, modify the subnet entries in the following files:
    • /etc/netmasks
    • (Optional) /etc/hostname.interface
  7. If the subnet address has changed, change the IP address of the default router in /etc/defaultrouter to that of the new subnet's default router.
  8. Reboot the system.
# reboot -- -r


Trần Văn Bình - Oracle Database Master