-2

I've a bonding on two interfaces. I want to check the switch-redundancy by getting the hostname (or IP) of the switch, which a given interface is connected.

Currently I'm checking this with following command (MAC is like this to check, not just as example):

tcpdump -vv -s0 -i ethX ether host 01:00:0c:cc:cc:cc

Are there any other solutions to monitor this?

Greeting

3 Answers 3

2

Are the switches running some sort of Discovery Protocol (LLDP, CDP, etc..?) If so you can use that protocol to query the network, look for neighbors, etc..

2
  • Thanks, I'll have a look at this. I thinks the switches support CDP.
    – Beastcraft
    Oct 18, 2012 at 12:11
  • If so, try running show cdp neighbors
    – jftuga
    Oct 18, 2012 at 12:19
0

You may be confusing a switch with a router. Even so, some switches are smart enough and broadcast at least some information. You may not be able to reliably get the hostname, but you can still get "something". For example, if your switches use spanning tree protocol, you can use tcpdump and then confirm that the "bridge id" on both ports contains a different MAC address.

1
  • Thanks! But with my command above, I'm able to determine the hostname of the switch, which my interface is connected to. So why should it be unreliable? I just wanted to know if there are some better solutions then this tcpdump-hack?
    – Beastcraft
    Oct 18, 2012 at 12:11
0

If you have CLI access to the switches, can't you just query the switches for their MAC address port/table listing?

e.g. on Cisco - show mac-address | i 01:00:0c:cc:cc:cc

If you just want to see the status of your bonded connection, run:

cat /proc/net/bonding/bond0

It should output:

Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

802.3ad info
LACP rate: slow
Active Aggregator Info:
        Aggregator ID: 2
        Number of ports: 2
        Actor Key: 17
        Partner Key: 17476
        Partner Mac Address: 00:1f:28:04:69:c0

Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 2
Permanent HW addr: 00:26:55:31:db:32
Aggregator ID: 2

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 2
Permanent HW addr: 00:26:55:31:db:34
Aggregator ID: 2
3
  • I wanted to determine it from the client. It should actually check the switch redundancy. (I'll adjust my question, maybe its a bit confusing described)
    – Beastcraft
    Oct 18, 2012 at 12:26
  • See my edit above.
    – ewwhite
    Oct 18, 2012 at 12:30
  • This information I already have. I just want to know, to which switch each interface is connected.
    – Beastcraft
    Oct 18, 2012 at 12:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .