TCP/IP and Data Communications Administration Guide

Strategies and Tips

The following troubleshooting techniques are helpful in solving problems when you cannot isolate the cause:

This chapter describes these techniques in more detail. It also tells you where to get more information when you cannot solve a problem using this guide.

Using snoop to Monitor Network Traffic

You can use the snoop command to monitor network traffic.

To Use snoop to Monitor Network Traffic

  1. Log in to the root account on a Solaris server or BOOTP/DHCP relay agent on the same subnet as the client.

  2. Use the snoop command to trace network traffic. For example:


    snoop -o /tmp/output udp port 67 or udp port 68
    

  3. Boot the client and watch the DHCP message exchange between the client and server(s).

  4. Type:


    snoop -i /tmp/output -x 0 -v
    

You can limit the scope of snoop by specifying the client's hardware address. A version of snoop that understands the DHCP/BOOTP protocols is available in Solaris version 2.5 and later.

Running the DHCP Client in Debug Mode

Running the DHCP client in debug mode reveals much of the ongoing dialogue between the client and the server. Refer to the documentation for the product on which you are running the client.

To Run a Solaris 2 Client in Debug Mode

Debugging the DHCP client is only possible after it has booted. If DHCP problems are experienced, you must boot with DHCP disabled. The steps here can be performed only once after the host has booted, preferably in single-user mode.

  1. The DHCP agent can be configured to log details of the packets exchanged with the server. To do this, the agent must be started with debug mode turned on:


    /sbin/dhcpagent -n -d3 &
    

    The -d3 flag turns on debug at leve1 3, and the -n flag says "don't configure the interface even if DHCP is successful".


    Note -

    Level 3 and levels below that return appropriate information for the user. Levels above level 3 are appropriate only for developers or those with even more expertise, since they return raw packets of information.


  2. Only one instance of dhcpagent can run at a time, so before the agent can be started in this manner, any previously invoked agent must be stopped. To do this, find the agent's process ID and send it the terminate signal:


    kill -TERM process_id_of_dhcpagent
    

  3. After an agent has been started in debug mode, try to configure an interface manually by typing:


    ifconfig interface_name auto_dhcp
    

    The packets that are sent, and any that are received, will be displayed.


    Note -

    During the time that DHCP tries to configure an interface, the interface is unable to send or receive packets. Other network services, such as NIS or NFS, may be adversely affected while the interface is down.


To Run the DHCP Server in Debug Mode

    Stop and restart the DHCP server in debug mode.

For example:

  1. Stop the server using the shutdown script:


    /etc/init.d/dhcp stop
    

  2. Restart the server in debug/verbose mode, using the -d and -v flags in addition to any flags specified in the /etc/init.d/dhcp startup script. For example, if the i option is present, type the command in the following format:


    /usr/lib/inet/in.dhcpd -i interface_names  -d -v
    

Restarting the DHCP Client

Once you have run the DHCP client in debug mode, you can try rebooting. Rebooting resets the network hardware and software.

To Restart the DHCP Client

  1. Reboot the client.

To Restart the DHCP Server

  1. Log in to the DHCP server as root.

  2. Type:


    /etc/init.d/dhcp stop
    

    Wait about 10 seconds.

  3. Type:


    /etc/init.d/dhcp start
    

To Restart the DHCP Server After Debugging is Completed

  1. Restart the DHCP server daemons.

  2. Log in to the DHCP server as root.

  3. Type:


    /etc/init.d/dhcp stop
    

    Wait about 10 seconds.

  4. Type:


    /etc/init.d/dhcp start