Change IP address under Solaris

Source: Internet
Author: User
Tags nameserver

Change IP address under Solaris
1. The ifconfig command is temporarily modified.

Ifconfig is used to configure the IP address of the NIC. It takes effect after modification, but is not saved. It becomes invalid after the next startup.
# Ifconfig-A ---> obtain the name of the NIC. Generally, the first M Nic is named

Hme0

# Ifconfig hme0 down ---> stop the service of the NIC hme0 temporarily

# Ifconfig hme0 192.168.1.100 netmask 255.255.255.0 up ---> Start the NIC
2. Change the IP address permanently

You need to modify the following files:
/Etc/hosts add machine name and IP address
Example: 192.168.1.100 sky100 loghost

Change/etc/inet/hosts networks netmasks to 3 files

/Etc/NET/*/hosts * is the three directories, and the hosts under the three directories is changed.

/Etc/nodename

/Etc/netmasks

Example: 192.168.1.0 255.255.255.0

/Etc/hostname. hme0 change the IP address of the NIC

For example, change to 192.168.1.100.

/Etc/defaultrouter add to Gateway

Example: 192.168.1.1

/Etc/resolv. conf add to DNS Server
For example:
Nameserver 202.106.0.20
Nameserver 202.106.196.115

Modify the/etc/nsswitch. conf file.
Find this line of hosts: Files
Change to hosts: Files DNS
That is, if the domain name cannot be found in/etc/hosts, it will go to DNS resolution.

After the modification is complete, restart.

If the NIC is changed or the NIC is added, the interface service cannot be started automatically. You need to create a network port manually.

Service:
# Ifconfig hme0 plumb
You can create a network port service for the interface hme0.
Correspondingly, the ifconfig with the unplumb parameter can be used to stop the service and disable the network.

/Etc/hostname. hme0 Nic hme0 IP Address

Table of IP addresses of host names in the/etc/hosts Network

/Etc/netmasks

/Etc/nsswitch. conf domain name resolution method and Sequence

/Etc/resolv. conf DNS server address and domain name

/Etc/defaultrouter set the default gateway address

/Etc/nodename Host Name

/Etc/NET/ticlts/hosts

/Etc/NET/ticots/hosts

/Etc/NET/ticotsord/hosts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.