Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We are developing a Linux based ethernet switch which has 6 ports. We are done with CDP protocol. I have connected a Cisco device to port 2. When I quiery for the Cisco device, I get the reply and instead of getting lan1 (port 1 - lan0 .. port 6 = lan5), I always get the interface name as eth0. The same is the case for all the ports. What changes are required to get the correct interface name? I will be very thankful for the information. The snap packet is received in the routine snap_rcv() in the file "linux._2.6.XX/net/802/psnap.c";

Regards, Suraj..

share|improve this question
add comment

1 Answer

Here is an example of show cdp neigh:

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
akira2           Eth 0/0            142                   [redacted Eth 0/1

In this example, the router calling itself akira2 is connected to the local router; the port it is connected to on the local router is en0/0, and the port it is connected to on the remote router is en0/1. In such a case, the CDP packet provided the port ID (from the field marked type 0x3), and the local interface was inferred while receiving the packet.

It works this way by default, so if you get data that is obviously wrong, you should update your firmware and/or call cisco support.

Port names on cisco devices are not usually named lanN; typically if they are, say, 100baseT ports, they will be prefixed fe, and gigabit ethernet ports will be prefixed ge. If you are finding the device always reports en0 (or Ethernet 0, or Eth 0), it's likely that the device is implemented as a router with a hub in front of it (unmanaged) splitting out the ports.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.