Professional Documents
Culture Documents
1
IP Routing
oProcess of forwarding packets
between networks
oBasic components needed to route:
• Routable Packet (IPv4, IPv6, etc)
• Network address
• Subnet mask
• Next Hop
• Metric
2
What is the “best”?
11
Types of Routes
o Connected
o Static
o Dynamic
12
Routing Components
13
Administrative Distance Values
14
o Autonomous System
• Collection of networks all under one
administrative authority
o IGP
• Interior Gateway Protocol
• Designed to provide prefix reachability
information within an Autonomous System
o EGP
• Exterior Gateway Protocol
• Designed to provide prefix reachability information
between different Autonomous Systems
15
Protocol Characteristics (1)
16
Protocol Characteristics (2)
17
Protocol Characteristics - Routing Updates
o Full update
• All of the routing table is sent in the update
o Periodic update
• Sent in the specified time interval
o Triggered update
• Sent whenever change is detected
Distance Vector
o Neighbor requirements
• No neighborships required
o Route Maintenance (is this route still believable after some
prolonged time?)
• Resend routes after defined interval
o Protocol Examples:
• RIP (v1 and v2), IGRP (deprecated)
19
Link State
o Neighbor requirements
• Neighborships required
o Route Maintenance (is this route still believable after some prolonged
time?)
• Periodic Hello’s between neighbors
• Regenerate LSAs after defined interval
o Visibility into network topology
• Complete visibility of entire topology for directly-connected areas
o Necessity of different data structures (tables, databases, etc)
• Database of learned LSAs (Link State Database)
• Neighbor Table
• Routing Table
o Protocol Examples:
• OSPF, ISIS
20
Advanced Distance Vector / Hybrid
o Neighbor requirements
• Neighborships required (Link State characteristic)
o Route Maintenance (is this route still believable after some prolonged
time?)
• Periodic Hello’s between neighbors (Link State characteristic)
o Necessity of different data structures (tables, databases, etc)
• Topology Table of learned routes (Link State characteristic)
• Neighbor Table (Link State characteristic)
• Routing Table
o Protocol Examples:
• EIGRP
21
Path Vector
o Neighbor requirements
• Neighborships required
o Route Maintenance (is this route still believable after some prolonged
time?)
• Periodic Hello’s between neighbors
o Necessity of different data structures (tables, databases, etc)
• Not necessary to know at CCNA level
o Protocol Examples:
• BGP
22
Routing Metric
oUsed for best path selection process
oIGPs use metric for shortest path calculation
oLower value is preferred
oDepends on the routing protocol architecture
• EIGRP metric = composite formula utilizing link
bandwidth + delay
• RIP metric = hop count
• OSPF metric = link bandwidth
23
Static Routing
24
Implementing Static Routing
oConfiguration (next-hop)
• Router(config)#ip route <destination-
network> <destination subnet mask>
<next-hop>
oConfiguration (outgoing interface)
• Router(config)#ip route <destination-network>
<destination subnet mask> <outgoing interface>
25
Verification
oVerification commands
• Router# show ip route
• Router# show ip route static
• Router# show running-config | include ip route
• Router# show ip protocol
• Router# show ip route <prefix> <mask>
26
Default Routing | Gateway of last resort
o Gateway of last resort is the default route configured
on the router
o Default routes are used to direct packets addressed to
networks not explicitly listed in the routing table
Configuration
27
Verification
28
Floating Static Route
o Configuration
• Router(config)#ip route <destination-network>
<destination subnet mask> <next-hop> <AD value>
29
Verification
o Router# show ip route
o Router# show running-config | include ip route
o Router# show ip route <prefix> <mask>
Troubleshooting commands
o Router# debug ip packet
30
Inter-VLAN Routing
31
Inter-VLAN Routing Configuration
o Trunk interface configuration that is
connected to the router
• Switch(config-if)# switchport mode trunk
32
Inter-VLAN Routing Configuration (SVIs)
33
Configuration Example
34
o Verification commands
• Switch# show mac address-table
35
Dynamic Routing
RIP
Features RIPv1 RIPv2
Routing Update Address Broadcast (255.255.255.255) Multicast (224.0.0.9)
Routing Information Protocol
VLSM Does Not Support Support
36
Dynamic Routing
RIPv2
37
Overview | RIP
o RIP = Routing Information Protocol
o IGP / Distance Vector
o Metric = Hop Count
o Capable of load-balancing up to 6 equal-cost
paths
o Routing Updates repeated every 30-seconds
• RIPv2 utilizes Multicast Destination Address
• IPv4 = 224.0.0.9
• IPv6 = FF02::9
38
RIP Network Topology Visibility
39
RIP Metrics
40
RIP Timers
o Update: How often the router sends update. Default update
timer is 30 seconds
o Invalid: The number of seconds since we received the last valid
update, once this timer expires the route goes into holddown,
the default is 180 seconds.
o Holddown: The number of seconds that we wait before we
accept any new updates for the route that is in holddown, the
default is 180 seconds
o Flush: how many seconds since we received the last valid
update until we throw the route away, the default is 240
seconds
41
Configuration Steps
42
Configuration Examples
43
oVerification commands
44
Dynamic Routing
EIGRP
45
Introduction to EIGRP
oCisco Proprietary (Recently they have made
Open standard)
oFast Convergence
oScalable
oLoad Balancing over unequal cost link
oClassless (VLSM Support)
oCommunicates via multicast 224.0.0.10
oSupports MD5 authentication
46
EIGRP Components
oNeighbor Discovery
oRTP Reliable Transport Protocol
oDUAL Diffusing Update Algorithm
oProtocol-Dependent Modules
EIGRP Packet Types
o Most packets sent to 224.0.0.10
o Hello packets (for Neighbor relationships, Builds the Neighbor table)
o Routing Updates
• Update
• Acknowledgments (always unicast)
• Query
• Reply
48
EIGRP Timers
49
EIGRP Data Structures
50
EIGRP Metric Calculation
o By Default: K1 = 1, K2 = 0, K3 = 1, K4 = 0, K5 = 0
o Delay is sum of all the delays of the link along the paths
o Bandwidth is the lowest bandwidth of the link along the path
51
DUAL Terminology
oSuccessor
• Best route to reach to the
destination
oFeasible successor
• Next best Alternate path to reach to
the destination
52
oFeasible distance
• Total distance
between local router
and destination prefix
oAdvertised distance
• Distance from
neighbor to reach to
the destination
53
Feasibility Condition
• FD of Current successor route > RD of feasible successor
54
EIGRP Unequal Cost Load Balancing
oEIGRP Variance
• Allows unequal cost load-balancing
Router(config)# router eigrp 1
Router(config-rtr)#variance X
The “X” above is simply a multiplier
Multiply FD of all routes in topology table by “X
55
Implementing EIGRP
oConfiguration commands
• Router(config)# router eigrp <AS-number>
• Router(config-router)# no auto-summary
• Router(config-router)# network <network-id>
• Router(config-router)# end
56
oVerification
• Router# show ip eigrp neighbor
• Router# show ip eigrp topology
• Router# show ip route eigrp
oTroubleshooting commands
• Router# debug ip eigrp
• Router# debug eigrp packet
• Router# debug ip routing
• Router# show ip eigrp traffic
57
EIGRPv6
o Similarities to IPv4 EIGRP
• Most packets transmitted via multicast
• Same metric formula
• Utilizes same message types (hello, update, ack, etc)
o IPv6 Uniqueness
• Packets sent to FF02::A
• Peers with Link-Local address of neighbors
• Next-Hop address is Link-Local of peer
58
o Enabling EIGRPv6
• Router(config)# ipv6 unicast routing
• Router(config)# ipv6 router eigrp <number>
• Router(config)# no shutdown
• Router(config)# router-id x.x.x.x
• Router(config-router)# exit
o Applying EIGRPv6
• Router(config-if)# ipv6 eigrp <number>
59
o Verifying EIGRPv6
• Router# show ipv6 eigrp neighbor
• Router# show ipv6 eigrp topology
• Router# show ipv6 route eigrp
• Router# show ipv6 protocols
60
Dynamic Routing
OSPF
61
OSPF Introduction
o Open standard
o SPF (shortest path first) algorithm
o Also known as Dijikstra algorithm
o Hello used for neighbor relationship
o Most packets sent to multicast address of
224.0.0.5 or 224.0.0.6
o Works based on area hierarchy, minimizes LSA
flooding
o Supports null, clear-text and MD5
authentication
62
OSPF LSAs
63
OSPF Area
64
OSPF Area [Hierarchical Design]
65
OSPF Packet Types
o Hello
o Database Descriptor
o Link State Request
o Link State Update
o Link State Acknowledgment
66
OSPF Neighborship
o Hello packet contains some important
information, which should match for a proper
neighborship
• Hello and dead interval
• Authentication
• Area – ID
• Prefix-length
• Stub area flag
67
Building Neighbor Relationships
oExchange of Hello
Packets
oExchange of Database
Descriptors
oExchange of Link State
Requests and Updates
oFully Loaded
68
OSPF DR & BDR Election
o OSPF elects a DR (designated router) and a BDR (backup designated router)
in broadcast and non-broadcast multi-access networks
o DR is responsible for sending an update to the neighbors that are received
from other neighbors
o Special multicast address used for sending routing updates to DR/BDR:
224.0.0.6
o OSPF router with the highest priority becomes the DR
o OSPF router with lower priority than DR becomes BDR
o A BDR takes DR’s if DR fails
o Other OSPF routers are known as DROTHERS
o If OSPF priority has not been configured, highest router-id is referenced
o OSPF router with highest router-id becomes DR
o OSPF router with lower router-id than DR’s becomes the BDR
69
Router-Identifier
o OSPF elects a router-id when the process comes
up
o Router-id is elected on the basis of the given
hierarchy
• Router-id command under the OSPF instance
• Highest IP address of a loopback interface
• Highest IP address of a physically up/up
interface
70
OSPF Network Types
o OSPF classifies links (network type) based on Layer-2
encapsulation
o Network Type determines things such as:
• Can neighbors be discovered dynamically?
• How many neighbors are expected to be on the network?
• Is there a need for DR/BDR election?
o Type can be manually changed on some interfaces
Network Types
o Broadcast
o Point-to-Point
o Non Broadcast Multi-access
o Point-to-Multipoint
71
OSPF Router Roles
o Internal Router
o Backbone Router
o Area Border Router (ABR)
o Autonomous System
Boundary Router (ASBR)
72
OSPF Tables
o Neighbor table
• Contains neighbor information
o Link-State Database
• Contains database information
o Routing table
• Contains best route on the basis of link cost
73
OSPF Configuration
o Initial OSPF Configuration commands
• Router(config)# router ospf <process-id>
• Router(config-router)# network <network-id>
<WC mask> area < area-id>
• Router(config-router)# router-id <router-id>
o Configuring OSPF Interface priority
• Router(config-interface)# ip ospf priority <priority>
74
o Verification commands
• Router# show ip ospf neighbor
• Router# show ip ospf interface
• Router# show ip ospf database
• Router# show ip route ospf
75
o Troubleshooting OSPF
• Router# debug ip ospf
adjacency
• Router# debug ip packets
• Area-id, prefix mask, and
authentication should match each
other
76
Implementing IPv6
77
IPv6 Static Routes
o Purpose is the same as IPv4 Static Routes
o Must supply destination prefix, mask and next-hop
78
IPv6 Verification commands
79
IPv6 EIGRP
o Similarities to IPv4 EIGRP
• Most packets transmitted via multicast
• Same metric formula
• Utilizes same message types (hello,
update, ack, etc)
o IPv6 Uniqueness
• Packets sent to FF02::A
• Peers with Link-Local address of neighbors
• Next-Hop address is Link-Local of peer
80
Enabling EIGRPv6
o Router(config)# ipv6 unicast routing
o Router(config)# ipv6 router eigrp <number>
o Router(config)# no shutdown
o Router(config)# eigrp router-id x.x.x.x
o Router(config-router)# exit
Applying EIGRPv6
o Router(config-if)# ipv6 eigrp <number>
EIGRPv6 Verification commands
82
OSPFv3
83
Similarities to IPv4 OSPF (OSPF v2)
o Same OSPF message types (Hello, LS-Update, etc)
o Uses same SPF algorithm, LSDB, and Metric
o Requires a Router-ID (32-bit)
o Same process for neighbor discovery and establishment
84
Enabling OSPFv3
o Router(config)# ipv6 unicast routing
o Router(config)# ipv6 router ospf <number>
o Router(config-router)# router-id <address>
o Router(config-router)# exit
Applying OSPFv3
o Router(config-if)# ipv6 ospf <number>
area <area-id>
85
OSPFv3 Verification commands
o Router# show ipv6 ospf neighbor
o Router# show ipv6 ospf database
o Router# show ipv6 route ospf
o Router# show ipv6 protocols
86
87
BGP AS
88
BGP Characteristics
• Distance-vector protocol with enhancements:
– Reliable updates
– Triggered updates only
– Rich metrics (called path attributes)
• Designed to scale to huge internetworks
Reliable Updates
• Uses TCP as transport protocol
• No periodic updates
• Periodic keepalives to verify TCP connectivity
• Triggered updates are batched and rate-limited (every 5
seconds for internal peer, every 30 seconds for external peer)
IGP - EGP
91
BGP Features
92
93
BGP Open Message
The BGP Open message contains:
– BGP Version number
– My Autonomous System number
– Hold Time
– BGP Router Identifier
– Optional Parameters
BGP Path Attributes
• BGP metrics are called path attributes
• BGP attributes are categorized as well-known and optional
• Well-known attributes must be recognized by all compliant
implementations
• Optional attributes are only recognized by some
implementations (could be private), expected not to be
recognized by everyone
Well-known BGP Attributes
• Well-known attributes are divided into mandatory and discretionary
• Well-known mandatory attributes must be present in all update
messages
• Well-known discretionary attributes may or may not be present in
the update messages
• All well-known attributes are propagated to other neighbors
Optional BGP Attributes
• Optional BGP attributes are transitive or non-transitive
• Optional transitive attributes
– Propagated to other neighbors if not recognized, Partial bit set to indicate that
the attribute was not recognized
• Optional non-transitive attributes
– Discarded if not recognized
Well-known Mandatory Attributes
• Origin
– Specifies the origin of a BGP route
IGP Route originated in an IGP
EGP Route originated in EGP
Unknown Route was redistributed into BGP
• AS_Path
– Sequence of AS numbers through which the network is accessible
• Next_Hop
– IP address of the next-hop router
Well-known Discretionary Attributes
• Local preference
– Used for consistent routing policy within AS
• Atomic aggregate
– Informs the neighbor AS that the originating router aggregated routes
Optional Attributes
• Non-transitive attributes
– Multi_Exit_Disc
• Used to discriminate between multiple entry points to a single autonomous
system
• Transitive attributes
– Aggregator
• Specifies IP address and AS number of the router that performed route
aggregation
– Communities
• Used for route tagging
BGP Path Attribute Summary
Well-known mandatory attributes
– Recognized by everone, always present
– AS-Path, Next-Hop, Origin
Well-known discretionary
– Recognized by everone, optional
– Local Preference, Atomic Aggregate
Optional transitive
– Might not be recognized, propagated if not
– BGP Community, Aggregator
Optional non-transitive
– Might not be recognized, dropped if not
– Multi-exit-discriminator
102
BGP Route Selection Criteria
• Exclude routes with inaccessible next-hop
• Prefer highest weight (local to router)
• Prefer highest local-preference (global within AS)
• Prefer routes that the router originated
• Prefer shorter AS paths (only length is compared)
• Prefer lowest origin code (IGP < EGP < Unknown)
• Prefer lowest MED
• Prefer external (EBGP) paths over internal (IBGP)
• For IBGP paths, prefer path through closest IGP neighbor
• For EBGP paths, prefer oldest (most stable) path
• Prefer paths from router with the lower BGP router ID
104
105
106
107
108
109
110
Destination NAT
• ip nat inside source:
– Translates the source IP address of packets that forwards from inside to outside. Translates the
destination IP address of packets that Forwards from outside to inside.
• ip nat outside source:
– Translates the source IP address of packets that forward s from outside to inside. Translates the
destination IP address of packets that travel from inside to outside
NAT Port Forwarding or Port Mapping
• NAT port forwarding is typically used to allow remote hosts to
connect to a host or server on our private LAN. A host on the
outside (for example on the Internet) will connect to the
outside IP address of a router that is configured for NAT.
• Port forwarding is used to forward traffic directed to a specific
network port from one network node to another. This
technique allows an external user to reach a port on a
private IPv4 address (within a LAN) from outside through a
router with NAT enabled.
NAT Port Forwarding or Port Mapping
• ip nat inside source static tcp 192.168.1.254 80
200.200.200.225 8080
Int fa0/0
Ip nat outside
Int fa0/1
ip nat inside
Policy Based Routing
• Policy based routing (PBR routing) offers the possibility to forward
traffic based on defined criteria without verifying the IP routing table.
The constructed policy is applied to interface. Every packet coming on
this interface is verified against the policy and only traffic conforming
(matching) the rule is subject to policy route. The entire local origin
kind of traffic and everything that policy doesn’t match is still routed
according to routing table based on normal destination rules.
• Policy based routing can route traffic based on not only destination
address but also source address.
PBR Configuration
• R1#configure terminal
R1(config)# ip access-list extended FROM_LAN
R1(config-ext-nacl)# permit ip 192.168.1.0 0.0.0.255 host
192.168.155.1
• R1(config)# route-map PBR-IP permit 10
R1(config-route-map)# match ip address FROM_LAN
R1(config-route-map)# set ip next-hop 10.1.1.2
• R1(config)# interface FastEthernet0/0.13
R1(config-subif)# ip policy route-map PBR-IP
PBR Verification
• R1# show ip policy
Interface Route map
Fa0/0.13 PBR-IP
• R1# show ip interface fastEthernet 0/0.13 | i Policy
Policy routing is enabled, using route map PBR-IP
Input features: Policy Routing
• R1# show route-map PBR-IP
route-map PBR-IP, permit, sequence 10
Match clauses:
ip address (access-lists): FROM_LAN
Set clauses:
ip next-hop 10.1.1.2
Policy routing matches: 12 packets, 552 bytes