Cisco Discovery Protocol through SDK

Hello

is it possible to get the CDP information appearing on the Configuration - & gt; Networking of tab in the bubbles next to the vmnic in VC, via the Perl SDK? I couldn't find any clues in the API reference. It would help us to evidence the VLAN on the pSwitches.

Bye, Chris

You'll want to use the QueryNetworkHint method which returns the CDP information of your Cisco switches if you have enabled on the vSwitches and physical

=========================================================================

William Lam

VMware vExpert 2009

Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Twitter: @lamw

repository scripts vGhetto

Introduction to the vMA (tips/tricks)

Getting started with vSphere SDK for Perl

VMware Code Central - Scripts/code samples for developers and administrators

150 VMware developer

If you find this information useful, please give points to "correct" or "useful".

Tags: VMware

Similar Questions

  • Cisco Discovery Protocol

    How it would be easy to get the bottom out of codes in a worksheet. Ideally, each column be the name of the ESXi host and under these columns are the results returned.

    Get-VMHost | Where-Object {$_.State -eq "Connected"} |
    %{Get-View $_.ID} |
    %{$esxname = $_.Name; Get-View $_.ConfigManager.NetworkSystem} |
    %{ foreach($physnic in $_.NetworkInfo.Pnic){
        $pnicInfo = $_.QueryNetworkHint($physnic.Device)
        foreach($hint in $pnicInfo){
          Write-Host $esxname $physnic.Device
          if( $hint.ConnectedSwitchPort ) {
            $hint.ConnectedSwitchPort
          } else {
            Write-Host "No CDP information available."; Write-Host
          }
        }
      }
    }
    

    code found in http://KB.VMware.com/kb/1003885

    This will give you output CSV where each line is a host with its CDP properties

    cls
    $objReport = @()
    
    function Get-CDP    {
        $obj = @()
        Get-VMHost  | Where-Object {$_.State -eq "Connected"} | %{Get-View $_.ID} |
        %{$esxname = $_.Name; Get-View $_.ConfigManager.NetworkSystem} |
        %{ foreach($physnic in $_.NetworkInfo.Pnic){
    
            $obj = "" | Select-Object hostname, pNic,PortId,Address,vlan        
    
            $pnicInfo = $_.QueryNetworkHint($physnic.Device)
            foreach($hint in $pnicInfo){
              #Write-Host "$esxname $($physnic.Device)"
              $obj.hostname = $esxname
              $obj.pNic = $physnic.Device
              if( $hint.ConnectedSwitchPort ) {
                # $hint.ConnectedSwitchPort
                $obj.PortId = $hint.ConnectedSwitchPort.PortId
              } else {
                # Write-Host "No CDP information available."; Write-Host
                $obj.PortId = "No CDP information available."
              }
              $obj.Address = $hint.ConnectedSwitchPort.Address
              $obj.vlan = $hint.ConnectedSwitchPort.vlan
    
            }
            $objReport += $obj
          }
        }
    $objReport
    }
    
    $results = get-cdp
    $results |  Export-Csv "c:\temp\out.csv"
    
  • PPTP VPN Cisco IOS router through

    Hi all

    I was wondering if there is a trick to get PPTP to work through a Cisco router.  He was in fact at some point, but I don't remember what has been changed over time... However, it no longer works.

    Current configuration includes:

    * CBAC applied inbound and outbound on the Internet interface (I needed to add incoming to fix a problem with the mode passive FTP doesn't work is not on a FTP server hosted behind this router)

    * CBAC inspects, among other things, PPTP

    * ACL applied inbound on interface Internet, GRE and TCP 1723 admitted any intellectual property

    * No other ACL on the router

    * IOS 15.0 (1)

    * Inbound configuration NAT for TCP 1723 (currently using the WAN IP address)

    One thing I saw was so Troubleshooting "IKE Dispatcher: IKEv2 version detected 2, Dropping package! - but I think that it is a wrong journal (router as the Cisco VPN configuration example).

    The server is definitely okay - we are able to connect over PPTP VPN from the local network to the server.  So I think it's a sort of NAT problem, because I don't see anything dropped by the firewall.

    Anyone able to point me in the right direction?

    Thank you

    Hello

    Thanks for fix the "sh run". Could you change the following:

    IP nat inside source static tcp 10.77.99.11 1723 1723 road-map repeating sheep ccc.ccc.ccc.ccc

    to do this:

    IP nat inside source static tcp 10.77.99.11 1723 1723 extensible ccc.ccc.ccc.ccc

    It would be prudent to proceed with this change in the removal of the map of the route if no one connects to the server via the PPTP VPN.

    Let me know.

    Kind regards

    ANU

    P.S. Please mark this question as answered if it was resolved. Note the useful messages. Thank you!

  • Allow Cisco VPN Client through the firewall?

    Hello

    How can I allow a cisco VPN client work from the inside of our network to an external IP address?

    We have customers who wish to make use of their Cisco VPN Client companies but our ASA blocks I think?

    Also (sorry to ask) a friend in South America is having the same problem but I am not hink they use Cisco, is there a default port used by the client to Cisco? then I can send this info?

    Thank you

    Generally, the ASA will allow the IPSEC from the inside to outside traffic. This is when you want it came outside and connect to you - this is where it gets creative. You restrict outgoing traffic at all? You deny all ip/tcp/udp outgoing?

    But may depend on if the remote end is compaitable NAT - T, and if they have configured. Another question would be how they allow VPN traffic go?

  • To access the custom through SDK fields

    Hello

    Our VMWare administrators have added a custom field that is displayed as a column when virtual computers tab of swatches.

    Are there methods in the software development kit that would allow me to access the custom field?  I use c#, but I could probably use a Perl example as a starting point.

    Thank you

    Mick

    Take a look at these two scripts in the code example:

    addVMCustomField.pl

    queryVMCustomField.pl

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    repository scripts vGhetto

    VMware Code Central - Scripts/code samples for developers and administrators

    http://Twitter.com/lamw

    If you find this information useful, please give points to "correct" or "useful".

  • IEEE 802.3 af, options of distribution of power on Cisco products

    Hello world.

    IEEE 802.3af - 2003 described five 5 classes of power a device can belong to. It is worth noting that this isn't

    required that a seller of PSE implements classification of power, as these classifications are optional.

    Cisco implements this option in its IEEE - 802.3af - compliant device PoE (ip phone. AP, etc.) ?

    (1) cisco has adopted a cautious approach to the allocation of the authority by which the PSE will allocate either the IEEE 802.3af standard class, the Cisco Discovery Protocol negotiated value or 7W per device, the discovered device.

    (2) what is the default if we have a switch compatible cisco 802.Wireless af and cisco 802.3 af compatible peripheral PoE IE will allot of power using the classification of power or uses CDP to allocate the desired power or simply allocate 7w?

    Thank you

    What happens if the device was not a Cisco device?

  • Virtual machines communicate don't not via cisco 4001i module, can not ping gateway

    We have just buit IBM blade with a switch cisco nexus 4001i 10gE module.  The service console communicates via a different network module, but VM networks are mapped to network adapters that use the cisco nexus 4001i circulating on 10gE... Unfortunately, the service console connections are working properly, but virtual machines cannot ping the gateway.  We move the virtual machines on the service console network and they work.  The NIC adapaptors are configured to 10, 000mbps but are appearing at only 1, 000mbps.  Currently, we don't have all the switches-dv put in place and run on standard v-switches within ESX, which brings me to this question: VMware does require the nexus 1000v to work with cisco 4001i?  Also, another symptom, the cisco discovery Protocol is not collecting the information since the passage of these adapters that are connected to the 4001i but take the switch info at the other network management modules.

    Anyone have any ideas what we do wrong?

    Had a very similar problem with a very similar hardware.  Turned out to be a problem with a configuration between the Nexus 4000 and Catalyst switches they're connected too.

  • identify MAC VMNIC side addresses physical switch (cisco)

    I have several VMNIC connected to 2 network switches to balance the load of the guest computers.

    On ESX server if I run 'ifconfig - a' and can see the MAC addresses of each vmnic, but these are not the MAC addresses shown on the side of the cisco switch.

    How will I know what vmnic is related to what physical switch port?

    Another issue is on the support of the CDP (cisco Discovery Protocol), I see that ESX server has a status of 'listen', what do I need to activate 'advertising' for the cisco switch identify? Any relationship between?

    Thanks in advance.

    Take a look at this article for more information about the CDP: http://blog.scottlowe.org/2009/03/24/viewing-cdp-data-on-vmware-esx/

    You must activate this in the CLI by using the following:

    esxcfg-vswitch -B {listen,advertise,both,down} vSwitch0 
    
    (e.g.)
    esxcfg-vswitch -B both vSwitch0
    

    To see what it is defined, you can use:

    esxcfg-vswitch -B vSwitch0
    

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    http://Twitter.com/lamw

  • Get info via PowerShell CDP

    Hello all together.

    I'm looking for something really special. I hope someone can help me solve this problem here.

    I want a script (powershell) that show me for each ESX host in a VC CDP (Cisco Discovery Protocol) of the vmnic information.

    Seems to be a very big problem to get to this. I already tried to get this information through the ESX host themselves. But it seems not the ESX hosts to retrieve this information but rather of the VC. Right now I am able to get the information on what vmnic CDP is enabled but not information such as Switchname, Switchport...

    You have any ideas for that? It would help me a lot! Thanks for helping!

    And here's one I made earlier...

    http://teckinfo.blogspot.com/2008/12/detailed-VMware-host-network.html

    
    Connect-VIServer MYVISERVER
    Write "Gathering VMHost objects"
    $vmhosts = Get-VMHost | Sort Name | Where-Object {$_.State -eq "Connected"} | Get-View
    $MyCol = @()
    foreach ($vmhost in $vmhosts){
     $ESXHost = $vmhost.Name
     Write "Collating information for $ESXHost"
     $networkSystem = Get-view $vmhost.ConfigManager.NetworkSystem
     foreach($pnic in $networkSystem.NetworkConfig.Pnic){
         $pnicInfo = $networkSystem.QueryNetworkHint($pnic.Device)
         foreach($Hint in $pnicInfo){
             $NetworkInfo = "" | select-Object Host, PNic, Speed, MAC, DeviceID, PortID, Observed, VLAN
             $NetworkInfo.Host = $vmhost.Name
             $NetworkInfo.PNic = $Hint.Device
             $NetworkInfo.DeviceID = $Hint.connectedSwitchPort.DevId
             $NetworkInfo.PortID = $Hint.connectedSwitchPort.PortId
             $record = 0
             Do{
                 If ($Hint.Device -eq $vmhost.Config.Network.Pnic[$record].Device){
                     $NetworkInfo.Speed = $vmhost.Config.Network.Pnic[$record].LinkSpeed.SpeedMb
                     $NetworkInfo.MAC = $vmhost.Config.Network.Pnic[$record].Mac
                 }
                 $record ++
             }
             Until ($record -eq ($vmhost.Config.Network.Pnic.Length))
             foreach ($obs in $Hint.Subnet){
                 $NetworkInfo.Observed += $obs.IpSubnet + " "
                 Foreach ($VLAN in $obs.VlanId){
                     If ($VLAN -eq $null){
                     }
                     Else{
                         $strVLAN = $VLAN.ToString()
                         $NetworkInfo.VLAN += $strVLAN + " "
                     }
                 }
             }
             $MyCol += $NetworkInfo
         }
     }
    }
    $Mycol | Sort Host, PNic
    

    If you found this information useful, please consider the allocation of points for correct or helpful.

    Alan Renouf

    VMware, Citrix, Microsoft Consultant

    UK

  • What device is my node connected to (CLI)?

    I am currently engaged in trying to find what my current node device is connected to and which interface of this device, I am connected to know

    -I know not how to telnet (using putty)

    -I can prompt CMD and ipconfig/all to get my information from devices (and default gateway)

    -I understand ping/apr/cdp neighbors

    However, using these tools, I can't quite seem to put togeather how to find the next immediate device and the port I am connected to without that direct switch IP address on site.

    Make sure that the Cisco Discovery Protocol (CDP) is enabled globally on the switch (run cdp) and on each port (cdp enable). These are the default settings, but may have been disabled for security reasons. Launch Wireshark, filter by cdp packet type and move from one port to the other. Give CDP packets you change your name, IP, IOS version management, and what port you are connected to (among others).

  • SG200-08 newbie questions

    I recently bought the Smart Switch SG200-08, but I have some "beginner questions" on this subject that I started using it.

    The edge of the watch 1.0.1.0 firmware. What is the latest firmware for the switch?

    Should I enable auto configuring IPv6 and DCHPv6 in my switch settings to be ready for IPv6 as my ISP it place on the road?

    How can I go about changing of the switch username? I could easily change the password, but with problems for the user name to modify.

    Do I need to do anything on the LLDP-MED settings? What is that?

    How can I confugure time settings system so that the switch works in my timezone (Central USA time)?

    Thanks a bunch for all help!

    Hi Nathan,

    (1) firmware: it seems that the latest firmware for the SG200-08 is 1.0.5.1.  You can get it in the Software Download Center. I don't know if this link to the software would work, but let's see.

    (2) IPv6: You use NAT of your router? You're going to be using ipv4 or ipv6 internally addresses? Making assumptions on your network, I would like to leave it turned off for now.

    (3) user name: in the user interface web ther, click the administration drop-down list, and then click user accounts. You can add/modify/delete here.

    (4) LLDP (Link Layer Discovery Protocol) and CDP (Cisco Discovery Protocol) allows the switch directly connected neighbors and see their capabilities and settings automatically. Do you use other Cisco devices on your network or IP phones? For example, the vlan voice can be automatically determined using CDP/LLDP.  Please see p. 53 of SG200 Manual here for more details.

    (5) system time can be set under administration-> settings-> time time system.

    Best,

    David

    Please note all useful messages.

  • Access Port configuration

    We have Cisco TelePresence SX10 installed but I have problems with it... Switchport switch is configured with top 40 of VLANS and VLAN to the 24.Now when I attribute IP unit VC on 40 of VLAN static it not all Ping on the other hand when it is left on the DHCP protocol takes an IP address in VLAN 24 and works very well. For more to solve the problem, I have configured port switch as a single access VLAN 40 and it works fine:

    Scenario1:

    Switchport top 40 of VLANS and VLAN 24: VC with IP of VLAN static 40 - place: ping fails.

    Scenario2:

    Switchport top 40 of VLANS and VLAN 24: VC on DHCP takes IP from VLAN 24 for VLAN 40 has no DHCP scope defined - result: ping works

    Scenario3:

    Switchport top 40 of VLAN and not THE VLAN 24: VC with IP of VLAN static 40 - place: ping works.

    Any ideas as to what's wrong in scenario 1

    Thank you

    Karan

    The Cisco SX10 has a value for the mode of VLAN voice if it is set to auto and cdp (Cisco Discovery protocol) is present in the network the SX10 will use the value of vlan provided by CDP to crush any vlan manual.

    Vote kindly if it helps.

  • What is the average of tlv cdp?

    Anyone know this command is? how it will be useful for my server?

    Hello

    It's a Cisco proprietaryprotocol

    Cisco Discovery Protocol (CDP) is mainly used to get addresses of neighboring devices and discover the platform of these devices

    Type length values (TLV exposure) are components of the integrated information in advertisements for the COP, who gives details such as address,-l' the device id, platform...

    http://www.Cisco.com/en/us/docs/iOS/12_1/configfun/configuration/guide/fcd301c.html

    It is useful for devices Cisco discover neighbors and its details.

    Thank you

    Riadh

  • VMware esxi5 problemi con the rete. The comments not effettuano he ping back the host

    Hello to all,

    STO sbattendo tested con questo problema da at least due giorni e non capisco causa.

    Macchine comments sound provviste di due schede di rete ognuna delle quali punta ad UN vSwitch (vSwitch0-> vmnic0,-> vmnic1 vSwitch1).

    The prima anomalía sorge quando, tramite vSphere Client clicco sulle info delle vmnic, ed ottengo "Cisco Discovery Protocol is not available on this physical."

    adapter. Typing sulla shell he comando esxcfg-vswitch - b vSwitch0 ottengo two quindi in theory should be abilitato.

    The adapters sono delle Broadcom NetXtreme II BCM5709 1000Base-T network. By material questo ho anche da aggiornamento driver

    downloaded a questo link http://downloads.vmware.com/d/details/dt_esxi50_broadcom_netxtreme_17034v501/dCV0YnRAJXdidGVkZA==

    Unfortunately he problem persists. Some suggestions?

    Grazie anticipatamente.

    P.S. the community of Bella!

    Ciao,.

    da quello che vedo nello schema the vmk0/1 non sono taggate mentre I portgroup delle TR VM: a di seconda come sono gli switch substitutes devi indicare o the vlan corrretta sui vmk0/vmk1o n the vlan dai portgroup delle VM... is not information switch sugli hai substitutes... the ISP had to prove

    Giuseppe

  • Issue of CDP

    under the vSwitch, next to the NETWORK adapter card when I click on the icon so he revealed the news of Cisco Discovery Protocol, but it is all white? This could be because the CDP is disabled on the physical switch? I do not have access to the switch physical so I wonder... should it be activate? Thank you.

    If it's on LISTENING is ok, he is allowed to receive the CDP packets. Find this out to enable it on your swithces.

    http://KB.VMware.com/kb/1003885

    Marcelo Soares

    VMWare Certified Professional 310

    Technical Support Engineer

    Chief Executive Officer of the Linux server

Maybe you are looking for