Hi Ryan,
I'd translate that to
profile support {
if (service == shell) {
if (cmd == "") { # shell startup
set priv-lvl = 15
permit
}
if (cmd =~ /^show/) permit
if (cmd =~ /^configure terminal) permit
if (cmd =~ /^configure vlan/) permit
if (cmd =~ /^configure ports all/) deny
if (cmd =~ /^configure ports/) permit
if (cmd =~ /^configure inline-power/) permiot
if (cmd =~ /^no switchport trunk/) deny
if (cmd =~ /^no shutdown/) permit
...
if (cmd =~ /^no vstack/) permit
if (cmd =~ ^vlan/) deny
deny # all other commands
}
deny # all other service
}
These Perl regular expressions are only anchored on the left side (^),
it might be advisable to add some right-side anchoring, too, or at least
add some white-space. Examples:
if (cmd =~ /^show /) permit
if (cmd =~ /^no switchport trunk <cr>$/) deny
This largely depends on the command attributes you device is actually
sending.
Cheers,
Marc