pt_apply_bgp
Configures and verifies BGP on a Packet Tracer router via IOS CLI, setting ASN, neighbors, and network advertisements with optional dry-run validation.
Instructions
Configures BGP on a router through IOS CLI, each line verified (router bgp,
neighbor <ip> remote-as, network <net> mask <mask>). Measured on a 2911 in PT 9.
router: router name in PT.
asn: local AS, 1-65535 (4-byte ASNs were not measured).
neighbors: [{"ip": "10.0.0.2", "remote_as": 65002}]; remote_as == asn is iBGP. With PT connected, a neighbor off every connected subnet is a warning.
networks: CIDR list, host bits zero, e.g. ["192.168.1.0/24"]. BGP only advertises a network that is in the routing table with that exact mask.
show running-configprints a classful one withoutmask.dry_run: validate and return the CLI/payload without sending.
Example: pt_apply_bgp(router="R1", asn=65001, neighbors=[{"ip": "10.0.0.2", "remote_as": 65002}], networks=["192.168.1.0/24"]) Check: pt_cli(device="R1", commands=["show ip bgp summary"]).
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": {
"router": "<router>",
"asn": "<asn>"
},
"name": "pt_apply_bgp"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| asn | Yes | ||
| router | Yes | ||
| dry_run | No | ||
| networks | No | ||
| neighbors | No |