Tuesday, April 15, 2014

Network Configuration in Solaris

Configuration Files :

File containing the domain name:

File containing the IP address of default router:

File containing the name resolution order:

File containing the ip address on hme0 interface :

To set DNS server and search order :

To set hostname :

File containing the IP Address to hostname mapping :

File containing network services and their corresponding port numbers :

File containing the subnet mask:

Create the below file to prevent the startup of in.routed daemon :

Internet Super Daemon Configuration File:

Commands :

1.. To show link status of a network adapter :
a. To show link status on ce1
# kstat ce:1 | grep link

        link_asmpause             0
        link_duplex                  2 
        link_pause                   0
        link_speed                  100
        link_T4                        0
        link_up                        1

where link_duplex = 0 means link down
                                1 means half duplex
                                2 means full duplex

where link_speed=0 means link down
                             10 means 10MBPS
                             100 means 100MBPS
                             1000 means 1GBPS

For ce and bge interface, you should use kstat command to return NIC settings.
All other interfaces should use ndd  to determine NIC settings.

b. To how link status of hme0

# ndd -set /dev/hme instance 0
# ndd -get /dev/hme link_mode
# ndd -get /dev/hme link_speed

2. To set duplex and link speed of a network interface :

a. To set 100 full dupled on hme1 interface

# ndd -set /dev/hme instance 1
# ndd -set /dev/hme adv_100hdx_cap 0
# ndd -set /dev/hme adv_100fdx_cap 1
# ndd -set /dev/hme adv_autoneg_cap 0
# ndd -set /dev/hme link_speed 100

Then add the below lines to /etc/system

 set hme:hme_adv_autoneg_cap=0
 set hme:hme_adv_100hdx_cap=0
 set hme:hme_adv_100fdx_cap=1
 set hme:hme_link_speed=100

For ce interface,
Use the below command to set the current values and add these to a startup script.

DONT ADD THIS TO /etc/system as it would not work. !!!!

ndd -set /dev/ce instance 0
ndd -set /dev/ce adv_1000fdx_cap 0
ndd -set /dev/ce adv_1000hdx_cap 0
ndd -set /dev/ce adv_100fdx_cap 1
ndd -set /dev/ce adv_100hdx_cap 0
ndd -set /dev/ce adv_10fdx_cap 0
ndd -set /dev/ce adv_10hdx_cap 0
ndd -set /dev/ce adv_autoneg_cap 0

3. To set default router :

# route add default
Also add this into /etc/detaultrouter to make this permanent.

4. To remove the current default route :

# route delete default
Also remove it from /etc/defaultrouter to make this change permanent.

5.How to change the hostname?

a. Change the hostname in the file /etc/nodename to make this change permanent.
b. Use uname command to change the current value
# uname -S newname
c. Change the name in /etc/hosts
d. Chagne the name in DNS records
e. Change the hostname in /etc/hostname.networkinterface
f. Change the name in the files /etc/net/ticlts/hosts, /etc/net/ticots/hosts, /etc/net/ticotsord/hosts if applicable.
g. Change the name in /etc/inet/ipnodes (For solaris 10 only).
h. Please reboot the system to avoid any issues.

6. To disable a network interface :
# ifconfig hme1 unplumb

7. To enable it :
# ifconfig hme1 plumb

8. To down id :
# ifconfig hme1 down

9. To display network interface table :
# ifconfig -a
# netstat -i
# netstat -in

10. To set IP address on qfe0 network interface :
# ifconfig qfe0 netmask up

Also set the ip label in /etc/hostname.qfe0, add hostname, IP mapping in /etc/hosts and add the netmasks into /etc/netmasks

11. To set IP alias on qfe0 :
ifconfig qfe0:1 netmask up

Also set the ip label in /etc/hostname.qfe0:1, add hostname, IP mapping in /etc/hosts and add the netmasks into /etc/netmasks

12. To add static route to a network :

# route add -net

Also add this command to a startup script (normally located under /etc/rc2.d). 

No comments:

Post a Comment