Options

Finding the root bridge...

carveonecarveone Member Posts: 22 ■□□□□□□□□□
I was just having a chat about this and thought I'd ask all you ccnaers out there. How do you find the name of the root bridge if you aren't currently consoled into that bridge?

show spanning-tree will give you the Mac address of the bridge. show mac-address-table address address will give you the port the address was learned on. And then what? If you are given the ports in this way (you are on switch C)
                switch B
                  |
                  |
                  | e1
switch A -----  switch C
              e0

then no problem I guess! Otherwise you're toast (eg if you were on switch B and switch A was the root bridge). Ummm. All I can think of is show cdp neighbor detail to get ip addresses and then hopefully telnet to them...!

Oh. One more thing - does "show spanning-tree" show all ports that have something (anything, not just another switch) plugged in as "FWD". Maybe I should just go get a darn switch and find out!

Conor.

Comments

  • Options
    malcyboodmalcybood Member Posts: 900 ■■■□□□□□□□
    carveone wrote:
    I was just having a chat about this and thought I'd ask all you ccnaers out there. How do you find the name of the root bridge if you aren't currently consoled into that bridge?

    show spanning-tree will give you the Mac address of the bridge. show mac-address-table address address will give you the port the address was learned on. And then what? If you are given the ports in this way (you are on switch C)
                    switch B
                      |
                      |
                      | e1
    switch A -----  switch C
                  e0
    

    then no problem I guess! Otherwise you're toast (eg if you were on switch B and switch A was the root bridge). Ummm. All I can think of is show cdp neighbor detail to get ip addresses and then hopefully telnet to them...!

    Oh. One more thing - does "show spanning-tree" show all ports that have something (anything, not just another switch) plugged in as "FWD". Maybe I should just go get a darn switch and find out!

    Conor.

    Conor,

    In this type of scenario you are likely to have a router in place somewhere running this network, agree?

    Therefore you could get the mac address of the root bridge on the actual switch as you have described above with the sh spanning-tree command. Then you can login to the router and do the command:

    router#sh ip arp

    This will give you a mapping of all ip address to MAC address on the ethernet segments of your router.

    You can do this command on the switch but it will only give you the details for the switch you are on, so it is best to do it on the router as it works over IP and will show all devices on that router's ethernet segments arp mappings. (hopefully you should have some kind of IP address = device spreadsheet/map setup, if not then do one)

    If you wanted to find a switches MAC address in general and already knew a the switch's IP address or hostname you can do

    router#sh ip arp 223.8.151.2

    OR

    router#sh ip arp Switch_B (if you have DNS or a host table setup)

    Play about with the sh ip arp ? commands and you'll get the hang of it.

    Hope this helps

    Malc
  • Options
    malcyboodmalcybood Member Posts: 900 ■■■□□□□□□□
    ......................also just remembered another couple of ways to work this out. It wont tell you names but you should be able to work out names in the method I gave you above using arp. If you want to get a bit more technical you could use the "cost" output as a guide from the switch when you do the sh spanning-tree command

    If you're on Switch A and you do a sh spanning-tree and the root ID cost is 19(assuming it's linked by fastethernet) then you know it is only one link away and it's switch C that is the route

    If the Root ID (bridge) cost on switch A is 38 then you know it is 2 links away (2 x 19 = 2 x fast ethernet links) and the root bridge would be Switch B in the scenario you have given. For switches with redundant links it's slightly more tricky but not much so try setting redundant links yourself if you can.

    If it's a simple topology like the one you gave then it's easy to work it out this way.

    If you don't follow what I'm saying here read up about calculating costs in the STP process and it should click into place.

    have a closer look at the output of the sh spanning-tree command with what I've told you in mind and there are another couple of ways to work this type of thing out. You really need to fully understand STP first though i.e. root ports, bridges and costs mainly

    I personally would do it the first way I showed you in my previous post using arp but it was just to give you an idea of the different ways to gather this info.

    Malc
  • Options
    carveonecarveone Member Posts: 22 ■□□□□□□□□□
    malcybood wrote:
    If you're on Switch A and you do a sh spanning-tree and the root ID cost is 19(assuming it's linked by fastethernet) then you know it is only one link away and it's switch C that is the route

    I think you're on to something there!
    If the Root ID (bridge) cost on switch A is 38 then you know it is 2 links away (2 x 19 = 2 x fast ethernet links) and the root bridge would be Switch B in the scenario you

    This makes sense. show spanning-tree active will show "cost of root path is: 38" from the cisco docs.
    If it's a simple topology like the one you gave then it's easy to work it out this way.

    Thanks, I'll do a good bit more looking at stp,

    Conor.
Sign In or Register to comment.