Skip to content

Instantly share code, notes, and snippets.

@skrobul
Created October 28, 2013 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skrobul/7201361 to your computer and use it in GitHub Desktop.
Save skrobul/7201361 to your computer and use it in GitHub Desktop.
$ ruby ./getmac.rb 10.9.30.138
Scanning VLAN: 1
[T] Start: 2013-10-28 17:49:29 +0000
[T] Got bportids_to_mac_table in 0.039541 seconds
[T] Got macidx_to_brport 0.045924 seconds
[T] Got bridgeport to ifindex mapping 0.048247 seconds
[T] Got ifIndex to ifName mapping 0.270035 seconds
Total time spent on this vlan: 0.403856 seconds
Scanning VLAN: 2
[T] Start: 2013-10-28 17:49:29 +0000
[T] Got bportids_to_mac_table in 0.084574 seconds
[T] Got macidx_to_brport 0.08253 seconds
[T] Got bridgeport to ifindex mapping 0.054716 seconds
[T] Got ifIndex to ifName mapping 3.0e-05 seconds
Total time spent on this vlan: 0.221903 seconds
Scanning VLAN: 3
[T] Start: 2013-10-28 17:49:29 +0000
[T] Got bportids_to_mac_table in 0.07068 seconds
[T] Got macidx_to_brport 0.044276 seconds
[T] Got bridgeport to ifindex mapping 0.043293 seconds
[T] Got ifIndex to ifName mapping 3.0e-05 seconds
Total time spent on this vlan: 0.158335 seconds
Scanning VLAN: 20
[T] Start: 2013-10-28 17:49:29 +0000
[T] Got bportids_to_mac_table in 0.052095 seconds
[T] Got macidx_to_brport 0.055578 seconds
[T] Got bridgeport to ifindex mapping 0.062116 seconds
[T] Got ifIndex to ifName mapping 3.0e-05 seconds
Total time spent on this vlan: 0.169879 seconds
Scanning VLAN: 29
[T] Start: 2013-10-28 17:49:29 +0000
[T] Got bportids_to_mac_table in 0.059332 seconds
[T] Got macidx_to_brport 0.061222 seconds
[T] Got bridgeport to ifindex mapping 0.147315 seconds
[T] Got ifIndex to ifName mapping 3.4e-05 seconds
Total time spent on this vlan: 0.267957 seconds
{1=>{"00:1b:d4:79:01:b4"=>"Gi1/3", "00:1f:9e:54:62:bf"=>nil},
2=>
{"00:00:0c:9f:f0:01"=>"Gi1/48",
"00:1a:a2:b6:fe:89"=>"Gi1/48",
"6c:9c:ed:1a:66:20"=>"Gi1/48",
"68:ef:bd:41:a5:42"=>"Gi1/48",
"6c:9c:ed:1c:5f:08"=>"Gi1/48",
"74:8e:f8:23:6f:a0"=>"Gi1/48",
"74:8e:f8:23:68:00"=>"Gi1/48",
"c4:71:fe:f1:c0:bf"=>"Gi1/48",
"c4:71:fe:f1:d7:3f"=>"Gi1/48"},
3=>{"00:00:0c:9f:f0:01"=>"Gi1/48", "c4:71:fe:f1:c0:bf"=>"Gi1/48"},
20=>
{"00:00:0c:9f:f0:01"=>"Gi1/48",
"c4:71:fe:f1:c0:bf"=>"Gi1/48",
"c4:71:fe:f1:d7:3f"=>"Gi1/48"},
29=>
{"00:00:0c:9f:f0:01"=>"Gi1/48",
"44:2b:03:9b:06:c0"=>"Gi1/9",
"6c:9c:ed:19:68:80"=>"Gi1/15",
"c4:71:fe:f1:c0:bf"=>"Gi1/48",
"c4:71:fe:f1:d7:3f"=>"Gi1/48",
"d8:67:d9:01:16:08"=>"Gi1/16"}}
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment