Saturday, May 11, 2024

Cisco 115 - OSPF Part 3

R5#show ospf interface g0/0
^ Displays info about OSPF on interface g0/0

R2(config)#int g0/0
R2(config-if)#ip ospf priority 255
^ Sets the priority of OSPF on an interface to "rig" future elections.  Recall that the DR/BDR election is 'non-preemptive'.

DR = Designated Router
BDR = Backup Designated Router

R5#clear ip ospf process
^ Don't do this in a production network.
Forces an election.  When the DR goes down, the current BDR will become the DR.  Then, an election will occur and this rigged router will become the BDR.  I guess the next election will cause this router to become the DR.

R5#show ip ospf neighbor
^ Displays info about OSPF neighbors and their state

 R3#show ip ospf interface brief
^ Displays interfaces and OSPF info for each

R3#show ip ospf interface g0/0
^ Displays detailed OSPF info on interface g0/0

Serial interfaces:
- DR and BDR are not elected because there are only 2 neighbors on the interface
- One side functions as DCE (Data Communications Equipment)
- The other side functions as DTE (Data Terminal Equipment)
- DCE needs to specify clock rate (speed) of connection

R1(config-if)#clock rate 64000
^ Sets the clock rate (bps) of the DCE router
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shut

Ethernet interfaces use the speed command.
Serial interfaces use the clock rate command.

Default encapsulation on serial interface is HDLC

R1(config)#int s2/0
R1(config-if)#encapsulation ppp
^ Sets encapsulation to PPP instead of the default HDLC
Encapsulation type must match on both ends.

R1#show controllers s2/0
^ This will reveal which side is the DCE vs the DTE

R1(config-if)#ip ospf network <type>
^ This command manually configures the OSPF network type with the following <type> options:
broadcast (Ethernet and FDDI)
non-broadcast (Frame Relay and X.25)
point-to-point (Serial)
point-to-multipoint

You might configure an Ethernet link between two routers since there is no need for a DR/BDR.  This might be a time to config a point-to-point network.

R2(config-router)#router-id 1.2.3.4
^ Configures the router-id of a router

The hello-interval and dead-interval values must match between OSPF neighbors:

R2(config-if)#ip ospf hello-interval <seconds>
^ Sets the number of seconds between hello announcements
Default is 10 seconds

R2(config-if)#ip ospf dead-interval <seconds>
^ Sets how long before the neighbor is considered dead
Default is 40 seconds

R2(config-if)#ip ospf authentication-key banana
^ Sets the authentication password to banana but does not yet enable authentication
R2(config-if)#ip ospf authentication
^ Enables authentication on the interface

R2(config-if)#ip mtu <number>
^ Sets the maximum size of an IP packet that can be sent ot of the interface. Defaults to 1500 bytes.
Must match on both neighbors or will have problems.

OSPF LSA types:
Type 1 - Router LSA - Identifies itself by stating its router ID and lists networks attached to the router's OSPF attached interfaces.
Type 2 - Network LSA - Generated by the DR of each 'multi-access' (broadcast) network. Lists the routers which are attached to the multi-access network.
Type 5 - AS-External LSA - Generated by ASBRs (Autonomous System Boundary Routers) to describe routes to destinations outside of the AS (Autonomous System) (OSPF domain)

R1#show ip ospf database
^ Displays LSDB (OSPF database) including neighbors, each router (type 1 LSA), network (type 2) LSA, and external link states (type 5)



 

 OSPF Neighbor process:



 

 

 

