Note that there are some explanatory texts on larger screens.

plurals
  1. POSNMP : cisco GigabitEthernet interface unreachable?
    primarykey
    data
    text
    <p><br> I can not request GigabitEthernet interfaces on a cisco switch 2960.<br> When I execute :</p> <pre><code>use Net::SNMP; use Net::SNMP::Interfaces; my $interfaces = Net::SNMP::Interfaces-&gt;new(Hostname =&gt; $hostname, Community =&gt; $community); my @inter = $interfaces-&gt;all_interfaces(); my $it; for my $i (@inter) { my $it = $i-&gt;ifDescr(); print $i-&gt;name()."\n"; } </code></pre> <p>I get the output :</p> <p>FastEthernet0/1<br> FastEthernet0/2<br> FastEthernet0/3<br> ...<br> FastEthernet0/23<br> FastEthernet0/24<br> GigabitEthernet0/1<br> GigabitEthernet0/2 </p> <hr> <p>So, up to now, everything's ok. </p> <p>I get the ifIndex of a GigabitEthernet interface (ex. GigabitEthernet0/2) :</p> <pre><code>my $in = $interfaces-&gt;interface("GigabitEthernet0/2"); print "INDEX:".$in-&gt;index()."\n"; </code></pre> <p>It returns :</p> <pre><code>INDEX:10102 </code></pre> <p>So, I know the ifIndex of my interface.<br> But I need to get the VLAN too, to get informations about speed, alias, duplex, mac address connected to this interface....</p> <p>Here start the problems :</p> <pre><code>#Listing all VLANS my $vmVlan = "1.3.6.1.4.1.9.9.68.1.2.2.1.2"; my $vlans = SnmpUtil-&gt;new($hostname, $community); my %vl = $vlans-&gt;requeteTable($vmVlan); foreach my $k (keys(%vl)) { print "Clef=$k Valeur=$vl{$k}\n"; } </code></pre> <p>It displays :<br> ...<br> Clef=10013 Valeur=1<br> Clef=10011 Valeur=1<br> Clef=10014 Valeur=1<br> Clef=10002 Valeur=10<br> ... </p> <p>But ifIndex of GigabitEthernet0/2 (10102) is not in this hash...<br> So I can not find the VLAN.<br> How to get all infos of GigabitEthernet interface ? Other solution ? Need some help, big reward ! </p> <hr> <p><em>EDIT</em> :<br> Solution found, GigabitEhernet ports seem to be on VLAN 1, even if they don't appear in lising vlan. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload