Solaris changes IP

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

From:

A, change the Solaris IP address

Ifconfig is used to configure the IP address of network card, change after the entry into force,
But is not saved, the next time you start after the failure.
We use virtual machine for pcn0 card.
#ifconfig -a
lo0:.......
inet 127.0.0.1 netmask ff000000
pcn0:......
inet 192.168.229.3 netmask ffffff00 broadcast 192.168.229.225
ether 0:c:29:ff:2e:1f
#ipconfig pcn0 192.168.6.6 netmask 255.255.255.0
#ifconfig -a
lo0:......
inet 127.0.0.1 netmask ff000000
pcn0:......
inet 192.168.6.6 netmask ffffff00 broadcast 192.168.229.225
ether 0:c:29:ff:2e:1f
You want to permanently change the configuration, to change the configuration file, the pcn0 card as an example:
To change the three file 1/etc/hosts 2./etc/netmasks 3./etc/inet/ipnodes
#more /etc/hostname.pcn0
sun10
(see your PC name)
#more /etc/hosts
127.0.0.1 localhost
192.168.229.3 sun10 loghost
(see my IP address)
(change easily in the graphical interface with VI or GEDIT)
#vi /etc/Hosts (192.168.229.3 to 192.168.6.6.)
#vi /etc/Netmasks (192.168.229.0 into 192.168.6.0)
#vi /etc/inet/Ipnodes (192.168.229.3 to 192.168.6.6.)

#reboot (over)

Permanent change:
1)Edit the /etc/hosts file, change the IP and host name (the host name and "Ping host name" correspondingly, see the command with the hostname host name is different, can also be different, here are instructions), if you change the /etc/hosts file in the main machine, phase should also be change the hostname in the /etc/hostname.hme0 file, that file /etc/hosts and /etc/hostname.hme0 host name should be consistent,
2)Edit the file /etc/netmasks, subnet mask to edit the corresponding IP,
3)Execute the following command at the command line, so that the new IP immediately
#Ifconfig hme0 INET ip_address netmask subnet mask up

Two, hostname
Permanent change:
Edit the /etc/nodename file, enter a new file name, weight or perform "hostname new host name" at the command line, you can see the new host name is already in effect,

Three, changes in gateway
Edit or create a new /etc/defaultrouter file, enter the gateway IP address can be input at the same time, "route add default gateway IP address" on the command line, the gateway to new immediately.,

Four, add a virtual IP (i.e. second IP increase in a card)

1)If the system card name is /etc/hostname.hme0, add a file, /etc/hostname.hme0:1, the contents of the file is test,
2)Add a record in the /etc/hosts file, "192.168.100.1 test," hypothesis of new IP 192.168.10.1 host name to test,
3)Add a record in the /etc/netsmasks file"192.168.100.0 255.255.255.0",
4)Weight can come into effect,

Five, DNS set

The 1 amendment/etc/resolv.conf
#vi /etc/resolv.conf
Add a
Nameserver 202.96.209.133 (Shanghai DNS address, you can set up your own according to the local ISP address)
2 modified /etc/nsswitch.conf, if not, use CP nsswitch.dns nsswitch.conf
The host: files that line to
host: files dns
It is a DNS
The 3 amendment/etc/defaultrouter
Defaultrouter 192.168.0.1 (gateway address, your default gateway or TCP/IP)
Change after reboot
init 5
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Frank at December 08, 2013 - 9:50 PM