[These are my notes from Jeremy's excellent CCNA course which can be viewed here.]

 

 


Friday, May 10, 2024

Cisco 114 - OSPF Part 2

R3#show ip ospf interface f2/0
^ Displays OSPF info about interface f2/0. Includes cost info.

R3(config-router)#auto-cost reference-bandwidth <mbps>
^ Sets the reference bandwidth for better cost calculations.
The default reference bandwidth is 100 mbps which is the speed of Fast Ethernet.
On all your routers, set the reference-bandwidth to higher than your highest link.  This allows for later growth.

R1(config)#int g0/0
R1(config-if)#ip ospf cost 10000
^ Manually sets the ospf cost of an interface to 10000

Not recommended:
Another way to change the OSPF cost of an interface is with the bandwidth command.  Recall the formula to calculate OSPF cost is:
reference bandwidth / interface bandwidth

R1(config-if)#bandwidth <kbps>
^The interface speed does not actually change, but costs calculated with OSPF metrics use the bandwidth number.

R3#show ip ospf interface brief
^ Displays OSPF costs for each interface

R1#show ospf neighbor
^ Displays info about ospf neighbors

R1(config)#int g0/0
R1(config-if)#ip ospf 1 area 0
R1(config-if)#int g1/0
R1(config-if)#ip ospf 1 area 0
^ These commands specifically go into two interfaces and activates OSPF on them

R1(config-router)#passive-interface default
^ Configure ALL interfaces as OSPF passive interfaces

R1(config-router)#no passive-interface <int-id>
^ Turns off passive interface for specified interface

show ip protocols
^ Displays OSPF info




[These are my notes from Jeremy's excellent CCNA course which can be viewed here.]

Friday, May 3, 2024

Cisco 113 - OSPF Part 1

(config)#router ospf 1
^ Enters OSPF configuration mode.
The "1" is the process ID.
A router can run multiple OSPF processes at once.
Process ID is unrelated to area.

(config-router)#network 10.0.12.0 0.0.0.3 area 0
(config-router)#network 10.0.13.0 0.0.0.3 area 0
(config-router)#network 172.16.1.0 0.0.0.15 area 0
^ These three commands activate OSPF on all interfaces that match the given parameters.  They are configured as area 0.
The commands tell the router to find all interfaces that match the ranges specified.
Recall the network command uses wildcard matching.  So 0.0.0.15 = 255.255.255.240
Also recall that these commands don't specify which networks to advertise.
The commands activate OSPF on interfaces that fall in the range of the given wildcard matching patterns.

(config-router)#passive-interface g2/0
^ Tells the interface to stop sending OSPF 'hello' messages out that interface - probably because there are no further routers for that interface to neighbor with.
Use this command on any interface that doesn't have any OSPF neighbors.

(config)#ip route 0.0.0.0 0.0.0.0 203.0.113.2
^ Adds a default route and points to the next hop as the ISP's IP address
(This becomes our gateway of last resort)

(config-router)#default-information originate
^ This advertises the default route into OSPF so the other routers learn about it

R1#show ip protocols
^ Displays information about the routing protocol being used.
For us, that's OSPF

(config-router)#router-id 1.1.1.1
^ Manually configure the router ID as 1.1.1.1
The router will continue to use the old ID until we reload the router or use the command:
clear ip ospf process
^ Dangerous command because it clears out the routing map for a while until things are rebuilt.  This means downtime.

(config-router)#maximum-paths <#>
^ Change the maximum number of redundant paths that can be added to the routing table from 4 to #

(config-router)#distance <#>
^ Set the administrative distance

R4(config)#int l0
^ That's "L" 0 <-- Loopback0 (not the number 10)
This command creates a loopback interface
R4(config-if)#ip address 1.1.1.1 255.255.255.255
^ Assigns IP address 1.1.1.1/24 to interface Loopback0

R4>show ip int | begin Loop
^ Displays IP addresses assigned to interfaces beginning with the first match of "Loop" (Loopback0)

R4>show ip int brief
Shows a summary of interfaces and their IP assigned IP addresses

R4>show int l0
^ Again, that's loopback0, not the number 10
^ Command shows details of interface Loopback0

R1#show ip ospf neighbor
^ Shows OSPF neighbors

R1#show ip ospf database
^ Shows LSDB (link-state database)

R1#show ip ospf interface
^ Displays details about OSPF settings on each interface




[These are my notes from Jeremy's excellent CCNA course which can be viewed here.]

Tuesday, April 23, 2024

Cisco 112 - Trick for searching output: BEGIN

I miss piping output to 'less'

Ex)

show running-config | less

^ Does not work

My co-worker gave me this tip:

show running-config | begin ASDF

Shows the output from the running-config but starts ("begins") it at search string ASDF

Looks like it might accept regular expressions, too.  So:

show running-config | begin Gi2\/0\/3

Would begin output at Gi2/0/3



Friday, April 19, 2024

Cisco 111 - Dynamic Routes and Floating Static Routes

Administrative Distance costs

Administrative Distance <-- Route protocol/type
0 <-- Directly connected
1 <-- Static
20 <-- External BGP (eBGP)
90 <--  EIGRP
100 <-- IGRP
110 <-- OSPF
115 <-- IS-IS
120 <-- RIP
170 <-- EIGRP (external)
200 <-- Internal BGP (iBGP)
255 <-- Unusable route

Floating Static Routes

This is useful to configure a backup route that should not be used unless the normal path goes down.

Display existing routes
#show ip route

(config)#ip route <network> <subnet> <ip of alternate next hop> <metric higher than usual path>
(config)#ip route 10.0.2.0 255.255.255.0 203.0.113.1 111

#show ip route
You won't see the new route because its administrative cost is higher than the better path

Here's a way:
#show running-config | incl route

[These are my notes from Jeremy's excellent CCNA course which can be viewed here.]

Tuesday, April 16, 2024

Cisco 110 - EtherChannel

Conceptually, EtherChannel combines (aggregates) multiple linked ports into a single aggregate connection.

Displays current load balancing method:
#show etherchannel load-balance

Change load balancing method to load balance based on source and destination IP address:
#conf t
(config)#port-channel load-balance <mode>
(config)#port-channel load-balance src-dst-mac
(conifg)#show etherchannel load-balance


Modes:
dst-ip    Destination IP address
dst-mac    Destination MAC address
src-dst-ip    Source & destination IP address
src-dst-mac    Source & destination MAC address
src-ip    Source IP address
src-mac    Source MAC address

Methods to create an EtherChannel:
1) Static = Manual config
    Don't do this because you want the switch to automatically remove a link when it goes down
2) Dynamic = Automatic
    A) PAgP (Port Aggregation Protocol) = Cisco proprietary
    B) LACP (Link Aggregation Control Protocol) = IEEE standard and preferred

(config)#interface range g0/0 - 3
(config-if-range)#channel-group 1 mode desirable
modes:
active = Enable LACP unconditionally
passive = Enable LACP only if a LACP device is detected
auto = Enable PAgP only if a PAgP device is detected
desirable = Enable PAgP unconditionally
on = Enable etherchannel only

For PAgP:
auto + auto = No EtherChannel
desirable + auto = EtherChannel
desirable + desirable = EtherChannel

For LACP:
passive + passive = No EtherChannel
active + passive = EtherChannel
active + active = EtherChannel

To config the aggregate etherchannel as a VLAN trunk, do this on both switches:
(config)#interface port-channel 1
(config-if)#switchport trunk encapsulation dot1q
(config-if)#switchport mode trunk
(config-if)#do show interfaces trunk

Displays port aggregates, protocol, and which ports are being used in each
#show etherchannel summary

Displays more details including the channel group mode
#show etherchannel port-channel

Layer 3 EtherChannel
(config)#int range g0/0 - 3
(conifg-if-range)#no switchport
(conifg-if-range)#channel group 1 mode active
(config-if-range)#int po1
(config-if)#ip address 10.0.0.1 255.255.255.252


[These are my notes from Jeremy's excellent CCNA course which can be viewed here.]

Saturday, April 13, 2024

Cisco 109 - Rapid Spanning Tree Protocol

SW3(config)#spanning-tree mode?
mst    - Multiple Spanning Tree mode
pvst    - Per-Vlan Spanning Tree mode (classic mode)
rapid-pvst    - Rapid Per Vlan Spannint Tree mode (new & improved)

This is the default and we probably won't need to execute this:
SW3(config)#spanning-tree mode rapid-pvst

This command will tell a port it is connected to a PC or end host, not a switch or a hub.  Because there is no risk of creating a loop, they can move straight to the forwarding state without the negotiation process.  The port is the "edge" of the network, so they are called "edge ports".  They function like a classic STP port with PortFast enabled, thus:
SW1(config-if)#spanning-tree portfast

This command tells the port it is connected to a switch:
SW4(config-if)#spanning-tree link-type point-to-point

Costs:

Speed - STP Cost - RSTP Cost

10 Mbps - 100 - 2,000,000
100 Mbps - 19 - 200,000
1 Gbps - 4 - 20,000
10 Gbps - 2 - 2,000
100 Gbps - X - 200
1 Tbps - X - 20



[These are my notes from Jeremy's excellent CCNA course which can be viewed here.]