Friday, July 17, 2009

How to config network in Solaris 10

Changes Static IP Address and Host Name
    The sample below shows how to uses ipconfig change static IP address to 192.168.0.10 with netmask 255.255.255.0
  1. ifconfig vfe0 unplumb
  2. ifconfig vfe0 plumb 192.168.0.10 netmask 255.255.255.0 up
Config host name for ethernet card
    /etc/hostname.vfe0
     solaris10
Config network mapping for IP address and host name (hostname of Ethernet card)
    the hosts file format of each line is:
        IP-address    official-host-name    nicknames....
    the nicknames can be optional.
    /etc/hosts
     127.0.0.1         localhost            loghost
     192.168.0.xxx  solaris10
    /etc/netmasks
     192.168.0.xxx 255.255.255.0
Config Gateway
    /etc/defaultrouter
     192.168.0.1
Config DNS
    1. Specify DNS Server
        /etc/resolv.conf
         nameserver 168.95.192.1
         nameserver 168.95.192.2
    2. In order to enable DNS resolve, change the line in nsswitch.conf as below
        /etc/nsswitch.conf
         hosts: files dns
         inodes: files dns