Friday, September 5, 2008

NIC troubleshooting on Solaris

DHCP Commands:
Request IP address dynamically with DHCP.


To permanently make an interface, for example hme0, obtain its IP address through DHCP, use the touch command to create the following two empty files as root:

#touch /etc/dhcp.hme0
#touch /etc/hostname.hme0

When you reboot, the interface will be dynamically configured.

To bring up the interface using DHCP without rebooting, use the following command:
#ifconfig hme0 plumb
#ifconfig hme0 dhcp start

The following commands can be used to display the DHCP lease information and release the DHCP lease, respectively:

#ifconfig hme0 dhcp status
#ifconfig hme0 dhcp release

However, this sets the hostname to unknown unless you specify something
like the following in the dhcp server config.

host netra {
hardware ethernet 08:00:20:da:63:96;
option host-name "netra";
}


Assign an Static ip address to hme0
#ifconfig hme0 192.172.73.100 netmask 255.255.255.0 up


When troubleshooting networking issues, it is often helpful to determine the state of an ethernet interface. Solaris offers access to many configurable networking parameters through ndd.

To determine the ethernet interface link status, duplex, and speed on hme0, run the following commands as superuser:
#ndd -set /dev/hme instance 0
#ndd -get /dev/hme link_status
#ndd -get /dev/hme link_mode
#ndd -get /dev/hme link_speed

If you have only one ethernet interface, you can leave out the instance command. Otherwise, you can specify the hme instance number there.
The results of the next three commands are either 1 or 0.

In each case, the value means:
link_status: 0=down 1=up
link_mode: 0=half duplex 1=full duplex
link_speed: 0=10Mbps 1=100Mbps


Mac address:
Arp –a (as normal user)
Ifconfig –a (as root)



edit /etc/defaultrouter

edit the file /etc/defaultrouter -- the only line in the file should be the default route of the system, for example: 192.168.1.1.
This change will not take effect until the system is rebooted.

Assign the current default route

To implement the new default route without rebooting the system, use the following command substituting your default route for 192.168.1.1:

route add default 192.168.1.1

Check the default route
netstat –rn

No comments: