Solaris changes IP

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


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
inet netmask ff000000
inet netmask ffffff00 broadcast
ether 0:c:29:ff:2e:1f
#ipconfig pcn0 netmask
#ifconfig -a
inet netmask ff000000
inet netmask ffffff00 broadcast
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
(see your PC name)
#more /etc/hosts localhost sun10 loghost
(see my IP address)
(change easily in the graphical interface with VI or GEDIT)
#vi /etc/Hosts ( to
#vi /etc/Netmasks ( into
#vi /etc/inet/Ipnodes ( to

#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, " test," hypothesis of new IP host name to test,
3)Add a record in the /etc/netsmasks file"",
4)Weight can come into effect,

Five, DNS set

The 1 amendment/etc/resolv.conf
#vi /etc/resolv.conf
Add a
Nameserver (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 (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