How can I detect a Switchport in Config Change Templates? My attempt was to check if the Interface has IP addresses:
int @isrouted = 0
// Increment if an IP exists
foreach(@ip in @myInterface.IpAddresses){
if(@myInterface.InterfaceIndex == @ip.InterfaceIndex){
@isrouted = @isrouted + 1
}
}
if(@isrouted > 0){
CLI{
! this interface is routed
}
}else{
CLI{
! Probably a Switchport?
}
}
The problem is, that a routed port without an IP address assigned gets declared as "swichport". Additionally, if I managed to successfully detect a switchport, how can I determine the switchport's mode like access, trunk or voice?