Closed kaage closed 8 years ago
Can you run on the CLI the following command and share the output?
show bridge mac-table | display xml rpc
When are vendors going to start being consistent?
There were a couple of changes between JunOS 12 and JunOS 13. I was aware about the changes for LLDP and fixed them via #9, but I'm surprised they changed it also for MAC Addr Table. There's no much work to fix, but first we need @kaage to provide the XML RPC he sees on his device.
There is now such command: "show bridge mac-table"
Could this help:
username@switch> show ethernet-switching table | display xml rpc
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/12.3R6/junos">
<rpc>
<get-ethernet-switching-table-information>
</get-ethernet-switching-table-information>
</rpc>
<cli>
<banner>{master:0}</banner>
</cli>
</rpc-reply>
Show bridge commands are for MX-routers only. I'm having EX-switches.
Yes, seems to be what I was looking for. I don't have any EX to test, can you come with a PR similar to https://github.com/napalm-automation/napalm-junos/pull/9/files and check if the device model begins with EX make a different RPC call (https://github.com/napalm-automation/napalm-junos/pull/9/files#diff-afaba48ce3c0bbd9a251e7f992db0a49R363)?
Example:
if self.device.facts.get('model', '').startswith('EX'):
mac_table.GET_RPC = 'get-ethernet-switching-table-information'
I'm not so familiar with python yet. However, in the first comment you can see device model is "Virtual Chassis". This is because this switch contains two separate physical switches. I'm not sure how this information is seen if there is just one single standalone EX-series switch but I can try to figure out.
Since the RPC seems to be application specific, I definitely need an entity of information in order to make the right decision.
Can you please run the following command on the device and share the output (first 6 lines should be enough -- but make sure that <description></description>
is included)?
show chassis hardware | display xml
Here's the compete output. Serial numbers has been changed:
user@switch> show chassis hardware | display xml
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/12.3R6/junos">
<chassis-inventory xmlns="http://xml.juniper.net/junos/12.3R6/junos-chassis">
<chassis junos:style="inventory">
<name>Chassis</name>
<serial-number>CL0123450011</serial-number>
<description>Virtual Chassis</description>
<chassis-module>
<name>Routing Engine 0</name>
<version>REV 03B</version>
<part-number>750-025719</part-number>
<serial-number>CL02012345011</serial-number>
<description>EX4200-24F</description>
<clei-code>COMWT00DRA</clei-code>
<model-number>EX4200-24F</model-number>
</chassis-module>
<chassis-module>
<name>Routing Engine 1</name>
<version>REV 11</version>
<part-number>750-021256</part-number>
<serial-number>BM1232137663</serial-number>
<description>EX4200-24T, 8 POE</description>
<clei-code>COMUY00CRA</clei-code>
<model-number>EX4200-24T</model-number>
</chassis-module>
<chassis-module>
<name>FPC 0</name>
<version>REV 03B</version>
<part-number>750-025719</part-number>
<serial-number>12321312</serial-number>
<description>EX4200-24F</description>
<clei-code>COMWT00DRA</clei-code>
<model-number>EX4200-24F</model-number>
<chassis-sub-module>
<name>CPU</name>
<part-number>BUILTIN</part-number>
<serial-number>BUILTIN</serial-number>
<description>FPC CPU</description>
</chassis-sub-module>
<chassis-sub-module>
<name>PIC 0</name>
<part-number>BUILTIN</part-number>
<serial-number>BUILTIN</serial-number>
<description>24x 100 Base-FX/1000 Base-X</description>
<clei-code>COMWT00DRA</clei-code>
<model-number>EX4200-24F</model-number>
<chassis-sub-sub-module>
<name>Xcvr 0</name>
<version>REV 01</version>
<part-number>740-011613</part-number>
<serial-number>1213213</serial-number>
<description>SFP-SX</description>
</chassis-sub-sub-module>
<chassis-sub-sub-module>
<name>Xcvr 20</name>
<version>REV 01</version>
<part-number>740-013111</part-number>
<serial-number>123123</serial-number>
<description>SFP-T</description>
</chassis-sub-sub-module>
<chassis-sub-sub-module>
<name>Xcvr 21</name>
<version>REV 01</version>
<part-number>740-011174</part-number>
<serial-number>123213</serial-number>
<description>SFP-T</description>
</chassis-sub-sub-module>
<chassis-sub-sub-module>
<name>Xcvr 22</name>
<version>REV 01</version>
<part-number>740-013111</part-number>
<serial-number>123213</serial-number>
<description>SFP-T</description>
</chassis-sub-sub-module>
<chassis-sub-sub-module>
<name>Xcvr 23</name>
<version>REV 01</version>
<part-number>740-013111</part-number>
<serial-number>123213</serial-number>
<description>SFP-T</description>
</chassis-sub-sub-module>
</chassis-sub-module>
<chassis-sub-module>
<name>PIC 1</name>
<version>REV 03B</version>
<part-number>711-021271</part-number>
<serial-number>1231231</serial-number>
<description>2x 10GE XFP</description>
<clei-code>COUIARDBTA</clei-code>
<model-number>EX-UM-2XFP</model-number>
<chassis-sub-sub-module>
<name>Xcvr 0</name>
<version>V</version>
<part-number>NON-JNPR</part-number>
<serial-number>123213</serial-number>
<description>XFP-10G-SR</description>
</chassis-sub-sub-module>
<chassis-sub-sub-module>
<name>Xcvr 1</name>
<version>z</version>
<part-number>NON-JNPR</part-number>
<serial-number>123213</serial-number>
<description>XFP-10G-SR</description>
</chassis-sub-sub-module>
</chassis-sub-module>
<chassis-sub-module>
<name>Power Supply 0</name>
<version>REV 05</version>
<part-number>740-020957</part-number>
<serial-number>123213</serial-number>
<description>PS 320W AC</description>
<clei-code>COUPACCEAC</clei-code>
<model-number>EX-PWR-320-AC</model-number>
</chassis-sub-module>
<chassis-sub-module>
<name>Power Supply 1</name>
<version>REV 05</version>
<part-number>740-020957</part-number>
<serial-number>123213</serial-number>
<description>PS 320W AC</description>
<clei-code>COUPACCEAC</clei-code>
<model-number>EX-PWR-320-AC</model-number>
</chassis-sub-module>
<chassis-sub-module>
<name>Fan Tray</name>
<description>Fan Tray</description>
</chassis-sub-module>
</chassis-module>
<chassis-module>
<name>FPC 1</name>
<version>REV 11</version>
<part-number>750-021256</part-number>
<serial-number>123213</serial-number>
<description>EX4200-24T, 8 POE</description>
<clei-code>COMUY00CRA</clei-code>
<model-number>EX4200-24T</model-number>
<chassis-sub-module>
<name>CPU</name>
<part-number>BUILTIN</part-number>
<serial-number>BUILTIN</serial-number>
<description>FPC CPU</description>
</chassis-sub-module>
<chassis-sub-module>
<name>PIC 0</name>
<part-number>BUILTIN</part-number>
<serial-number>BUILTIN</serial-number>
<description>24x 10/100/1000 Base-T</description>
<clei-code>COMUY00CRA</clei-code>
<model-number>EX4200-24T</model-number>
</chassis-sub-module>
<chassis-sub-module>
<name>PIC 1</name>
<version>REV 03A</version>
<part-number>711-021271</part-number>
<serial-number>123213</serial-number>
<description>2x 10GE XFP</description>
<clei-code>COUIARDBTA</clei-code>
<model-number>EX-UM-2XFP</model-number>
<chassis-sub-sub-module>
<name>Xcvr 0</name>
<version>REV 01</version>
<part-number>740-014289</part-number>
<serial-number>123213</serial-number>
<description>XFP-10G-SR</description>
</chassis-sub-sub-module>
<chassis-sub-sub-module>
<name>Xcvr 1</name>
<version>REV 02</version>
<part-number>740-014289</part-number>
<serial-number>123213</serial-number>
<description>XFP-10G-SR</description>
</chassis-sub-sub-module>
</chassis-sub-module>
<chassis-sub-module>
<name>Power Supply 0</name>
<version>REV 03</version>
<part-number>740-020957</part-number>
<serial-number>123213</serial-number>
<description>PS 320W AC</description>
<clei-code>COUPACCEAA</clei-code>
<model-number>EX-PWR-320-AC</model-number>
</chassis-sub-module>
<chassis-sub-module>
<name>Fan Tray</name>
<description>Fan Tray</description>
</chassis-sub-module>
</chassis-module>
</chassis>
</chassis-inventory>
<cli>
<banner>{master:0}</banner>
</cli>
</rpc-reply>
Unfortunately there's no much to do about that since <description>Virtual Chassis</description>
is what the underneath library PyEZ is using: https://github.com/Juniper/py-junos-eznc/blob/71725d80e4a25b1cf39974d8e9dbd4e006832630/lib/jnpr/junos/facts/chassis.py#L44
Firstly try to find out why it says Virtual Chassis instead of the real device model, if you are indeed running agains a physical device.
Virtual-Chassis is the concept of making two or more physical switches to act like one. They have one management IP, one configuration etc. One of them is running Routing Engine (Control Plane) and others are backups if active Routing Engine fails. However, all physical switch ports (data plane) in all of the switches are active and can be used.
As you can see from the last output this virtual chassis contains two switches. One of them is EX4200-24F and another is EX4200-24T. There can be more switches in the virtual-chassis as well. There can be different models in the virtual-chassis as in my example. Therefore it would be wrong to say model is for example "EX4200-24T" as there is also another switch with different model number in the same virtual-chassis. That's why they are saying model is "Virtual-Chassis". This makes sense.
Virtual-chassis technology is supported in EX-series and QFX-series switches only. They both support "show ethernet-switching table" command as well. In my opinion it is safe to say if model is "Virtual-Chassis" MAC-address table can be seen by that command.
Fair enough, this is an acceptable compromise.
And in addition to Virtual-Chassis also models starting with EX or QFX should be handled same way.
Even easier: using the native PyEZ facts (https://github.com/Juniper/py-junos-eznc/blob/71725d80e4a25b1cf39974d8e9dbd4e006832630/lib/jnpr/junos/facts/personality.py#L18):
if self.device.facts.get('personality', '') in ['SWITCH']: # in case will be needed also on other platforms
mac_table.GET_RPC = 'get-ethernet-switching-table-information'
get_mac_address_table doesn't seem to work with JunOS 12.3R6.6 while get_facts for example is working well: