BGP-4
netverdict models BGP as a deterministic control-plane protocol for labs, change analysis, and policy reasoning. It is not a router image, but it does track the behaviours that usually matter in training and review scenarios: sessions, route advertisement, best-path selection, AS_PATH, LOCAL_PREF, MED, communities, route-maps, route reflection, confederations, and VPNv4.
Support level
Section titled “Support level”| Area | Level | What this means |
|---|---|---|
| IPv4 unicast BGP | Supported | eBGP / iBGP sessions, network statements, UPDATE propagation, Loc-RIB, Adj-RIB-style views. |
| Best-path selection | Supported | Deterministic subset of RFC 4271 path selection. |
| Policy | Supported | Prefix-lists, AS-path ACLs, community-lists, route-maps, inbound and outbound application. |
| Path attributes | Supported | AS_PATH, NEXT_HOP, ORIGIN, LOCAL_PREF, MED, communities. |
| Communities | Supported | Standard communities, exact community-list matching, expanded community-list regex matching. |
| Route reflection | Supported | route-reflector-client for iBGP reflection labs. |
| Peer-groups | Supported | Cisco-style and VyOS-style template inheritance. |
| Confederations | Supported | RFC 5065-style AS confederation identifier, peers, and AS_PATH handling. |
| Graceful restart | Partial | IOS bgp graceful-restart and neighbor ... ha-mode graceful-restart keep a peer’s routes for the restart time. No capability negotiation. EOS and Junos GR lines are not read. |
| Maximum-prefix | Supported | Prefix-limit teardown with notification-style behaviour. |
| MP-BGP VPNv4 | Supported | VPNv4 AF for L3VPN scenarios with RD / RT / VRF import-export behaviour. PE configs on IOS, IOS-XR, NX-OS, EOS and Junos. |
| PE-CE peerings | Supported | A neighbour configured in a VRF peers in that VRF’s own BGP table, keyed by (VRF, neighbour): two VRFs on one PE may each have a CE at the same address. |
| Timers | Partial | Keepalive / hold / connect retry are deterministic simulation timers. Update damping knobs are modelled where listed below. |
| Packet fidelity | Supported | One TCP/179 session per peering with OPEN, UPDATE, KEEPALIVE and NOTIFICATION, on the wire in a capture (Packet Lens), decoded by Wireshark. VPNv4 routes do not appear in a capture. |
| Address families | Supported | IPv4 and IPv6 unicast, VPNv4/VPNv6, L2VPN EVPN, IPv4/IPv6 FlowSpec, carried only where both ends activate them. |
| RPKI | Supported | Routes are valid, invalid or notfound; invalid routes can be dropped from best path. |
| Route flap damping | Supported | Penalty, decay, suppress and reuse. |
| Add-path | Supported | advertise additional-paths. |
Standards coverage
Section titled “Standards coverage”| Standard | Coverage | Notes |
|---|---|---|
| RFC 4271, BGP-4 | Behaviour model | OPEN / UPDATE-style session behaviour, route exchange, AS_PATH loop prevention, and best-path selection subset. |
| RFC 4271 section 5.1.2 | Supported | AS_PATH is tracked and used for loop prevention and path length comparison. |
| RFC 4271 section 5.1.3 | Supported | NEXT_HOP is tracked and used for recursive reachability decisions. |
| RFC 4271 section 5.1.4 | Supported | MED is modelled and compared between routes from the same neighbouring AS. |
| RFC 4271 section 5.1.5 | Supported | LOCAL_PREF defaults to 100 and can be changed by route-map or default local-preference. |
| RFC 4271 section 9.1.2.2 | Behaviour model | Best-path order is deterministic and documented below. |
| RFC 2385, TCP MD5 | Supported | neighbor ... password: a key on one end only, or two different keys, keep the session down. Salted encrypted keys count as present but are not compared. |
| RFC 1997, Communities | Supported | Standard communities are attached, matched, and propagated in policy scenarios. |
| RFC 4364, BGP/MPLS IP VPNs | Behaviour model | VPNv4 routes, route distinguishers, route-target import/export, and VRF route projection are modelled. |
| RFC 4456, Route Reflection | Supported | Route-reflector clients can receive reflected iBGP routes. |
| RFC 4724, Graceful Restart | Partial | Stale routes are kept for the restart time, then purged if the peer does not re-advertise them. The neighbour row stays, closed, with its reset reason and flap count. It is one-sided: there is no capability negotiation. |
| RFC 4760, Multiprotocol BGP | Supported | IPv6 unicast, VPN, EVPN and FlowSpec families. |
| RFC 6811, Origin Validation | Supported | RPKI states from ROAs. |
| RFC 2439, Route Flap Damping | Supported | Penalty with a maximum suppress time. |
| RFC 7911, Add-Path | Supported | More than one path per prefix to a peer. |
| RFC 5065, Confederations | Supported | Confederation identifier, peer sub-AS list, and confed AS_PATH treatment are modelled. |
| RFC 4486, BGP Cease Subcodes | Supported | Maximum-prefix sends Cease subcode 1 and closes both ends; a bgp router-id or route-reflector-client change sends subcode 6 (Other Configuration Change). The optional AFI/SAFI/limit data is not sent. |
Best-path order
Section titled “Best-path order”netverdict compares BGP candidates in this order:
| Step | Rule |
|---|---|
| 1 | EVPN only: the higher MAC mobility sequence number wins. |
| 2 | Locally originated routes win over received routes. |
| 3 | With RPKI best-path validation on: valid beats notfound beats invalid. |
| 4 | Higher weight wins. A route-map weight beats the peering’s neighbor weight. |
| 5 | Higher LOCAL_PREF wins. |
| 6 | Shorter AS_PATH wins. Confederation segments do not count toward length. |
| 7 | Lower ORIGIN wins: igp, then egp, then incomplete. |
| 8 | Lower MED wins when both routes came from the same neighbouring AS. |
| 9 | eBGP-learned routes beat iBGP-learned routes. |
| 10 | Lower IGP cost to NEXT_HOP wins. |
| 11 | Lower next-hop address wins as the final tie-break. |
There is no route-age step. Paths equal on every step are installed together when multipath allows it.
This is intentionally deterministic. Replaying the same topology with the same commands should produce the same best path.
Feature matrix
Section titled “Feature matrix”| Feature | Status | Notes |
|---|---|---|
router bgp <asn> | Supported | One BGP process per device. |
bgp router-id <ip> | Supported | Explicit router ID; otherwise derived by runtime. Changing the ID in use resets every session, as on IOS. |
| IPv4 unicast AF | Supported | Default working AF for classic BGP labs. |
address-family ipv4 | Supported | Includes VRF sub-mode for per-VRF neighbours. |
redistribute static|connected|ospf N in a VRF | Supported | Under address-family ipv4 vrf X (XR: router bgp / vrf X): the VRF’s routes are exported as VPNv4. A VRF’s connected subnets are exported only with redistribute connected (NX-OS redistribute direct route-map M). redistribute eigrp in a VRF is not read. |
address-family vpnv4 | Supported | Used by L3VPN / MP-BGP scenarios. |
network <prefix> mask <mask> | Supported | Locally originates IPv4 unicast or AF-specific routes. |
| eBGP neighbours | Supported | Remote-AS mismatch prevents establishment. A peer off the connected subnets needs ebgp-multihop or disable-connected-check. |
| iBGP neighbours | Supported | Same-AS neighbours participate in iBGP behaviour. A peering between loopbacks comes up only while each end has a route to the other’s address. |
neighbor ... activate | Supported | Top-level and AF-level activation. |
neighbor ... update-source | Supported | Source-interface setting for loopback-style sessions. |
neighbor ... next-hop-self | Supported | Rewrites NEXT_HOP for outbound advertisements. |
neighbor ... route-reflector-client | Supported | Enables route reflection for iBGP client scenarios. |
neighbor ... peer-group | Supported | Peer-group templates and binding. |
neighbor ... description | Supported | Stored and emitted for operator-visible config fidelity. |
neighbor ... shutdown | Supported | Forces the session down. |
neighbor ... ebgp-multihop [N] | Supported | Lets an eBGP peer off the connected subnets form, with TTL N (255 when bare). Both ends need it, and the shortest live path must fit the TTL (bgp.ebgp-not-connected, bgp.ebgp-ttl-exceeded). Captured eBGP frames carry the TTL. GTSM (RFC 5082): neighbor X ttl-security hops N (IOS, NX-OS) and EOS ttl maximum-hops N send TTL 255 and accept a session only at TTL ≥ 256 − N; IOS refuses it together with ebgp-multihop |
neighbor ... disable-connected-check | Supported | Lifts the connected check; the TTL stays 1, so a loopback one routed hop away is reachable. |
neighbor ... password | Supported | TCP-MD5. A key on one end only leaves the session Idle with bgp.md5-missing; different keys give bgp.md5-mismatch. Type 7 keys are decoded. |
neighbor ... fall-over bfd | Supported | Opens a BFD session when both ends ask. BFD down tears down only a peering that asked; BFD for OSPF or IS-IS on the same link does not. Single-hop only (see BFD). |
neighbor ... ha-mode graceful-restart [disable] | Supported | Turns graceful restart on or off for one peer. |
neighbor ... maximum-prefix | Supported | Tears down the session when accepted prefixes exceed the configured limit: the NOTIFICATION reaches the peer, the row stays Idle (PfxCt) with “Peer over prefix limit”, and only clear ip bgp brings it back. The NOTIFICATION carries AFI, SAFI and the limit (RFC 4486 §4); show ip bgp neighbors counts NOTIFICATIONs sent and received. |
neighbor ... soft-reconfiguration inbound | No effect | Pre-policy routes are always kept, so the line changes nothing. |
neighbor ... advertisement-interval | Not modelled | The line is not read. UPDATEs are sent incrementally: only what changed. |
neighbor ... as-origination-interval | Not modelled | The line is not read. |
neighbor ... send-community | Supported | On IOS, communities reach the peer only with this line. |
neighbor ... weight | Supported | Router-local preference, compared before LOCAL_PREF. |
neighbor ... allowas-in | Supported | Accepts routes carrying the local AS. |
neighbor ... remove-private-as | Supported | Strips private ASNs toward eBGP peers. |
neighbor ... default-originate | Supported | Sends a default route to the peer. |
neighbor ... advertise additional-paths | Supported | Add-path. |
maximum-paths / bgp bestpath as-path multipath-relax | Supported | BGP multipath, including across different neighbouring ASes. |
bgp dampening | Supported | Route flap damping. |
bgp rpki server … | Supported | Turns on origin validation. |
| Prefix-list policy | Supported | neighbor ... prefix-list NAME in / out. |
| Route-map policy | Supported | neighbor ... route-map NAME in / out. |
Route-map continue [N] | Supported | IOS, EOS and NX-OS. A matching permit applies its sets and evaluation goes on at clause N, or the next clause. On a deny clause: No effect. |
IOS-XR route-policy | Supported | Nested if, and / or / not, apply with parameters, route-policy NAME(arg) in. See Route Policy. |
| AS-path access-list | Supported | Cisco AS-path regular expressions in an ordered permit/deny list, first match, implicit deny. An invalid regex is reported. See Route Policy. |
neighbor ... filter-list N in / out | Supported | in checks the received path. out checks the path before the router prepends its own AS, so permit ^$ sends only the router’s own routes. |
| Standard community-list | Supported | Exact community matching. |
| Expanded community-list | Supported | Patterns are read as ranges of asn:value, including _<asn>:. |
set local-preference | Supported | Route-map action. |
set as-path prepend | Supported | Route-map action. set as-path prepend last-as N is read too. |
set metric | Supported | MED route-map action. +N and -N are relative and stop at 0. |
match metric, match local-preference, match origin | Supported | IOS, EOS and NX-OS. match metric N +- D is a MED window. match local-preference takes one value. |
set community | Supported | Supports replacement, additive, and none. Several values on one line are all kept. set comm-list NAME delete strips a list’s communities. |
set ip next-hop | Supported | Inbound and outbound. Outbound it reaches eBGP peers too and holds over next-hop-self. peer-address is supported. See Route Policy. |
set origin | Supported | igp, egp [AS], incomplete. The AS is dropped. |
set weight | Supported | In an inbound route-map: a weight per route. It overrides neighbor ... weight, as on IOS. |
bgp default local-preference | Supported | Default LOCAL_PREF for local originated routes. |
bgp graceful-restart [restart-time N] | Supported | Graceful restart on every peering. Routes are kept for the restart time (120 s by default). stalepath-time is read and not kept. Written back. |
bgp confederation identifier | Supported | Public confederation AS. |
bgp confederation peers | Supported | Member sub-AS list. |
aggregate-address | Supported | Advertises the summary with ATOMIC_AGGREGATE and AGGREGATOR; summary-only suppresses the components. |
| Unnumbered BGP | Supported | neighbor <interface> interface remote-as external: the peer is whatever is on the other end of the link. |
| Add-path | Supported | More than one path per prefix can be advertised to a peer. |
| Route flap damping | Supported | Penalty, half-life decay, suppress and reuse limits, maximum suppress time. |
| RPKI / origin validation | Supported | Valid / invalid / notfound per route; invalid routes can be withheld from best path. |
Vendor command matrix
Section titled “Vendor command matrix”| Command | IOS-style | Junos-style | VyOS-style | Notes |
|---|---|---|---|---|
router bgp 65001 | Supported | n/a | n/a | Cisco-family process mode. |
bgp router-id 1.1.1.1 | Supported | Supported | Supported | Maps to canonical router ID. |
neighbor 10.0.0.2 remote-as 65002 | Supported | Supported | Supported | Core numbered neighbour form. |
neighbor 10.0.0.2 update-source Loopback0 | Supported | Supported | Supported | Source-interface intent. |
neighbor 10.0.0.2 next-hop-self | Supported | Supported | Supported | Also available in AF form on some vendors. |
neighbor 10.0.0.2 route-reflector-client | Supported | Supported | Supported | Used for iBGP reflection scenarios. |
neighbor 10.0.0.2 description TEXT | Supported | Supported | Supported | Stored / emitted as metadata. |
neighbor 10.0.0.2 shutdown | Supported | Supported | Supported | Administrative down. |
set protocols bgp group G type internal | n/a | Supported | n/a | Junos iBGP group: local-address A sources the sessions, cluster C makes the members reflector clients (the cluster ID itself has no effect). |
neighbor 10.0.0.2 ebgp-multihop 4 | Supported | Supported | Not modelled | Junos: multihop [ttl N] (64 when bare). Needed for an eBGP peer off the connected subnets. |
neighbor 10.0.0.2 password SECRET | Supported | Supported | Not modelled | TCP-MD5 key. Junos: authentication-key. EOS and NX-OS password are read too. |
neighbor 10.0.0.2 fall-over bfd | Supported | Supported | Not modelled | Junos: bfd-liveness-detection. EOS and NX-OS bfd are read too. |
neighbor 10.0.0.2 maximum-prefix 100 | Supported | Not yet | Partial | Prefix-limit session teardown. |
neighbor 10.0.0.2 route-map RM in | Supported | Partial | Supported | Policy maps to canonical route-map references. |
neighbor 10.0.0.2 prefix-list PL out | Supported | Partial | Supported | Prefix-list policy. |
neighbor PEERS peer-group | Supported | n/a | Supported | Template / inheritance model. |
neighbor 10.0.0.2 peer-group PEERS | Supported | n/a | Supported | Binding to template. |
address-family ipv4 | Supported | n/a | Supported | Cisco / VyOS syntax differs but maps to IPv4 unicast AF. |
address-family ipv4 vrf BLUE | Supported | Supported | Partial | Per-VRF IPv4 BGP: PE-CE peerings. Junos: routing-instances X protocols bgp. |
address-family vpnv4 | Supported | Supported | Partial | MP-BGP VPNv4. Junos: family inet-vpn unicast. EOS: address-family vpn-ipv4. |
network 192.0.2.0 mask 255.255.255.0 | Supported | Supported | Supported | Locally originated route. |
bgp default local-preference 200 | Supported | Supported | Partial | Default local-pref for local originated routes. |
bgp graceful-restart | Supported | Not modelled | Not modelled | Restart window per peering; neighbor X ha-mode graceful-restart per peer. |
bgp confederation identifier 65000 | Supported | Partial | Supported | RFC 5065 model. |
bgp confederation peers 65001 65002 | Supported | Partial | Supported | Member sub-AS list. |
aggregate-address 10.0.0.0 255.0.0.0 | Supported | Not yet | Not yet | Summary route; add summary-only to suppress components. |
show ip bgp | Supported | Supported | Supported | IOS layout: full legend, every path (*>, *, *m, *>i, r, s, d), Next Hop, Metric, LocPrf, Weight, Path; classful networks without their length. NX-OS and EOS print their own layouts; Junos show route protocol bgp. show ip bgp PREFIX shows each path’s detail. |
show ip bgp summary | Supported | Supported | Supported | Router ID, table version, real message counts (sent = what the peer received), Up/Down from the clock, State/PfxRcd (Idle, Active, Idle (Admin), Idle (PfxCt)). NX-OS, EOS, VyOS (FRR), EdgeOS (ZebOS layout, approximated), IOS-XR (show bgp [ipv4|ipv6|vpnv4 unicast] summary) and Junos show bgp summary (every table: inet.0, inet6.0, bgp.l3vpn.0, NAME.inet.0) print their own layouts. Each address family keeps its own table version. Memory lines are left out. |
Junos show bgp neighbor [A] | n/a | Supported | n/a | Junos layout: peer and local address with ports, type, state, last state/event/error, hold times, peer and local ID, NLRI, per-table prefix counts, last traffic, message totals. |
show ip bgp neighbors | Supported | Vendor-shaped view | Vendor-shaped view | IOS layout: router ID, up time, hold/keepalive, capabilities, message statistics, per-family prefixes, connections established/dropped, Last reset … due to …. |
show ip bgp neighbors <ip> received-routes | Supported | Partial | Partial | What the peer sent, before inbound policy; routes shows what was accepted. |
show ip bgp neighbors <ip> advertised-routes | Supported | Partial | Partial | Post-policy RIB-Out view. |
show ip bgp peer-group | Supported | n/a | Partial | Shows peer-group templates and bindings. |
show ip bgp confederation | Supported | n/a | Partial | Shows confederation state. |
show bgp vpnv4 unicast all|vrf X [summary] | Supported | Vendor-shaped view | n/a | VPNv4 table under each VRF’s RD. Also IOS show ip bgp vpnv4, XR show bgp vrf X, NX-OS show bgp vpnv4 unicast, EOS show bgp vpn-ipv4, Junos show route table bgp.l3vpn.0. |
show ip community-list [NAME] | Supported | n/a | n/a | Standard and expanded community lists with their entries. |
Behaviour notes
Section titled “Behaviour notes”BGP timers are simulated in the event queue. The engine does not sleep for real keepalive or hold timers; it schedules deterministic events so tests, labs, and shared URLs replay consistently.
Policy is applied in the same direction users expect: inbound policy affects
what enters the local BGP table, and outbound policy affects what the peer sees.
received-routes and advertised-routes are useful because they let you
inspect both sides of that boundary.
Route-map matching is deliberately concrete. Prefix-lists match prefixes.
AS-path ACLs are Cisco AS-path regular expressions, evaluated as a whole list.
Standard community-lists match exact community values. Expanded community-lists are read as ranges of
asn:value, such as 65000:* or _65000:.
Graceful restart keeps stale paths during the restart window and purges them
if the returning peer no longer has them. IOS bgp graceful-restart turns it
on for every peering, neighbor X ha-mode graceful-restart for one. It is
one-sided: the peer’s capability is not negotiated.
A session forms only if its transport would. TCP-MD5 keys must match at both
ends. An eBGP peer off the connected subnets needs ebgp-multihop or
disable-connected-check at both ends, and the shortest live path must fit
the TTL. iBGP has neither rule, but a peering off the connected subnets (such
as loopback to loopback) needs a route each way, as TCP does.
VPNv4 is designed around practical L3VPN reachability: VRF route distinguishers make otherwise-overlapping prefixes unique, route targets control import/export, and MP-BGP carries the VPN route between PEs. A PE-CE peering passes the same transport checks as a global one (MD5, the eBGP connected check), looked up in its VRF. See MPLS L3VPN.
Examples
Section titled “Examples”Basic eBGP
configure terminalrouter bgp 65001 bgp router-id 1.1.1.1 neighbor 10.0.12.2 remote-as 65002 address-family ipv4 network 192.168.1.0 mask 255.255.255.0 neighbor 10.0.12.2 activateendshow ip bgp summaryshow ip bgpVendor styles
IOS-style
router bgp 65001 bgp router-id 1.1.1.1 neighbor 10.0.12.2 remote-as 65002 address-family ipv4 network 192.0.2.0 mask 255.255.255.0 neighbor 10.0.12.2 activate neighbor 10.0.12.2 route-map CUSTOMER-IN inJunos-style
set routing-options router-id 1.1.1.1set routing-options autonomous-system 65001set protocols bgp group EBGP type externalset protocols bgp group EBGP peer-as 65002set protocols bgp group EBGP neighbor 10.0.12.2 import CUSTOMER-INset policy-options policy-statement CUSTOMER-IN then local-preference 200VyOS-style
set protocols bgp system-as 65001set protocols bgp parameters router-id 1.1.1.1set protocols bgp neighbor 10.0.12.2 remote-as 65002set protocols bgp address-family ipv4-unicast network 192.0.2.0/24set protocols bgp neighbor 10.0.12.2 address-family ipv4-unicast route-map import CUSTOMER-INSet LOCAL_PREF inbound
configure terminalroute-map PREFER-R2 permit 10 set local-preference 200router bgp 65001 neighbor 10.0.12.2 route-map PREFER-R2 inendshow ip bgpPrepend AS_PATH outbound
configure terminalroute-map PREPEND-OUT permit 10 set as-path prepend 65001 65001 65001router bgp 65001 neighbor 10.0.12.2 route-map PREPEND-OUT outendshow ip bgp neighbors 10.0.12.2 advertised-routesTag and match a community
configure terminalip community-list standard CUSTOMER-A permit 65001:100route-map TAG-OUT permit 10 set community 65001:100 additiveroute-map ACCEPT-CUSTOMER-A permit 10 match community CUSTOMER-Arouter bgp 65001 neighbor 10.0.12.2 route-map TAG-OUT outendConfigure a route reflector client
configure terminalrouter bgp 65000 neighbor 10.0.1.2 remote-as 65000 neighbor 10.0.1.2 route-reflector-client neighbor 10.0.2.2 remote-as 65000 neighbor 10.0.2.2 route-reflector-clientendshow ip bgp summaryEnable graceful restart
configure terminalrouter bgp 65000 bgp graceful-restart bgp graceful-restart restart-time 240 bgp graceful-restart stalepath-time 600endshow ip bgp summaryRunnable labs
Section titled “Runnable labs”| Lab | Covers | Link |
|---|---|---|
| BGP local preference | Inbound policy and best-path preference | Open lab |
| BGP AS-path prepend | Outbound route-map policy and AS_PATH length | Open lab |
| BGP community tag and filter | Standard communities and community-list policy | Open lab |
| BGP MED | MED as same-neighbour-AS tiebreak | Open lab |
| BGP expanded community-list | Regex matching against printed community values | Open lab |
Known limits
Section titled “Known limits”netverdict does not aim to reproduce every vendor BGP daemon edge case.
The current model does not read advertisement-interval, and does not carry
large communities or BGP-LS. In a route-map, match local-preference with a
list of values and set ip next-hop with several addresses are not read.
Graceful restart has no capability negotiation, and EOS and Junos GR lines are
not read. Salted encrypted MD5 keys are not compared. fall-over bfd is
single-hop only.
VPNv4/VPNv6 routes and sessions over IPv6 transport are modelled but do not
appear in a capture.
Use this page as a support contract for the simulator’s BGP behaviour: precise where it says supported, explicit where it is partial, and quiet about things that are not modelled yet.