pt_apply_port_security
Configures port security on a switch access port by setting allowed MAC limits, violation mode, and sticky or static MAC addresses; use dry-run to validate CLI before deployment.
Instructions
Configures port-security on a switch's access port.
Parameters:
switch: switch name in PT.
port: access port (e.g. "FastEthernet0/1").
max_mac: maximum number of allowed MACs (default 1).
violation: "shutdown" (default) | "restrict" | "protect".
sticky: if True, learns sticky MACs (
mac-address sticky).static_macs: static MACs in IOS aaaa.bbbb.cccc format.
dry_run: if True, only validates and returns the CLI/payload.
Example: max 2 sticky MACs on SW1's Fa0/1: pt_apply_port_security(switch="SW1", port="FastEthernet0/1", max_mac=2, dry_run=True)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"switch": "<switch>",
"port": "<port>"
},
"name": "pt_apply_port_security"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | Yes | ||
| sticky | No | ||
| switch | Yes | ||
| dry_run | No | ||
| max_mac | No | ||
| violation | No | shutdown | |
| static_macs | No |