How to modify the IP address under Solaris10 (Solaris)

Source: Internet
Author: User

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 www.guanwei.org

/Etc/netmasks add to Subnet

Example: 192.168.1.0 255.255.255.0

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

Example: 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, reboot and restart.
========================================================== ========
If the NIC is changed or the NIC is added, the interface service cannot be started automatically. You need to manually create the NIC 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.

 

From: guanwei blog

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.