Debugging

From Syslinux Wiki
Jump to: navigation, search
NOTE
Please note, this page is under development at the moment and may be incomplete or possibly use incorrect terminology.

Overview

When users encounter issues, there are a number of steps that can be taken to collect information surrounding the issue. Steps here should contain no compiling.

First Steps

Check over Hardware Compatibility, Common Problems and the latest NEWS file to see if your issue might be known/resolved/have a workaround.

PXE-Capture-inline

There are two basic inline methods, use a hardware device called a tap that'll replicate the packets to 1 or 2 ports or use something like Linux bridging to put a machine with 2+ NICs inline. Using a tap generally involves just plugging in the monitored ports between the target device and its uplink and the monitor ports to a capture machine.

Example:

 brctl addbr br0
 brctl addif br0 eth1
 brctl addif br0 eth2

Now, connecting eth1 to the target device and connecting eth2 to its uplink will result in being able to capture on any of these three and see all the packets the target sees.

PXE-Capture-Mirror

Using a port mirror in an intelligent switch is the most effective way of capturing the traffic to/from a PXE client. Cisco Catalyst switches running IOS use "port monitor" and/or "monitor session". Cisco Catalyst switches running CatOS (CatalystOS) use "span" (short for "Switch Port ANalyzer"). Some HP switches use "traffic mirroring" and "traffic monitoring".

  • Cisco IOS example:
 monitor session 1 source interface GigabitEthernet0/2
 monitor session 1 destination interface GigabitEthernet0/1
  • HP ProVision ASIC example (last line stops the monitor):
 mirror 4 port 1
 interface 2
 monitor all both mirror 4
 no monitor all both mirror 4

Once a mirror of the PXE client's port is configured, the capture interface on the machine doing the capture should be as silent as possible to prevent unwanted packets from being captured.

PXE-Capture-tftpd

For a PXE client that can successfully use DHCP to identify the characteristics it should use (including the server and filename to boot), capturing traffic from the machine running the tftpd is pretty effective. Most tftpds will move to another port for the actual data transmission but the PXE client's IP should be in all of the applicable traffic. Filtering to just packets with that IP will likely suffice.

Using wireshark with a capture filter of 'host 192.0.2.16' (assuming 192.0.2.16 is the PXE client) will generally capture all relevant packets and no irrelevant packets.

  • An example tcpdump command:
`tcpdump -i eth0 -s 0 -w dump.cap 'host 192.0.2.16'`
  • Other sample filters include:
<host-specifier> or ( (udp port 67 or udp port 68) and (udp[36:4] = 0x<MAC-0-3>) and (udp[40:2] = 0x<MAC-4-5>) )
"host specifier" could be an IP address as above, or a MAC address like 'ether host 12:34:56:78:9a:bc'.
"MAC-0-3" is the first-through-fourth byte of the MAC and "MAC-4-5" is the fifth and sixth. In the example:
    'ether host 12:34:56:78:9a:bc or ( (udp port 67 or udp port 68) and (udp[36:4] = 0x12345678) and (udp[40:2] = 0x9abc) )'

PXE-Access

If a PXE client has difficulty retrieving pxelinux.0, or PXELINUX has difficulty retrieving a file on the same or another server, a simple test is to attempt to retrieve the same file from a full-blown client. Sometimes testing from a client on another subnet is sufficient to see the issue, but sometimes it is necessary to test from the same subnet as the PXE client, or the same IP as the PXE client (with the PXE client off), in case there are any ACLs on devices between the PXE client and the TFTP system, or ACLs on the TFTP system.

UEFI-handles-alias

One aid to determining how a given UEFI machine is structured is a dump of the device handles, the GUID to text aliases and search specifically on a certain alias.

   guid > fs0:\efi-guid.txt
   dh > fs0:\efi-dh.txt
   dh -p Net > fs0:\efi-dh-net.txt
   dh -p SimpleNetwork >> fs0:\efi-dh-net.txt

Depending on the system, "Net" or "SimpleNetwork" may be the alias for the EFI_SIMPLE_NETWORK_PROTOCOL GUID.

See also