Routing

Routers build a real routing table from connected networks, static routes, OSPF, EIGRP and BGP, by administrative distance and metric. Packets follow it hop by hop: ping and traceroute take the path the tables give.

Interfaces and router-on-a-stick

Router
Under interface Gi0/0
ip address 10.0.12.1 255.255.255.252The interface's address; its network becomes a connected route.
no shutdownRouter interfaces start shut.
Under interface Gi0/1
no shutdownThe parent of the subinterfaces must be up.
Under interface Gi0/1.10
encapsulation dot1Q 10The subinterface handles VLAN 10's tagged frames. It needs this before an address, as in IOS.
ip address 10.0.10.1 255.255.255.0The gateway of VLAN 10.
Under interface Gi0/1.99
encapsulation dot1Q 99 nativeThe native VLAN: untagged frames.
Under interface Loopback0
ip address 10.255.0.1 255.255.255.255A loopback: always up, often the router ID.
Under interface Gi0/2
bandwidth 10000The bandwidth OSPF uses for the interface's cost, in kb/s.

Static and floating routes

Router
In global configuration
ip route 0.0.0.0 0.0.0.0 10.0.12.2A default route through a next hop.
ip route 0.0.0.0 0.0.0.0 10.0.13.2 10A floating default route: distance 10, used only when the first one is gone.
ip route 192.168.50.0 255.255.255.0 Gi0/2A route out of an interface.
ip route 10.9.0.0 255.255.0.0 Null0A discard route, for a summary.
ip route 0.0.0.0 0.0.0.0 10.0.12.2 track 1A route that is in the table only while track object 1 is up, for failover with IP SLA (see IP services).
In privileged EXEC
show ip routeThe routing table, with codes, distance/metric and next hops.
show ip route staticOnly the static routes (connected, ospf, bgp or an address work too).
traceroute 8.8.8.8Each hop on the way, from the routing tables. A hop with an ip host entry or a PTR record on the name servers prints by name.
traceroute 8.8.8.8 source Loopback0 probe 5 ttl 2 10 numericOptions: the source, the probes per hop, the first and last TTL, and numeric to skip the name lookups (port sets the UDP port, which ACLs see).
tracerouteThe extended traceroute: it asks for the target, source, numeric display, probe count, minimum and maximum TTL and port. Enter keeps the default in brackets.
ping 10.0.12.2 source Loopback0A ping from another of the router's addresses (repeat 20 sends more).
ping 10.0.12.2 size 1500 df-bitA 1500-byte ping that may not be fragmented: an interface on the way with a smaller ip mtu answers M.
pingThe extended ping: it asks for the target, repeat count, size and, after "Extended commands [n]: y", the source and the DF bit. Enter keeps the default in brackets.

A route whose next hop isn't reachable doesn't enter the table, and a recursive route follows another route to its next hop, as in IOS.

Administrative distance

When several sources offer the same prefix, the lowest distance wins: connected 0, static 1, EIGRP summary 5, eBGP 20, EIGRP 90, OSPF 110, EIGRP external 170, iBGP 200. A static route with a distance above a protocol's is a floating static.

Router
In global configuration
ip route 10.30.30.0 255.255.255.0 10.0.13.2 250A floating static: in the table only while no protocol knows the prefix.
Under router ospf 1
distance 80Every OSPF route on this router gets distance 80.
distance ospf intra-area 100 inter-area 105 external 175A distance per OSPF route type (any of the three).
Under router eigrp 100
distance eigrp 90 175EIGRP internal and external distances (named mode: under topology base).
Under router bgp 65000
distance bgp 20 200 200eBGP, iBGP and local BGP distances.
In privileged EXEC
show ip route 10.30.30.0Which source won the prefix, with its distance and metric.

IPv6

Router
In global configuration
ipv6 unicast-routingLets the router forward IPv6 and send router advertisements.
Under interface Gi0/0
ipv6 address 2001:db8:12::1/64A global address.
Under interface Gi0/1
ipv6 address 2001:db8:10::/64 eui-64A global address from the prefix and the MAC (EUI-64).
ipv6 address fe80::1 link-localA fixed link-local address.
In global configuration
ipv6 route ::/0 2001:db8:12::2An IPv6 default route.
In privileged EXEC
show ipv6 interface briefEach interface's IPv6 addresses.
show ipv6 routeThe IPv6 routing table.

Hosts on a link where a router advertises a prefix configure themselves with SLAAC.

OSPFv2

OSPF forms adjacencies over the links where both ends agree: area, subnet, hello and dead intervals (10/40 on broadcast and point-to-point, 30/120 on non-broadcast and point-to-multipoint), authentication, and the stub and NSSA flags. Then it elects a DR and BDR without pre-emption, floods link-state and runs SPF. A different IP MTU leaves the neighbours in EXSTART. Point-to-point against broadcast reaches FULL, but SPF cannot join the two descriptions of the link, so no route crosses it. Costs come from the reference bandwidth. Routes from another area show as O IA; an area that does not touch area 0 is cut off until a virtual link joins it.

Router
Under router ospf 1
router-id 1.1.1.1The router ID (otherwise the highest loopback, then the highest interface address). A change takes effect after clear ip ospf process.
network 10.0.0.0 0.0.255.255 area 0Runs OSPF on the interfaces in that range, in area 0.
passive-interface Gi0/1Advertises the network but forms no adjacency there (passive-interface default makes every interface passive).
default-information originateAdvertises this router's default route (always: even without one).
auto-cost reference-bandwidth 10000The bandwidth that costs 1, in Mb/s. Set it the same on every router.
area 1 range 10.1.0.0 255.255.0.0On an ABR: one summary for area 1's networks.
area 2 stubA stub area: no external routes, a default route instead (no-summary on the ABR: totally stubby).
area 3 nssaA not-so-stubby area: no type 5 LSAs, but its own ASBR imports routes as type 7 (O N1/O N2), which the ABR translates into type 5 (O E1/O E2) for the rest. Both ends must agree.
area 3 nssa no-summaryOn the ABR: a totally NSSA, with a default route (O*IA) instead of the inter-area routes.
area 3 nssa default-information-originateOn the ABR: sends a type 7 default route (O*N2) into the NSSA.
area 1 virtual-link 10.255.0.3Joins an area that does not touch area 0 through transit area 1 (both ABRs, each naming the other's router ID; not through a stub area or an NSSA).
area 0 authentication message-digestMD5 authentication on every interface of area 0 (without message-digest: a plain password).
neighbor 10.0.34.2On a non-broadcast network: hellos go only to the neighbours listed (one side is enough).
distribute-list prefix NO-LAB inKeeps the routes a prefix list denies out of this router's table.
Under interface Gi0/2
ip ospf 1 area 0Runs OSPF on one interface, instead of a network statement.
ip ospf cost 50The interface's cost.
ip ospf priority 0Never DR or BDR on this segment (higher wins the election).
ip ospf network point-to-pointNo DR election on this link.
ip ospf network non-broadcastHellos by unicast to the neighbor routers only; timers 30/120, with a DR (point-to-multipoint: no DR, /32 host routes).
ip ospf hello-interval 5The hello interval; the dead interval becomes 4 times it. Both ends must match.
ip ospf dead-interval 20The dead interval on its own.
ip ospf authentication message-digestMD5 on this interface (ip ospf authentication alone: a plain password; null: none, whatever the area says).
ip ospf message-digest-key 1 md5 N3tP@thThe MD5 key: the youngest key is sent, and the neighbour must hold that key number with the same string.
ip ospf authentication-key Pl41nThe plain password for ip ospf authentication.
ip ospf authentication key-chain OSPF-SHAHMAC-SHA authentication with a key chain (its key needs a cryptographic-algorithm, such as hmac-sha-256).
ip mtu 1400The interface's IP MTU. A different MTU at each end keeps OSPF in EXSTART.
ip ospf mtu-ignoreLets the adjacency form anyway, on the router with the smaller MTU.
no ip mtuBack to 1500.
In privileged EXEC
show ip ospf neighborEach neighbour, its state (FULL, 2WAY) and role (DR, BDR).
show ip ospf interface briefThe OSPF interfaces with area, cost, state and neighbours.
show ip ospfThe process: router ID, areas, SPF runs.
show ip ospf interface Gi0/2One interface: area, network type, cost, timers, authentication, DR and BDR.
show ip ospf virtual-linksEach virtual link, its transit area and state.
show ip ospf database nssa-externalThe type 7 LSAs of the NSSAs this router is in.
show ip ospf database externalThe type 5 LSAs.
show ip protocolsThe routing protocols, their networks and passive interfaces.
clear ip ospf processRestarts OSPF, for a new router ID (asks to confirm).

OSPF in a VRF: router ospf 2 vrf RED.

OSPFv3

OSPFv3 runs in both IOS styles, which interoperate: ipv6 router ospf 1 with ipv6 ospf 1 area 0 on the interfaces, and router ospfv3 1 with address-family ipv6 unicast and ospfv3 1 ipv6 area 0. Neighbours talk over link-local addresses, so next hops are FE80:: addresses, and the two ends need not share a global subnet. Area, timers and the stub flag must match. The router ID is a 32-bit number taken from an IPv4 address: a router with no IPv4 address logs %OSPFv3-4-NORTRID until you set router-id. Routes show as O (intra-area), OI (inter-area) and OE2 (a default from default-information originate). ipv6 unicast-routing is needed first.

Router
In global configuration
ipv6 unicast-routingRoutes IPv6 (needed for OSPFv3).
Under ipv6 router ospf 1
router-id 10.255.0.9The router ID, needed on a router without IPv4 addresses.
passive-interface Gi0/2Advertises the interface's prefixes without forming adjacencies there.
area 1 stubA stub area (no-summary on the ABR: totally stubby, only a default OI ::/0).
default-information originate alwaysAdvertises a default route (OE2 ::/0); without always, only while this router has one.
Under interface Gi0/2
ipv6 ospf 1 area 0Runs OSPFv3 process 1 on the interface, in area 0 (it starts the process if there is none).
ipv6 ospf cost 20The interface's OSPFv3 cost.
ipv6 ospf network point-to-pointNo DR election on this link.
ipv6 ospf priority 0Never DR or BDR.
ipv6 ospf hello-interval 5The hello interval (dead: 4 times it); both ends must match.
Under router ospfv3 2
router-id 10.255.0.8The address-family style: the router ID belongs to the process.
Under router ospfv3 2 > address-family ipv6 unicast
passive-interface Gi0/1Most settings go under the IPv6 address family.
area 2 stubA stub area, in the address family.
Under interface Gi0/1
ospfv3 2 ipv6 area 0Runs router ospfv3 2 on the interface.
ospfv3 cost 30Its cost, in the same style.
In privileged EXEC
show ipv6 ospf neighborEach neighbour: router ID, state and role, the neighbour's interface ID.
show ospfv3 neighborThe same, headed by the address family.
show ipv6 ospf interface briefThe OSPFv3 interfaces: area, interface ID, cost, state and neighbours.
show ipv6 ospf interface Gi0/2One interface: link-local address, area, router ID, network type, timers.
show ipv6 ospfThe process: router ID, ABR, areas.
show ipv6 route ospfThe OSPFv3 routes, via link-local next hops.
show ipv6 protocolsThe IPv6 routing protocols and their interfaces.

EIGRP

EIGRP forms neighbours where both ends share the AS, a subnet, the K-values and the authentication, and runs DUAL: each path keeps its reported distance (RD) and total (FD), the lowest is the successor, and a path whose RD is below the successor's FD is a feasible successor. Classic mode (router eigrp 100) and named mode (router eigrp CORP with address families) both work; named mode uses the 64-bit wide metric and can run in a VRF. Metrics come from bandwidth and delay.

Router
Under router eigrp 100
network 10.0.0.0Runs EIGRP on the interfaces in the classful network (with a wildcard, network 10.0.12.0 0.0.0.3, only those).
passive-interface Gi0/1Advertises the subnet but sends no hellos there (passive-interface default makes every interface passive).
eigrp router-id 1.1.1.1The router ID (otherwise the highest loopback, then the highest interface address).
variance 9Also installs feasible successors whose metric is below 9 × the FD, sharing traffic in proportion.
maximum-paths 6How many paths can be installed (4 by default).
eigrp stubA stub router: it advertises only connected and summary routes and never passes routes between neighbours (receive-only, connected, summary narrow it).
metric weights 0 1 0 1 0 0The K-values (these are the defaults). Neighbours with different K-values never form: the log says K-value mismatch.
no auto-summaryAccepted: automatic summarization is already off in IOS 15.
Under key chain WAN-KEYS
key 1A key in a key chain (then key-string).
Under key chain WAN-KEYS > key 1
key-string NTpath-Eigrp1The key's secret.
Under interface Gi0/2
ip authentication mode eigrp 100 md5MD5 authentication on the link (both ends must match, or the log says Auth failure).
ip authentication key-chain eigrp 100 WAN-KEYSThe key chain the link uses.
Under interface Gi0/1
ip summary-address eigrp 100 10.3.0.0 255.255.252.0Sends one summary out of this interface and installs its Null0 discard route (distance 5).
no ip split-horizon eigrp 100Lets routes go back out of the interface they came in on.
Under interface Gi0/2
delay 100The interface delay in tens of microseconds, the usual way to steer EIGRP.
bandwidth 10000The bandwidth in kbit/s for EIGRP and OSPF costs (it never changes the real speed).
Under router eigrp CORP > address-family ipv4 unicast autonomous-system 200
network 10.0.0.0Named mode: the same network statement, under the address family.
Under router eigrp CORP > address-family ipv4 unicast autonomous-system 200 > af-interface default
passive-interfaceEvery interface passive; then af-interface Gi0/0 with no passive-interface turns one back on.
Under router eigrp CORP > address-family ipv4 unicast autonomous-system 200 > af-interface Gi0/0
authentication mode hmac-sha-256 NTpath-Sha1HMAC-SHA-256 authentication with its password (named mode only; authentication mode md5 with authentication key-chain also works).
summary-address 10.30.0.0 255.255.252.0A summary out of that interface.
Under router eigrp CORP > address-family ipv4 unicast autonomous-system 200 > topology base
variance 2Named mode keeps variance, maximum-paths and distance under topology base.
In privileged EXEC
show ip eigrp neighborsNeighbours with their interface and hold time (vrf GUEST for a VRF).
show ip eigrp topologySuccessors and feasible successors with (FD/RD) per path (all-links shows every path; a prefix such as 10.3.3.0/24 shows the detail).
show ip eigrp interfaces detailEIGRP interfaces, peers, hello and hold times, split horizon and authentication.
show eigrp address-family ipv4 neighborsNamed-mode neighbours.
show ip route eigrpEIGRP routes, with each path's own metric when variance installs several.
show key chainThe key chains and their keys.

EIGRP for IPv6 runs the same DUAL, metrics and options. Neighbours meet over link-local addresses (no common subnet needed), but the process still needs a 32-bit router ID: on an IPv6-only router, set one. In named mode the IPv6 address family runs on every IPv6 interface at once.

Router
In global configuration
ipv6 router eigrp 100Classic EIGRP for IPv6 (needs ipv6 unicast-routing).
Under ipv6 router eigrp 100
eigrp router-id 1.1.1.1The router ID; without an IPv4 address the process can't start otherwise.
passive-interface Gi0/2Advertises the interface's prefixes without hellos (passive-interface default too).
shutdownStops the process (no shutdown starts it again).
Under interface Gi0/0
ipv6 eigrp 100Runs EIGRP for IPv6 on the interface (there are no network statements).
ipv6 summary-address eigrp 100 2001:db8:1::/48Advertises a summary out of the interface, with a discard route to Null0.
no ipv6 split-horizon eigrp 100Lets routes go back out of the interface they came in on.
ipv6 authentication mode eigrp 100 md5MD5 authentication, with ipv6 authentication key-chain eigrp 100 NAME.
In privileged EXEC
show ipv6 eigrp neighborsEach neighbour by its link-local address.
show ipv6 eigrp topologyThe topology table: successors, feasible distance, via link-local next hops.
show ipv6 eigrp interfacesThe interfaces running EIGRP for IPv6, and their peers.
show ipv6 route eigrpThe D routes in the IPv6 routing table.
Router
Under router eigrp V6NAMED > address-family ipv6 unicast autonomous-system 600
eigrp router-id 6.6.6.6Named mode, IPv6: the address family's router ID.
In privileged EXEC
show eigrp address-family ipv6 neighborsThe IPv6 address family's neighbours, in named mode.
Router
Under router eigrp V6NAMED > address-family ipv6 unicast autonomous-system 600 > af-interface Gi0/1
shutdownTakes this interface out of EIGRP for IPv6 (named mode includes every IPv6 interface).

BGP

Sessions are TCP connections on port 179 that follow the routing table, so iBGP works between loopbacks. A session comes from the update source (or the exit interface's address), and the other side accepts it only when that address is one of its neighbours, with the right AS on both ends and the same MD5 password; then either side may open it. An eBGP neighbour must be on a connected subnet unless ebgp-multihop or disable-connected-check, and its packets leave with TTL 1. An access list that drops TCP 179 both ways keeps the session down. show ip bgp neighbors and the log say why a session is not up (%BGP-3-NOTIFICATION for a wrong AS, %TCP-6-BADAUTH for MD5).

eBGP sets the next hop to the session's address; iBGP keeps it unless next-hop-self, and a path whose next hop is not in the routing table is not valid: no *, never best, never passed on, never installed. iBGP routes go to other iBGP peers only through a route reflector, which adds the originator ID and cluster list. Local preference stays inside the AS, MED reaches the next AS only, and communities travel only with send-community (no-export stops at the AS edge, no-advertise at the router). Best path: weight, local preference, locally originated, AS-path length, origin, MED (same neighbouring AS), eBGP over iBGP, IGP metric to the next hop, router ID, cluster-list length, neighbour address. Each neighbour's policy runs in IOS order: prefix list, distribute list, filter list, route map.

Router
Under router bgp 65000
bgp router-id 1.1.1.1The BGP router ID.
neighbor 10.0.12.2 remote-as 64501A neighbour in another AS (eBGP), or in this one (iBGP).
neighbor 10.0.12.2 description ISP1A note on the session.
neighbor 10.0.12.2 password S3cretMD5 authentication of the TCP session: both sides need the same password.
neighbor 10.0.12.2 timers 10 30Keepalive and hold time for this neighbour (the lower hold time of the two sides wins).
timers bgp 30 90The same for every neighbour.
neighbor 10.255.0.2 remote-as 65000An iBGP neighbour, at its loopback.
neighbor 10.255.0.2 update-source Loopback0Opens the session from Loopback0's address, which the neighbour must know as this router.
neighbor 10.255.0.2 next-hop-selfSends eBGP-learned routes with this router as the next hop, so iBGP peers can reach it.
neighbor 192.0.2.9 remote-as 64600An eBGP neighbour that is not on a connected subnet (its loopback).
neighbor 192.0.2.9 ebgp-multihop 2Allows it up to 2 hops away (TTL 2), and lifts the connected check.
neighbor 192.0.2.9 disable-connected-checkOnly lifts the connected check: TTL 1 still reaches a loopback one hop away.
neighbor IBGP peer-groupA peer group: settings shared by its members.
neighbor IBGP remote-as 65000The group's AS.
neighbor IBGP update-source Loopback0Every member sources the session from Loopback0.
neighbor 10.255.0.3 peer-group IBGPPuts a neighbour in the group (its own settings still win).
neighbor IBGP route-reflector-clientMakes the members route-reflector clients: their routes go to every iBGP peer, other iBGP routes go to them.
bgp cluster-id 10.255.0.2The reflector's cluster ID (the router ID by default).
network 203.0.113.0 mask 255.255.255.0Advertises a network that is in the routing table exactly (its IGP metric becomes the MED).
neighbor 10.0.12.2 weight 200Prefers routes from this neighbour on this router only.
neighbor 10.0.12.2 route-map ISP1-IN inApplies a route map to what the neighbour sends (out: to what we send).
neighbor 10.0.12.2 prefix-list NO-LAB inFilters the neighbour's prefixes with a prefix list (in or out).
neighbor 10.0.12.2 filter-list 1 outFilters by AS path with an ip as-path access-list.
neighbor 10.0.12.2 distribute-list 10 inFilters by network with an access list.
neighbor 10.0.12.2 send-communitySends the communities (both: the extended ones too); without it they are stripped.
neighbor 10.0.12.2 remove-private-asRemoves private AS numbers from what we send, when the path holds only private ones (all: every one).
neighbor 10.0.12.2 default-originateSends this neighbour a default route, whether or not the table has one.
neighbor 10.0.12.2 soft-reconfiguration inboundKeeps what the neighbour sent before inbound policy, for received-routes.
neighbor 10.0.12.2 allowas-in 1Accepts paths that hold our own AS once (two sites of one AS joined by a provider).
bgp default local-preference 150The local preference given to the paths this router learns or originates.
bgp always-compare-medCompares MED between paths from different neighbouring ASes too.
maximum-paths 2Installs up to 2 equal eBGP paths (same AS path) side by side.
maximum-paths ibgp 2The same for iBGP paths (equal IGP metric to the next hop).
neighbor 10.0.12.2 shutdownTakes the session down without removing it.
no neighbor 10.0.12.2 shutdownBrings it back.
In global configuration
ip as-path access-list 1 permit ^$An AS-path list (Cisco regular expressions; ^$ is a path we originate, _ any delimiter).
ip community-list standard LAB permit 65000:60A community list: an entry needs all its communities on the path.
ip community-list expanded CUST permit ^65000:An expanded list: a regular expression over the communities as shown.
ip bgp-community new-formatShows communities as AA:NN instead of one 32-bit number.
Under vrf definition CUST
rd 65000:9A VRF needs a route distinguisher before BGP can run in it.
address-family ipv4Its IPv4 address family.
Under router bgp 65000 > address-family ipv4 vrf CUST
neighbor 172.16.9.2 remote-as 64999A neighbour inside VRF CUST: the session uses CUST's interfaces and routes.
network 10.9.0.0 mask 255.255.255.0Advertises a network from CUST's routing table; the routes land in CUST only.
In privileged EXEC
show ip bgp summaryEach neighbour, its state and how many prefixes it sent.
show ip bgpThe BGP table: * valid, > best, i internal, r RIB failure (another protocol's route won), s suppressed, m multipath.
show ip bgp 203.0.113.0Every path to one prefix, its attributes, communities, originator and cluster list, and why the best one won.
show ip bgp neighbors 10.0.12.2One session: state, timers, update source, TTL, policies and prefix counts.
show ip bgp neighbors 10.0.12.2 advertised-routesWhat we send this neighbour, after outbound policy.
show ip bgp neighbors 10.0.12.2 routesWhat we accepted from it.
show ip bgp neighbors 10.0.12.2 received-routesWhat it sent before inbound policy (needs soft reconfiguration).
show ip bgp regexp ^64501_The paths whose AS path matches the expression.
show ip bgp community 65000:60The paths that carry every community listed.
show ip bgp vpnv4 vrf CUSTThe BGP table of one VRF, under its route distinguisher.
show ip as-path-access-listThe AS-path lists.
show ip community-listThe community lists.
clear ip bgp * softAsks for the routes again and resends ours (policy already applies at once here).
clear ip bgp 10.0.12.2Resets a session: it goes down and comes back up, as the log shows.

MP-BGP for IPv6: a neighbour is defined once (an IPv4 or an IPv6 address) and activated per address family. Every neighbour is active in IPv4 unicast by default; no bgp default ipv4-unicast turns that off for the ones defined after it. Over an IPv4 session, the next hop of IPv6 prefixes is the IPv4-mapped ::FFFF:a.b.c.d, which is never reachable: set a real one with a route map. Routes from a directly connected eBGP neighbour are installed through its link-local address.

Router
Under router bgp 65000
no bgp default ipv4-unicastNew neighbours are no longer activated in IPv4 unicast.
neighbor 2001:DB8:12::2 remote-as 65002A neighbour over IPv6.
address-family ipv6The IPv6 unicast address family.
Under router bgp 65000 > address-family ipv6
network 2001:DB8:1:1::/64Advertises an IPv6 prefix that is in the routing table.
neighbor 2001:DB8:12::2 activateExchanges IPv6 prefixes with the neighbour (route maps, next-hop-self and the rest follow per family).
Under route-map V6-NH permit 10
set ipv6 next-hop 2001:DB8:23::2A route map's IPv6 next hop, for IPv6 prefixes sent over an IPv4 session.
In privileged EXEC
show bgp ipv6 unicastThe IPv6 BGP table (show ip bgp ipv6 unicast too).
show bgp ipv6 unicast summaryThe neighbours active in IPv6 unicast and their prefixes.
show bgp ipv6 unicast neighbors 2001:DB8:12::2 advertised-routesWhat this router sends the neighbour in IPv6.
show ipv6 route bgpThe B routes in the IPv6 routing table.

Dynamic neighbours: a hub that accepts sessions from any address in a range, with a peer group's settings (DMVPN hubs use it). The other side opens the connection; show ip bgp summary marks those neighbours with *.

Router
Under router bgp 65000
neighbor SPOKES peer-groupThe peer group the dynamic neighbours belong to.
neighbor SPOKES remote-as 65000Its AS (required).
bgp listen range 10.0.0.0/24 peer-group SPOKESAccepts sessions from that range.
bgp listen limit 50The most dynamic neighbours at once (100 by default).

Route maps and prefix lists

Router
In global configuration
ip prefix-list NO-LAB seq 5 deny 10.99.0.0/16 le 24A prefix list entry (ge and le match ranges of lengths).
ip prefix-list NO-LAB seq 10 permit 0.0.0.0/0 le 32Permits everything else.
ip prefix-list DEFAULT seq 5 permit 0.0.0.0/0Matches the default route only.
Under route-map ISP1-IN permit 10
match ip address prefix-list DEFAULTThis entry applies to the routes the prefix list permits.
set local-preference 200Prefers these routes across the AS.
Under route-map ISP1-IN permit 20
set weight 100Sets the weight.
Under route-map ISP1-OUT permit 10
set as-path prepend 65000 65000Makes our routes look longer to this neighbour, so inbound traffic prefers another way.
set metric 50Sets the MED.
Under route-map ISP1-IN permit 30
match as-path 1BGP paths whose AS path the AS-path list permits.
match community LABBGP paths whose communities the community list permits (exact-match: no others).
Under route-map ISP1-OUT permit 10
set community 65000:60 no-export additiveSets communities (additive keeps the ones the path has; none removes them all).
Under route-map ISP1-IN permit 30
set comm-list LAB deleteRemoves the communities a standard community list permits.
Under route-map ISP1-OUT permit 10
set origin igpSets the BGP origin (incomplete: ?).
Under route-map RM permit 20
match ip address 10Routes whose network an access list permits (a standard ACL matches the network address).
Under route-map RM deny 5
match tag 90Routes carrying that tag (several values: any of them).
Under route-map RM permit 20
match interface Gi0/1Routes whose exit interface is Gi0/1.
match route-type external type-2OSPF E2 routes (internal, external, external type-1 too).
set tag 90Tags the route, so another router can match it.
set metric-type type-1Redistributes into OSPF as E1.
set metric 1000000 10 255 1 1500An EIGRP seed metric (one number: an OSPF metric or a BGP MED).
In privileged EXEC
show route-mapEach route map with its entries and matches.

Route maps apply to redistribution, BGP neighbours and distribute lists. The first sequence whose every match clause fits decides; with no match clause, a sequence fits every route; anything left over is denied. A match on a prefix list or access list that does not exist fits every route, but a route map that does not exist lets nothing through.

Redistribution

redistribute copies routes from the routing table into OSPF, EIGRP or BGP, with the subnets of the interfaces that run the source protocol. OSPF needs subnets (otherwise only classful networks cross) and seeds E2 metric 20; EIGRP sends nothing without a seed metric, except for connected and static routes; BGP takes eBGP routes only. Tags travel with the routes, so two redistribution points can refuse each other's routes. When two routers redistribute both ways, the first one keeps the prefix, as on a real network.

Router
Under router ospf 1
redistribute eigrp 100 subnetsEIGRP routes into OSPF as E2, metric 20 (metric-type 1, metric, tag, route-map change that).
redistribute connected subnets route-map RMConnected networks, through a route map.
default-metric 30The seed metric for every redistributed source.
summary-address 172.20.0.0 255.255.252.0On an ASBR: one external route for the redistributed networks inside it, and a discard route to Null0 (distance 254).
distribute-list route-map RM inKeeps the routes the route map denies out of this router's table (an access list number or prefix NAME works too). The LSAs still flood.
Under router eigrp 100
redistribute ospf 1 metric 1000000 10 255 1 1500OSPF routes into EIGRP as externals (D EX, distance 170): bandwidth, delay, reliability, load, MTU.
default-metric 1000000 10 255 1 1500The seed metric for every source without its own.
redistribute staticStatic routes, with their exit interface's metric.
distribute-list prefix NO-LAB out Gi0/1Filters the updates sent out of Gi0/1 (in for received ones; without an interface, all of them).
Under router bgp 65000
redistribute ospf 1 match internal externalOSPF routes into BGP (internal ones only by default), origin incomplete, with the IGP metric as MED.
bgp redistribute-internalLets iBGP routes be redistributed into an IGP.
aggregate-address 10.0.0.0 255.0.0.0 summary-onlyAdvertises the aggregate while a more specific route is in the BGP table, and suppresses the specifics (s in show ip bgp).
In privileged EXEC
show ip ospf database externalThe type 5 LSAs: metric type, metric and tag.
show ip protocolsWhat each process redistributes and its filter lists.

Policy-based routing

A route map on the interface where traffic comes in decides the next hop before the routing table. Sequences match packets with access lists (match ip address); a deny sequence, an ACL deny or no match leaves the packet to the routing table. The table itself never changes, so check PBR with traceroute and the route map's counters.

Router
Under route-map PBR permit 10
match ip address GUESTThe packets an extended access list permits (match length 0 400 matches by size).
set ip next-hop 198.51.100.1Sends them to that next hop when it is directly connected and up; otherwise they follow the table.
set ip next-hop verify-availability 198.51.100.1 1 track 20The same, only while track 20 is up.
Under route-map PBR permit 20
set ip default next-hop 198.51.100.1Used only when the table has no explicit route for the destination (a default route does not count).
Under route-map PBR permit 30
set interface Gi0/1Sends the packets out of an interface.
Under interface Gi0/2
ip policy route-map PBRPolicy-routes what enters Gi0/2.
In global configuration
ip local policy route-map PBRPolicy-routes the router's own traffic (pings, probes).
In privileged EXEC
show ip policyWhich interfaces have which route map.
show route-map PBRThe sequences with their match counters and the track state of each next hop.

VRF-lite and GRE

Router
In global configuration
vrf definition REDA VRF: a separate routing table (ip vrf RED is the older form).
Under vrf definition RED
rd 65000:1Its route distinguisher.
address-family ipv4Turns IPv4 on in the VRF.
Under interface Gi0/2
vrf forwarding REDMoves the interface into the VRF. As in IOS, this removes its address: set it again.
ip address 172.16.1.1 255.255.255.0The address, now in VRF RED.
Under router eigrp CORP > address-family ipv4 unicast vrf RED autonomous-system 300
network 172.16.1.0 0.0.0.255EIGRP inside the VRF, in named mode: its own AS, neighbours and routes (show ip eigrp vrf RED neighbors).
In privileged EXEC
show vrfEach VRF and its interfaces.
show ip route vrf REDOne VRF's routing table.
ping vrf RED 172.16.1.10A ping from inside a VRF.
Under interface Tunnel0
tunnel source Gi0/0Where the tunnel starts (an interface or an address).
tunnel destination 10.0.12.2The far end's address.
tunnel mode gre ipGRE over IPv4 (the default).
ip address 172.31.0.1 255.255.255.252The tunnel's own subnet. It is up when the destination is reachable.
In privileged EXEC
show interfaces Tunnel0The tunnel's state, source and destination.

DMVPN: multipoint GRE and NHRP

A single-hub DMVPN: one multipoint tunnel per router. Each spoke registers its tunnel and outside (NBMA) addresses with the hub, its next-hop server, so the hub learns the spokes without per-spoke configuration. Routing protocols reach the spokes through the hub's multicast mappings. Spoke-to-spoke tunnels come up on demand: in phase 2 a spoke resolves the other spoke's tunnel address (the hub keeps it as the next hop), and in phase 3 the hub redirects and the spoke installs a shortcut.

Router
Under interface Tunnel0
tunnel mode gre multipointMultipoint GRE: a source and no destination. NHRP supplies the destinations.
tunnel key 100Both ends must carry the same key, or the packets are dropped.
ip nhrp network-id 1Turns NHRP on for the tunnel (the number is local to the router).
ip nhrp authentication NTPATHA cleartext string (up to 8 characters) that every NHRP packet must carry.
ip nhrp map multicast dynamicOn the hub: copies multicasts (routing protocol hellos) to every spoke that registered.
ip nhrp nhs 10.0.0.1 nbma 203.0.113.2 multicastOn a spoke: the next-hop server's tunnel and NBMA addresses, and send it multicasts (the older form is ip nhrp map, ip nhrp map multicast and ip nhrp nhs).
ip nhrp map 10.0.0.1 203.0.113.2A static mapping of a tunnel address to an NBMA address.
ip nhrp map multicast 203.0.113.2Sends multicasts to that NBMA address.
ip nhrp holdtime 600How long the mappings this router gives out are valid (7200 seconds by default).
ip nhrp redirectOn the hub (phase 3): tells a spoke when its packet leaves on the tunnel it came in on.
ip nhrp shortcutOn a spoke (phase 3): acts on redirects, installing an NHRP route (H) or overriding the next hop (%).
no ip split-horizon eigrp 100On the hub: lets EIGRP pass one spoke's routes to the others over the same tunnel.
no ip next-hop-self eigrp 100On the hub (phase 2): keeps the originating spoke as the next hop, so spokes resolve each other.
In privileged EXEC
show dmvpnEach peer: NBMA and tunnel address, state (UP, NHRP, IKE, IPsec), attributes (S static, D dynamic, T1 route installed, T2 next-hop override).
show ip nhrpThe NHRP cache: static, registered and resolved entries, and shortcut prefixes.
show ip nhrp nhsA spoke's next-hop servers: RE when the server responds, E while it waits for replies.
clear ip nhrpRemoves resolved entries and shortcuts: the next packet goes through the hub again.
Router
Under router eigrp CORP > address-family ipv4 unicast autonomous-system 200 > af-interface Gi0/0
no next-hop-selfThe same as no ip next-hop-self eigrp, in named mode (on the hub's tunnel interface).