Forum Discussion
6 Replies
Sort By
- myfive_65296
Nimbostratus
Please assist. - JRahm
Admin
You'll need two commands, b self list and b vlan list. I don't think there is a direct map of self to interface. - JRahm
Admin
Might be tricky in environments where a vlan is multiple interfaces, though. Maybe a console perl script to take care of this mapping for you? - L4L7_53191
Nimbostratus
In that specific case it would be valid to say that the self-ip is mapped to all interfaces in that vlan, so you should be covered there as well, no? - hwidjaja_37598
Altostratus
Try this:!/usr/bin/perl use strict; my ($vlan); my (%int); my (%trunk); $b = '/bin/bigpipe'; open cmd, "$b trunk list |" || die "error: $b trunk list"; while ( ) { $vlan=$1 if (/^trunk\s+([^\s]+)\s+\{/i); $trunk{$vlan}=$1 if (/^\s+interface\s+(.+)/i); } close cmd; open cmd, "$b vlan list |" || die "error: $b vlan list"; while ( ) { $vlan = $1 if (/^vlan\s+([^\s]+)\s+\{/i); $int{$vlan}=$1 if (/^\s+interfaces\s+(.+)/i); $int{$vlan}= "$1: $trunk{$1}" if (/^\s+trunks\s+(.+)/i); } close cmd; open cmd, "$b self list |" || die "error: $b self list"; while ( ) { print "$1 = " if (/^self\s+([^\s]+)\s+\{/i); print "$1 ($int{$1})\n" if (/^\s+vlan\s+([^\s]+)/i); } close cmd;
[root@ltm:Active] ~ perl hum 10.10.10.10 = ext (1.3) 11.0.0.40 = int (1.6) 20.1.1.1 = tagged_vlan (tagged 1.2) 1.1.1.2 = trunk_vlan (tr_test: 1.10 1.11) 1:1:1:1:ffff:ffff:ffff:eeee = vlan6 (1.1)
- JRahm
Admin
Nice work, Hum! That's where I was going, just didn't get there fast enough...