Forum Discussion
Anthony_Gerace_
Nov 16, 2004Historic F5 Account
Retrieve vlan mac address with get_true_mac_address method
Hi!
I was tasked with the project to retrieve the MAC addresses in use by BIG-IP. I have attempted to use the get_true_mac_address method in ITCMNetworking/VLAN. I am getting nothing coming back.
Any ideas?
Thanks,
Anthony
String get_true_mac_address(
in SessionCredentials creds, <== CORBA Specific
in String vlan_name
);
$soap = SOAP::Lite
-> uri('urn:iControl:ITCMNetworking/VLAN')
-> proxy("https://$sHost/iControl/iControlPortal.cgi");
$vName = "external";
$soap_response = $soap->get_true_mac_address(SOAP::Data->name(vlan_name => $vName ) );
$macAddr = $soap_response->result;
print "\nVlan Name: $vName MAC Address: $macAddr\n";
- By default, VLANs don't have a Layer 2 static forwarding table defined. If your query on the VLAN for the true mac address and it hasn't been defined then the iControl request will return an empty string. Take a look at the Administration GUI and drill down into the VLAN in question and my guess that the forwarding table is empty.
&getVLANMacAddresses(); ----------------------------------------------------- checkResponse ----------------------------------------------------- sub checkResponse() { my ($soapResponse) = (@_); if ( $soapResponse->fault ) { print $soapResponse->faultcode, " ", $soapResponse->faultstring, "\n"; exit(); } } ----------------------------------------------------- Query Interface List ----------------------------------------------------- sub getVLANMacAddresses() { $soapResponse = $VLAN->get_list(); &checkResponse($soapResponse); @vlanList = @{$soapResponse->result}; foreach $vlan (@vlanList) { print "VLAN : $vlan\n"; $soapResponse = $VLAN->get_interfaces ( SOAP::Data->name(vlan_name => $vlan) ); &checkResponse($soapResponse); @InterfaceEntryList = @{$soapResponse->result}; foreach $InterfaceEntry (@InterfaceEntryList) { $intf_name = $InterfaceEntry->{"intf_name"}; $intf_type = $InterfaceEntry->{"intf_type"}; $iType = "UNTAGGED"; if ( $intf_type == 0 ) { $iType = " TAGGED"; } $soapResponse = $Interfaces->get_mac_address ( SOAP::Data->name(intf_name => $intf_name) ); &checkResponse($soapResponse); $macAddress = $soapResponse->result; print " Interface $intf_name ($iType) : $macAddress\n"; } } }
- Anthony_Gerace_Historic F5 AccountHi Joe,
- Didn't the code I provided query the VLAN mac addresses? It queries the vlan list, and for each it finds the interfaces that it's associated with and then uses the Interfaces::get_mac_address() method to get the mac address.
- bknotwell_12713Historic F5 AccountCRs have been added for this issue on both the 4.5 (42750) and 4.6 (42751) branches.
- bknotwell_12713Historic F5 AccountCR42750* is checked into 4.6.3.
- bknotwell_12713Historic F5 AccountCR42751 is checked in to 4.5.13.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects