Routing Protocols - jibingl/CCNA-CCNP GitHub Wiki
Router(config)#ip route <dest-address> <dest-mask> {<next-hop-IP | exit-interface>} [distance-metric<1-255>]
By chaning the AD of a static route, make it less preferred than routes learned by a dynamic routing protocol to the same destination (make sure the AD is higher than the dynamic routing protocol's AD)
Example:
R1(config)#ip route 10.0.0.0 255.0.0.0 10.0.13.2 100
R1(config)#show ip route
...
Gateway of last resort is not set
...
S 10.0.0.0/8 [100/0] via 10.0.13.2
...
D 10.0.24.0/30 [90/3072] via 10.0.12.2, 00:06:35, GigabitEthernet0/0
Class | Names | Algorithm | Metric | Admin-Distance | Advertising-IP | Protocol-NO | ADs-Timer | Balance-path | Route-table |
---|---|---|---|---|---|---|---|---|---|
IGP | RIP | Distance-vector | Hops(Max15) | 120 | 255.255.255.255(v1); 224.0.0.9(v2) | 30s | 1-32(4) | Only neighbors' | |
IGP | EIGRP | Distance-vector | Bandwith&delay | 5-S; 90-I; 170-E | 224.0.0.10 | 0x58(88) | 1-32(4) | Only neighbors' | |
IGP | OSPF | Link-state(LSR) | Cost(100M/BW) | 110 | 224.0.0.5(Hello); 224.0.0.6(DR) | 0x59(89) | Hello-10s,Dead-40s | 1-32(4) | Whole network |
IGP | IS-IS | Link-state(LSR) | Cost | 115 | 0x7C(124) | ||||
EGP | BGP | Path-vector | 20-e; 200-i |
Important: For RIP, EIGRP, and OSPF, network
cmd doen't tell the router which networks to advertise, instead of which interfaces to activate routing-protocol on, and then the router will advertise the network prefix of those interfaces.
172.16.1.0/28 192.168.2.0/24
.14|g2/0 10.0.12.0/30 |
R1(+) ------------------------- (+)R2
| |
| 10.0.13.0/30 |
| |
| 10.0.24.0/30 |
| |
R3(+) ------------------------- (+)R4
| 10.0.34.0/30 |
192.168.3.0/25 192.168.4.0/24
RIPv1 dosn't support classless/CIDR IP, it means that 10.1.1.0/24 will be become 10.0.0.0
One router = One hop
Routing ads Messages: request and response.
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no aoto-summary //Default enabled
R1(config-router)#network 10.0.0.0 //'network' cmd is classful, 10.0.0.0 assumed to 10.0.0.0/8
R1(config-router)#network 172.16.0.0 //Activate RIP on the interfaces fall into the range of network
R1(config-router)#passive-interface g2/0 //Stop sending RIP ads out of the specified interface (g2/0)
R1(config-router)#defualt-information originate //Ad default gateway out to other RIP adjacent routers
EIGRP is a Hybrid distance-vector routing protocol.
Metric calculates bandwith(K1) and delay(K3) by default.
R1(config)#router eigrp 1 //AS (Autonomous System) number must match between routers
R1(config-router)#no aoto-summary
R1(config-router)#passive-interface g2/0 //Stop sending EIGRP ads out of the specified interface (G2/0)
R1(config-router)#network 10.0.0.0 //'network' cmd can be classful, or
R1(config-router)#network 172.16.1.0 0.0.0.15 //classless
R1(config-router)#eigrp router-id 1.1.1.1 //Router-id priority: manual --> loopbak --> physical_interface_ip
R1(config-router)#defualt-information originate //Ad default gateway out to other RIP adjacent routers
Refer to OSPF.md for detailed knowledge.