xutil.dev
Login

BGP / Routing Cheatsheet

Quick reference for BGP and routing commands covering BGP configuration, attributes, route-maps, prefix-lists, communities, troubleshooting, OSPF, and EIGRP

Related Categories:Network

69 commands

router bgp {ASN}

Start BGP process

neighbor {ip} remote-as {ASN}

Define BGP neighbor

network {prefix} mask {mask}

Advertise network in BGP

neighbor {ip} update-source {iface}

Set update source interface

neighbor {ip} ebgp-multihop {ttl}

Set eBGP multihop

neighbor {ip} next-hop-self

Set next-hop to self

neighbor {ip} password {key}

Set MD5 authentication for neighbor

neighbor {ip} shutdown

Disable BGP neighbor

neighbor {ip} timers {keepalive} {hold}

Set BGP timers

bgp router-id {ip}

Set BGP router ID

bgp log-neighbor-changes

Log neighbor state changes

no synchronization

Disable IGP synchronization

neighbor {ip} weight {n}

Set Weight attribute (local preference)

bgp default local-preference {n}

Set default Local Preference

set local-preference {n}

Set Local Preference in route-map

set as-path prepend {ASN}

Prepend ASN to AS-PATH

set metric {n}

Set MED (Multi-Exit Discriminator)

set origin {igp|egp|incomplete}

Set Origin attribute

bgp bestpath as-path ignore

Ignore AS-PATH length in best path

bgp always-compare-med

Compare MED across different ASes

maximum-paths {n}

Set maximum equal-cost paths

route-map {name} permit {seq}

Create route-map permit entry

route-map {name} deny {seq}

Create route-map deny entry

match ip address prefix-list {name}

Match using prefix list

match as-path {acl}

Match by AS-PATH

match community {list}

Match by community

neighbor {ip} route-map {name} in

Apply route-map inbound

neighbor {ip} route-map {name} out

Apply route-map outbound

ip prefix-list {name} permit {prefix}

Permit prefix

ip prefix-list {name} deny {prefix}

Deny prefix

ip prefix-list {name} permit {prefix} le {n}

Permit prefix with max length

ip prefix-list {name} permit {prefix} ge {n}

Permit prefix with min length

ip prefix-list {name} seq {n} permit {prefix}

Permit prefix with sequence number

neighbor {ip} prefix-list {name} in

Apply prefix list inbound

neighbor {ip} prefix-list {name} out

Apply prefix list outbound

show ip prefix-list {name}

Show prefix list contents

set community {value}

Set community value

set community {value} additive

Add to existing communities

set community no-export

Set no-export community

set community no-advertise

Set no-advertise community

set community local-AS

Set local-AS community

ip community-list standard {name} permit {val}

Create standard community list

ip bgp-community new-format

Display communities in AA:NN format

neighbor {ip} send-community

Send communities to neighbor

show ip bgp summary

Show BGP neighbor summary

show ip bgp

Show BGP table

show ip bgp neighbors {ip}

Show specific neighbor details

show ip bgp neighbors {ip} received-routes

Show routes received from neighbor

show ip bgp neighbors {ip} advertised-routes

Show routes advertised to neighbor

show ip bgp {prefix}

Show details for specific prefix

clear ip bgp *

Reset all BGP sessions

clear ip bgp {ip} soft in

Soft reset inbound policy for neighbor

debug ip bgp updates

Enable BGP update debugging

show ip route bgp

Show BGP learned routes

router ospf {id}

Start OSPF process

network {ip} {wildcard} area {id}

Assign network to OSPF area

ip ospf cost {n}

Set interface OSPF cost

area {id} stub

Configure stub area

area {id} nssa

Configure NSSA area

show ip ospf neighbor

Show OSPF neighbors

show ip ospf database

Show OSPF database

redistribute bgp {ASN} subnets

Redistribute BGP into OSPF

router eigrp {ASN}

Start EIGRP process

network {ip} {wildcard}

Configure EIGRP network

no auto-summary

Disable auto-summary

eigrp router-id {ip}

Set EIGRP router ID

show ip eigrp neighbors

Show EIGRP neighbors

show ip eigrp topology

Show EIGRP topology table

redistribute bgp {ASN}

Redistribute BGP into EIGRP