1-ITN-chap6bg

advertisement
Routing
Host Can Send a Packet To Itself
 The IP address 127.0.0.1 is a loopback interface that is automatically
assigned to a TCP/IP host.
 Any IP address within the network 127.0.0.0/8 refers to the local
host.
 Useful for testing purposes.
C:\Users\Admin> ping 127.0.0.1
Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\Users\Admin>
2
Host Can Send a Packet To a Local Host
 Hosts on the same network, sending host and receiving host share the
same network address.
 PC1 (192.168.10.10 /24) sends a packet to PC2 (192.168.10.11 /24)
 Since they are both on the same network (192.168.10.x /24) the
services of a default gateway are not required.
PC1
PC2
.10
192.168.10.0/24
.1
G0/0
.11
R1
PC3
PC4
G0/1
.1
.10
.11
192.168.11.0/24
3
Host Can Send a Packet To a Remote Host
 When a host on a remote network, the hosts do not share the same
network address.
 A default gateway IP address is required.
 PC1 (192.168.10.10 /24) sends a packet to PC4 (192.168.11.11 /24)
 Since they are on different networks (192.168.10.x /24 and
192.168.11.x /24) the services of a default gateway is required.
PC1
PC2
.10
192.168.10.0/24
.1
G0/0
.11
R1
PC3
PC4
G0/1
.1
.10
.11
192.168.11.0/24
4
Host Can Send a Packet To a Remote Host
 The default gateway is the device (i.e, router) that routes traffic
from the local network to remote networks.
 A host sending a packet to a remote host does not maintain
routing information beyond the local network.
 The default gateway maintains a routing table containing directly
connected and remote network route information.
PC1
PC2
.10
192.168.10.0/24
.1
G0/0
.11
R1
PC3
PC4
G0/1
.1
.10
.11
192.168.11.0/24
5
Default Gateway
6
Configuring Default Gateway on Hosts
 The default gateway address can be configured on the host
manually or learned dynamically.
7
Default Gateway – ipconfig
C:\Users\Admin>ipconfig
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS
Link-local IPv6 Address
IPv4 Address. . . . . .
Subnet Mask . . . . . .
Default Gateway . . . .
Suffix
. . . .
. . . .
. . . .
. . . .
.
.
.
.
.
:
:
:
:
:
cisco.com
fe80::b572:c6c:f983:cadc%11
192.168.11.99
255.255.255.0
192.168.11.1
C:\Users\Admin>
8
C:\Users\Admin> ipconfig /all
Windows IP Configuration
Host Name . . . . . . .
Primary Dns Suffix . .
Node Type . . . . . . .
IP Routing Enabled. . .
WINS Proxy Enabled. . .
DNS Suffix Search List.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix
Description . . . . . . . . . .
Network Connection
Physical Address. . . . . . . .
Dhcp Enabled. . . . . . . . . .
Autoconfiguration Enabled . . .
IP Address. . . . . . . . . . .
Subnet Mask . . . . . . . . . .
Default Gateway . . . . . . . .
DHCP Server . . . . . . . . . .
DNS Servers . . . . . . . . . .
.
.
.
.
.
.
:
:
:
:
:
:
Admin-wxp
cisco.com
Hybrid
No
No
cisco.com
. : cisco.com
. : Intel(R) PRO/1000 PL
.
.
.
.
.
.
.
.
:
:
:
:
:
:
:
:
00-16-41-E4-82-43
Yes
Yes
192.168.11.99
255.255.255.0
192.168.11.1
192.168.151.41
10.0.0.36
10.0.0.16
<Output omitted>
C:\Users\Admin>
9
Host Packet Forwarding Decision
 So how does a host keep track of whether or not to forward packets
to the default gateway?
 Hosts must maintain their own, local, routing table to ensure that
network layer packets are directed to the correct destination
network.
10
Host Routing Table
C:\Users\PC1> netstat -r
<Output omitted>
IPv4 Route Table
===========================================================================
Active Routes:
 The local table of the host typically contains:
 Direct connection - A route to the loopback interface
(127.0.0.1).
 Local network route - The host’s network IP address.
 Local default route - The default route which is the IP address
of the network interface of the router that is connected to the
local network.
 The route print or netstat -r command can be used to
display the host routing table on a Windows host.
 Both commands generate the same output.
 The commands displays interface information, IPv4 route in
formation and IPv6 route information
11
netstat IPv4 Information
Lists reachable networks
Lists a subnet mask used by the host to determine
the network / host portions of the IP address.
Lists the address to get to a remote network. A
directly reachable destination displays “On-link”.
Lists the address of the physical interface used to
send the packet to the gateway.
C:\Users\PC1> netstat -r
<Output omitted>
Lists the cost of each route and is used to
determine the best route to a destination.
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination
Netmask
Gateway
Interface Metric
0.0.0.0
0.0.0.0
192.168.10.1
192.168.10.10
25
127.0.0.0
255.0.0.0
On-link
127.0.0.1
306
127.0.0.1 255.255.255.255
On-link
127.0.0.1
306
127.255.255.255 255.255.255.255
On-link
127.0.0.1
306
192.168.10.0
255.255.255.0
On-link
192.168.10.10
281
192.168.10.10 255.255.255.255
On-link
192.168.10.10
281
192.168.10.255 255.255.255.255
On-link
192.168.10.10
281
224.0.0.0
240.0.0.0
On-link
127.0.0.1
306
224.0.0.0
240.0.0.0
On-link
192.168.10.10
281
255.255.255.255 255.255.255.255
On-link
127.0.0.1
306
255.255.255.255 255.255.255.255
On-link
192.168.10.10
281
===========================================================================
<Output omitted>
12
netstat IPv4 Information
0.0.0.0
• This is the local default route.
• Forwards all non-matching packets.
• All non-matching destination routes are sent to 192.168.10.1
(R1) exiting from the interface with IP address 192.168.10.10.
127.0.0.0 – 127.255.255.255
•These loopback addresses all relate to the direct connection and
provide services to the local host.
C:\Users\PC1> netstat -r
<Output omitted>
192.168.10.0 - 192.168.10.255
• These addresses all relate to the host and local network.
• 192.168.10.0 - The local network route address.
• 192.168.10.10 - The address of the local host.
• 192.168.10.255 - The network broadcast address.
224.0.0.0
• Special multicast addresses reserved for use through either
IPv4 Route Table
the loopback interface or the host IP address.
===========================================================================
Active Routes:
Network Destination
Netmask
Gateway
Interface Metric
0.0.0.0
0.0.0.0
192.168.10.1
192.168.10.10
25
127.0.0.0
255.0.0.0
On-link
127.0.0.1
306
127.0.0.1 255.255.255.255
On-link
127.0.0.1
306
127.255.255.255 255.255.255.255
On-link
127.0.0.1
306
192.168.10.0
255.255.255.0
On-link
192.168.10.10
281
192.168.10.10 255.255.255.255
On-link
192.168.10.10
281
192.168.10.255 255.255.255.255
On-link
192.168.10.10
281
224.0.0.0
240.0.0.0
On-link
127.0.0.1
306
224.0.0.0
240.0.0.0
On-link
192.168.10.10
281
255.255.255.255 255.255.255.255
On-link
127.0.0.1
306
255.255.255.255 255.255.255.255
On-link
192.168.10.10
281
===========================================================================
<Output omitted>
255.255.255.255
• Limited broadcast IP address values for use through either the
loopback interface or the host IP address.
13
PC1 wants to ping PC2.
Which route will be chosen?
C:\Users\PC1> netstat -r
<Output omitted>
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination
Netmask
Gateway
Interface Metric
0.0.0.0
0.0.0.0
192.168.10.1
192.168.10.10
25
127.0.0.0
255.0.0.0
On-link
127.0.0.1
306
127.0.0.1 255.255.255.255
On-link
127.0.0.1
306
127.255.255.255 255.255.255.255
On-link
127.0.0.1
306
192.168.10.0
255.255.255.0
On-link
192.168.10.10
281
192.168.10.10 255.255.255.255
On-link
192.168.10.10
281
192.168.10.255 255.255.255.255
On-link
192.168.10.10
281
224.0.0.0
240.0.0.0
On-link
127.0.0.1
306
224.0.0.0
240.0.0.0
On-link
192.168.10.10
281
255.255.255.255 255.255.255.255
On-link
127.0.0.1
306
255.255.255.255 255.255.255.255
On-link
192.168.10.10
281
===========================================================================
<Output omitted>
14
PC1 wants to ping 10.10.10.10.
Which route will be chosen?
C:\Users\PC1> netstat -r
<Output omitted>
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination
Netmask
Gateway
Interface Metric
0.0.0.0
0.0.0.0
192.168.10.1
192.168.10.10
25
127.0.0.0
255.0.0.0
On-link
127.0.0.1
306
127.0.0.1 255.255.255.255
On-link
127.0.0.1
306
127.255.255.255 255.255.255.255
On-link
127.0.0.1
306
192.168.10.0
255.255.255.0
On-link
192.168.10.10
281
192.168.10.10 255.255.255.255
On-link
192.168.10.10
281
192.168.10.255 255.255.255.255
On-link
192.168.10.10
281
224.0.0.0
240.0.0.0
On-link
127.0.0.1
306
224.0.0.0
240.0.0.0
On-link
192.168.10.10
281
255.255.255.255 255.255.255.255
On-link
127.0.0.1
306
255.255.255.255 255.255.255.255
On-link
192.168.10.10
281
===========================================================================
<Output omitted>
15
netstat IPv6 Information
C:\Users\PC1> netstat -r
<Output omitted>
IPv6 Route Table
=====================================================
Active Routes:
If Metric Network Destination
Gateway
16
58 ::/0
On-link
1
306 ::1/128
On-link
16
58 2001::/32
On-link
16
306 2001:0:9d38:953c:2c30:3071:e718:a926/128
On-link
15
281 fe80::/64
On-link
16
306 fe80::/64
On-link
16
306 fe80::2c30:3071:e718:a926/128
On-link
15
281 fe80::b1ee:c4ae:a117:271f/128
On-link
1
306 ff00::/8
On-link
16
306 ff00::/8
On-link
15
281 ff00::/8
On-link
=====================================================
<Output omitted>
Lists the address of the physical
interface used to send the packet to
the gateway.
Lists the cost of each route and is
used to determine the best route to a
destination.
Lists reachable networks
Lists the address to get to a remote
network. A directly reachable
destination displays “On-link”.
16
netstat IPv6 Information
::/0
• This is the IPv6 equivalent of the local
default route.
C:\Users\PC1> netstat -r
<Output omitted>
IPv6 Route Table
=====================================================
Active Routes:
If Metric Network Destination
Gateway
16
58 ::/0
On-link
1
306 ::1/128
On-link
16
58 2001::/32
On-link
16
306 2001:0:9d38:953c:2c30:3071:e718:a926/128
On-link
15
281 fe80::/64
On-link
16
306 fe80::/64
On-link
16
306 fe80::2c30:3071:e718:a926/128
On-link
15
281 fe80::b1ee:c4ae:a117:271f/128
On-link
1
306 ff00::/8
On-link
16
306 ff00::/8
On-link
15
281 ff00::/8
On-link
=====================================================
<Output omitted>
::1/128
• This is equivalent to the IPv4 loopback
address and provides services to the local
host.
2001:: Global Unicast Addresses
•2001::/32 - This is the global unicast network
prefix.
••2001:0:9d38:953c:2c30:3071:e718:a926/128
- This is the global unicast IPv6 address of the
local computer.
fe80:: Link Local Addresses
• fe80::/64 - This is the local link network
route address and represents all computers
on the local link IPv6 network.
• fe80::2c30:3071:e718:a926/128 - This is the
link local IPv6 address of the local
computer.
ff00::/8 Multicast Addresses
• These are special reserved multicast class
D addresses equivalent to the IPv4
224.x.x.x addresses.
17
Default Gateway on a Switch
PC1
PC2
.10
192.168.11.0/24
192.168.10.0/24
.11
.1
G0/0
S1
.5
S1# show running-config
Building configuration...
!
<output omitted>
service password-encryption
!
hostname S1
!
Interface Vlan1
ip address 192.168.10.5
!
ip default-gateway 192.168.10.1
<output omitted>
R1
.1
G0/1
S2
 A switch must (should) also be configured with a default gateway
address, because packets that originate from the switch are
handled just like packets that originate from a host device.
 This is not used by normal user frames!
 Use the ip default-gateway global config command.
18
Default Gateway on a Switch
 For example, the administrator wants to Telnet to the S1.
 Without the default gateway configured on S1, packets from S1
would not be able to reach the administrator at 192.168.11.10.
S1# show running-config
Building configuration...
!
<output omitted>
service password-encryption
!
hostname S1
!
Interface Vlan1
ip address 192.168.10.5
!
ip default-gateway 192.168.10.1
<output omitted>
PC1
PC2
.10
192.168.11.0/24
192.168.10.0/24
.11
.1
G0/0
S1
.5
R1
.1
G0/1
S2
19
Router Routing Tables
Routers
 A router is the main infrastructure device that makes forwarding
decisions on any network.
 It’s goal is to forward a packet to its correct destination!
 To do so, a router keeps track of local and remote networks.
 This information is stored in a routing table.
21
Routing IP Packets
22
Routing IP Packets
23
Routing IP Packets
24
Router Operational Goal
 Once a router receives a frame …
 De-capsulates the data link header.
 Examines the IP address to determine the destination network.
 Consults its routing tables to determine which of its interfaces it
will use to send the frame.
 It encapsulates the frame and forwards it.
25
Routing IP Packets
26
Routing IP Packets
27
Routing IP Packets
28
Routing IP Packets
29
Routing Table Routes
30
Routing Table
Routes
 The routing table of a router stores information about:
 Directly-connected routes:
 These routes come from the active router interfaces. Routers
 Add a directly connected route when an interface is
configured with an IP address and is activated.
 Remote routes:
 These routes come from remote networks connected to other
routers.
 Routes to these networks can either be manually configured
or dynamically learned using a dynamic routing protocol.
31
Routers and the Network Layer
32
IPv4 Router Routing Table
192.168.10.0/24
.10
PC1
.1
G0/1
.10
PC2
10.1.1.0/24
G0/0
.1
.10
209.165.200.224 /30
R1
192.168.11.0/24
.225
S0/0/0
.1
.226
R2
.1
.10
10.1.2.0/24
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
D
D
C
L
C
L
C
L
R1#
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
10.1.2.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
192.168.10.0/24 is variably subnetted, 2 subnets, 3 masks
192.168.10.0/24 is directly connected, GigabitEthernet0/0
192.168.10.1/32 is directly connected, GigabitEthernet0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 3 masks
192.168.11.0/24 is directly connected, GigabitEthernet0/1
192.168.11.1/32 is directly connected, GigabitEthernet0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 3 masks
209.165.200.224/30 is directly connected, Serial0/0/0
209.165.200.225/32 is directly connected, Serial0/0/0
33
Directly Connected Interfaces
192.168.10.0/24
PC1
PC2
.10
G0/0
.1
.1
G0/1
.10
209.165.200.224 /30
R1
.225
S0/0/0
192.168.11.0/24
 Two routing table entries are automatically created when an active
router interface is configured with an IP address and subnet mask.
 C:
 Identifies a directly connected network.
 Directly connected networks are automatically created when
an interface is configured with an IP address and activated.
 L:
 Identifies that this is a local route, the IP address of the
interface.
 Local routes are automatically created when an interface is
configured with an IP address and activated.
34
Directly Connected Routing Table Entries
192.168.10.0/24
.10
PC1
.1
G0/1
.10
PC2
64.100.0.1
G0/0
.1
.10
209.165.200.224 /30
R1
.225
S0/0/0
.1
.226
R2
.1
C
L
.10
10.1.2.0/24
192.168.11.0/24
A
10.1.1.0/24
B
C
192.168.10.0/24 is directly connected, GigabitEthernet0/0
192.168.10.1/32 is directly connected, GigabitEthernet0/0
A
Identifies how the network was learned by the router.
B
Identifies the destination network and how it is connected.
C
Identifies the interface on the router connected to the destination network.
35
Remote Network Routing Table Entries
192.168.10.0/24
.10
PC1
.1
G0/1
.10
PC2
64.100.0.1
G0/0
.1
.10
209.165.200.224 /30
R1
.225
S0/0/0
.1
.226
R2
.1
192.168.11.0/24
D
10.1.1.0/24
.10
10.1.2.0/24
10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
A
Identifies how the network was learned by the router.
B
Identifies the destination network.
C
Identifies the administrative distance (trustworthiness) of the route source.
D
Identifies the metric to reach the remote network.
E
Identifies the next hop IP address to reach the remote network.
F
Identifies the amount of elapsed time since the network was discovered.
G
Identifies the outgoing interface on the router to reach the destination network.
36
Destination Network
192.168.10.0/24
.10
PC1
.1
G0/1
.10
PC2
10.1.1.0/24
G0/0
.1
.10
209.165.200.224 /30
R1
192.168.11.0/24
.225
S0/0/0
.1
.226
R2
.1
.10
10.1.2.0/24
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
D
D
C
L
C
L
C
L
R1#
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
10.1.2.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
192.168.10.0/24 is variably subnetted, 2 subnets, 3 masks
192.168.10.0/24 is directly connected, GigabitEthernet0/0
192.168.10.1/32 is directly connected, GigabitEthernet0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 3 masks
192.168.11.0/24 is directly connected, GigabitEthernet0/1
192.168.11.1/32 is directly connected, GigabitEthernet0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 3 masks
209.165.200.224/30 is directly connected, Serial0/0/0
209.165.200.225/32 is directly connected, Serial0/0/0
37
Next-Hop Address
192.168.10.0/24
.10
PC1
.1
G0/1
.10
PC2
10.1.1.0/24
G0/0
.1
.10
209.165.200.224 /30
R1
192.168.11.0/24
.225
S0/0/0
.1
.226
R2
.1
.10
10.1.2.0/24
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
D
D
C
L
C
L
C
L
R1#
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
10.1.2.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
192.168.10.0/24 is variably subnetted, 2 subnets, 3 masks
192.168.10.0/24 is directly connected, GigabitEthernet0/0
192.168.10.1/32 is directly connected, GigabitEthernet0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 3 masks
192.168.11.0/24 is directly connected, GigabitEthernet0/1
192.168.11.1/32 is directly connected, GigabitEthernet0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 3 masks
209.165.200.224/30 is directly connected, Serial0/0/0
209.165.200.225/32 is directly connected, Serial0/0/0
38
PC1 wants to ping another
host on the same network
Which Route?
192.168.10.0/24
.10
PC1
.1
G0/1
.10
PC2
64.100.0.1
G0/0
.1
.10
209.165.200.224 /30
R1
192.168.11.0/24
.225
S0/0/0
10.1.1.0/24
.1
.226
R2
.1
.10
10.1.2.0/24
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
D
D
C
L
C
L
C
L
R1#
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
10.1.2.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
192.168.10.0/24 is variably subnetted, 2 subnets, 3 masks
192.168.10.0/24 is directly connected, GigabitEthernet0/0
192.168.10.1/32 is directly connected, GigabitEthernet0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 3 masks
192.168.11.0/24 is directly connected, GigabitEthernet0/1
192.168.11.1/32 is directly connected, GigabitEthernet0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 3 masks
209.165.200.224/30 is directly connected, Serial0/0/0
209.165.200.225/32 is directly connected, Serial0/0/0
39
PC1 wants to ping PC2
Which Route?
192.168.10.0/24
.10
PC1
.1
G0/1
.10
PC2
64.100.0.1
G0/0
.1
.10
209.165.200.224 /30
R1
192.168.11.0/24
.225
S0/0/0
10.1.1.0/24
.1
.226
R2
.1
.10
10.1.2.0/24
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
D
D
C
L
C
L
C
L
R1#
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
10.1.2.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
192.168.10.0/24 is variably subnetted, 2 subnets, 3 masks
192.168.10.0/24 is directly connected, GigabitEthernet0/0
192.168.10.1/32 is directly connected, GigabitEthernet0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 3 masks
192.168.11.0/24 is directly connected, GigabitEthernet0/1
192.168.11.1/32 is directly connected, GigabitEthernet0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 3 masks
209.165.200.224/30 is directly connected, Serial0/0/0
209.165.200.225/32 is directly connected, Serial0/0/0
40
PC1 wants to ping the R2
WAN Interface
Which Route?
192.168.10.0/24
.10
PC1
.1
G0/1
.10
PC2
64.100.0.1
G0/0
.1
.10
209.165.200.224 /30
R1
192.168.11.0/24
.225
S0/0/0
10.1.1.0/24
.1
.226
R2
.1
.10
10.1.2.0/24
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
D
D
C
L
C
L
C
L
R1#
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
10.1.2.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
192.168.10.0/24 is variably subnetted, 2 subnets, 3 masks
192.168.10.0/24 is directly connected, GigabitEthernet0/0
192.168.10.1/32 is directly connected, GigabitEthernet0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 3 masks
192.168.11.0/24 is directly connected, GigabitEthernet0/1
192.168.11.1/32 is directly connected, GigabitEthernet0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 3 masks
209.165.200.224/30 is directly connected, Serial0/0/0
209.165.200.225/32 is directly connected, Serial0/0/0
41
PC1 wants to ping
10.1.1.10
Which Route?
192.168.10.0/24
.10
PC1
.1
G0/1
.10
PC2
64.100.0.1
G0/0
.1
.10
209.165.200.224 /30
R1
192.168.11.0/24
.225
S0/0/0
10.1.1.0/24
.1
.226
R2
.1
.10
10.1.2.0/24
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
D
D
C
L
C
L
C
L
R1#
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
10.1.2.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
192.168.10.0/24 is variably subnetted, 2 subnets, 3 masks
192.168.10.0/24 is directly connected, GigabitEthernet0/0
192.168.10.1/32 is directly connected, GigabitEthernet0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 3 masks
192.168.11.0/24 is directly connected, GigabitEthernet0/1
192.168.11.1/32 is directly connected, GigabitEthernet0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 3 masks
209.165.200.224/30 is directly connected, Serial0/0/0
209.165.200.225/32 is directly connected, Serial0/0/0
42
Routers
Cisco Routers
Types of Routers
Branch Routers
•
•
Designed for teleworkers, small business, and
medium-size branch sites.
Includes Cisco 800, 1900, 2900, and 3900
Integrated Series Routers (ISR) G2.
Cisco 2901
WAN Routers
•
•
7200 Series Router
Service Provider Routers
•
•
CRS-1 Multishelf System
•
Large businesses, organizations, and
enterprises.
Includes the Cisco Aggregation Service
Router (ASR) 1000, 7200 Series Router, and
the Cisco Catalyst 6500 Series Switches.
Large service providers.
Includes Cisco CRS-3 Carrier Routing
System, Cisco ASR 9000, Cisco ASR 1000,
Cisco XR 12000, and 7600 Series routers
CRS-3 support s bandwidths of up to 322
Tb/s.
44
How Fast is 322 Tb/s?
45
Router Components
 Regardless of their function, size or complexity, all router models are
essentially computers and require:
 Operating systems (OS)
 Central processing units (CPU)
 Random-access memory (RAM)
 Read-only memory (ROM)
 Routers also have special memory that includes Flash and
nonvolatile random-access memory (NVRAM).
46
Router Memory
Volatile /
Non-Volatile
Memory
Volatile
•
•
•
•
Running IOS
Running configuration file
IP routing and ARP tables
Packet buffer
Non-Volatile
•
•
•
Bootup instructions
Basic diagnostic software
Limited IOS
Non-Volatile
•
Startup configuration file
Non-Volatile
•
•
IOS
Other system files
RAM
(Random Access
Memory)
ROM
(Read-Only
Memory)
NVRAM
(Non-Volatile RAM
Flash
)
Stores
47
Router Front
System Power LED
System Activity LED
Solid green indicates the
presence of power.
Blinks when packets are transmitted or
received on any WAN or LAN interface.
48
Router Backplane
4-port EtherSwitch HWIC
2 port Smart Serial HWIC
High-speed WAN Interface Card
Compact Flash Module
Integrated ports
Stores Cisco IOS
Console, Auxiliary, and FastEthernet
49
Router Backplane
Double-wide eHWIC slots
eHWIC 0
AUX
port
LAN
interfaces
 The backplane of a router includes:
Console
RJ45
Two 4 GB flash card slots
Console
USB Type B
USB
Ports
50
Connecting to a Router
Double-wide eHWIC slots
eHWIC 0
AUX
port
LAN
interfaces
 Cisco router ports can be grouped into two categories:
 Management ports – Includes console and auxiliary ports used
to configure, manage, and troubleshoot the router.
 Inband Router interfaces – Includes LAN and WAN interfaces
configured with IP addressing to carry user traffic.
Console
RJ45
Console
USB Type B
51
Console and Ethernet Connections
52
Console Port
53
Auxiliary Ports
54
Router Interfaces
 A router interface is a physical connector that enables a router to
send or receive packets
 Each interface connects to a separate network
 Consist of socket or jack found on the outside of a router
 Types of router interfaces:
 Ethernet
 FastEthernet
 Gigabit Ethernet
 Serial
 DSL
 Cable
 ISDN
55
LAN and WAN Interfaces
 Router interfaces can be grouped into two categories:
 Ethernet LAN interfaces: Requires an IP address and enabled.
 Serial WAN interfaces – Requires an IP address and enabled.
Serial interfaces
LAN interfaces
56
Router Bootup
Cisco IOS
 The IOS file itself is several megabytes in size and similar to Cisco
IOS switches, is stored in flash memory.
 IOS stored in Flash can be upgraded to newer versions or to
have new features added.
 During bootup, the IOS is copied from slower flash memory into
faster RAM (DRAM).
58
Bootset Files
 During bootup, the router loads two files into RAM:
 IOS: Copied from flash into RAM.
 Startup configuration: Copied from NVRAM into RAM.
59
Router Bootup Process
1. Both POST and the
Bootstrap program are
located in ROM.
1. Load IOS from Flash.
2. None in Flash, then
load from TFTP server.
1. Load from NVRAM.
2. None in NVRAM, then
load from TFTP server.
3. No Server/file, then
enter Setup mode from
the console.
 Note:
 Setup mode is not used in this course to configure the router.
 When prompted to enter setup mode, always answer no.
 If you answer yes and enter setup mode, press Ctrl+C at any time to
terminate the setup process.
60
Show Versions Output
Version of the Cisco IOS software in RAM and that is
being used by the router.
Router# show version
Cisco IOS Software, C1900 Software (C1900-UNIVERSALK9-M), Version 15.2(4)M1, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2012 by Cisco Systems, Inc.
Compiled Thu 26-Jul-12 19:34 by prod_rel_team
ROM: System Bootstrap, Version 15.0(1r)M15, RELEASE SOFTWARE (fc1)
Router uptime is 10 hours, 9 minutes
System returned to ROM by power-on
System image file is "flash0:c1900-universalk9-mz.SPA.152-4.M1.bin"
Last reload type: Normal Reload
Last reload reason: power-on
<Output omitted>
Cisco CISCO1941/K9 (revision 1.0) with 446464K/77824K bytes of memory.
Processor board ID FTX1636848Z
2 Gigabit Ethernet interfaces
2 Serial(sync/async) interfaces
1 terminal line
DRAM configuration is 64 bits wide with parity disabled.
255K bytes of non-volatile configuration memory.
250880K bytes of ATA System CompactFlash 0 (Read/Write)
Displays the system bootstrap software version stored in
ROM that was initially used to boot up the router.
Displays the complete filename of the IOS image and
where the it was loaded from.
Identifies the type of router and the amount of DRAM.
Some routers, like the Cisco 1941 ISR, use a fraction of
DRAM as packet memory for buffering packets. Add both
numbers to determine the total amount of DRAM.
Displays the physical interfaces on the router. In this
example, the Cisco 1941 ISR has two Gigabit Ethernet
interfaces and two low-speed serial interfaces.
Displays the amount of NVRAM and Flash.
<Output omitted>
Technology Package License Information for Module:'c1900'
----------------------------------------------------------------Technology
Technology-package
Technology-package
Current
Type
Next reboot
-----------------------------------------------------------------ipbase
ipbasek9
Permanent
ipbasek9
security
None
None
None
data
None
None
None
Configuration register is 0x2142 (will be 0x2102 at next reload)
Router#
Displays the licensing information of the router. The IOS
can be upgraded to support additional features.
Displays the software configuration register in
hexadecimal. A second value in parentheses denotes
the value that is used during the next reload.
For example, 0x2102 indicates that the router attempts to
load a Cisco IOS software image from flash memory and
load the startup configuration file from NVRAM
61
Configuring a Cisco Router
Configure Initial Router Settings
 Cisco routers and switches use the same CLI.
 They support similar command structures, and commands.
 The following steps should be completed on a router:
 Assign a device name using the hostname global config command.
 Secure privileged EXEC mode access using the enable secret command.
 Secure EXEC mode access using the login command on the console port,
and the password command to set the password.
 Secure virtual access similar to securing EXEC access mode, except on the
Virtual Teletype (VTY) port.
 Use the service password-encryption global configuration command to
prevent passwords from displaying as plain text in the configuration file.
 Provide legal notification using the banner motd (message of the day
[MOTD]) global configuration command.
 Save the configuration using the copy run start command.
 Verify the configuration using the show run command.
63
Router Configuration Steps
192.168.10.0/24
PC1
PC2
.10
10.1.1.0/24
G0/0
.1
.1
G0/1
.10
.10
209.165.200.224 /30
R1
.225
S0/0/0
192.168.11.0/24
Router> enable
Router# configure terminal
Enter configuration commands, one per line.
End with CNTL/Z.
Router(config)# hostname R1
R1(config)#
R1(config)# enable secret class
R1(config)#
R1(config)# line console 0
R1(config-line)# password cisco
R1(config-line)# login
R1(config-line)# exit
R1(config)#
R1(config)# line vty 0 4
R1(config-line)# password cisco
R1(config-line)# login
R1(config-line)# exit
R1(config)#
R1(config)# service password-encryption
R1(config)#
.1
.226
R2
.1
.10
10.1.2.0/24
R1(config)# banner motd #
Enter TEXT message. End with the character '#'.
***********************************************
WARNING: Unauthorized access is prohibited!
***********************************************
#
R1(config)# exit
R1#
R1# copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
R1#
64
Router Interfaces
 Router interfaces must be configured.
 Cisco routers support a wide range of interfaces however, in our lab
the routers support.
 FastEthernet 0/0 (Fa0/0)
 FastEthernet 0/1 (Fa0/1)
 Serial 0/0/0 (S0/0/0)
 Serial 0/0/1 (S0/0/1)
65
Configuring Router Interfaces
 To enable a router interface, configure the following:




Enter interface config mode: interface type-and-number
Add description (optional): description descriptive-text
IPv4 address and subnet mask: ip address address subnet-mask
Activate the interface: no shutdown
66
Configure LAN Interfaces
192.168.10.0/24
PC1
PC2
.10
10.1.1.0/24
G0/0
.1
.1
G0/1
.10
192.168.11.0/24
.10
209.165.200.224 /30
R1
.225
S0/0/0
.1
.226
R2
.1
.10
10.1.2.0/24
R1# conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#
R1(config)# interface gigabitethernet 0/0
(Note : Our routers use FastEthernet 0/0)
R1(config-if)# description Link to LAN-10
R1(config-if)# ip address 192.168.10.1 255.255.255.0
R1(config-if)# no shutdown
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to
up
%LINEPROTO-5-UPDOWN: Line protocol on Interface
GigabitEthernet0/0, changed state to up
R1(config-if)# exit
67
R1(config)#
Configure LAN Interfaces
192.168.10.0/24
PC1
PC2
.10
10.1.1.0/24
G0/0
.1
.1
G0/1
.10
192.168.11.0/24
.10
209.165.200.224 /30
R1
.225
S0/0/0
.1
.226
R2
.1
.10
10.1.2.0/24
R1(config)# int g0/1
(Note : Our routers use FastEthernet 0/1)
R1(config-if)# description Link to LAN-11
R1(config-if)# ip add 192.168.11.1 255.255.255.0
R1(config-if)# no shut
%LINK-5-CHANGED: Interface GigabitEthernet0/1,
changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface
GigabitEthernet0/1, changed state to up
R1(config-if)# exit
R1(config)#
68
Configure WAN Interface
192.168.10.0/24
PC1
PC2
.10
10.1.1.0/24
G0/0
.1
.1
G0/1
.10
192.168.11.0/24
.10
209.165.200.224 /30
R1
.225
S0/0/0
.1
.226
R2
.1
.10
10.1.2.0/24
R1(config)# interface s0/0/0
R1(config-if)# description Link to R2
R1(config-if)# ip add 209.165.200.225 255.255.255.252
R1(config-if)# clock rate 128000
R1(config-if)# no shutdown
LINK-5-CHANGED: Interface Serial0/0/0, changed state
to up
R1(config-if)# exit
R1(config)#
69
Verify Basic Config
192.168.10.0/24
PC1
PC2
.10
10.1.1.0/24
G0/0
.1
.1
G0/1
.10
.10
209.165.200.224 /30
R1
.225
S0/0/0
.1
.226
R2
.1
.10
10.1.2.0/24
192.168.11.0/24
R1# show ip interface brief
Interface
IP-Address
OK? Method Status
GigabitEthernet0/0
GigabitEthernet0/1
Serial0/0/0
Serial0/0/1
YES
YES
YES
YES
192.168.10.1
192.168.11.1
209.165.200.225
unassigned
Protocol
manual up
up
manual up
up
manual up
up
NVRAM administratively
down down
R1# ping 209.165.200.226
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 209.165.200.226, timeout is 2
seconds:
!!!!!
R1#
70
Verify the Routing Table
192.168.10.0/24
PC1
PC2
.10
10.1.1.0/24
G0/0
.1
.1
G0/1
.10
.10
209.165.200.224 /30
R1
.225
S0/0/0
192.168.11.0/24
.1
.226
R2
.1
.10
10.1.2.0/24
R1# show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
<Output omitted>
Gateway of last resort is not set
C
L
C
L
C
L
R1#
192.168.10.0/24 is variably subnetted, 2 subnets, 3 masks
192.168.10.0/24 is directly connected, GigabitEthernet0/0
192.168.10.1/32 is directly connected, GigabitEthernet0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 3 masks
192.168.11.0/24 is directly connected, GigabitEthernet0/1
192.168.11.1/32 is directly connected, GigabitEthernet0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 3 masks
209.165.200.224/30 is directly connected, Serial0/0/0
209.165.200.225/32 is directly connected, Serial0/0/0
71
Remember …
 As a packet travels from one networking device to another
 The Source and Destination IP addresses NEVER change
 The Source & Destination MAC addresses CHANGE as
packet is forwarded from one router to the next.
 TTL field decrement by one until a value of zero is reached at
which point router discards packet (prevents packets from
endlessly traversing the network)
72
A Day in the Life of a Packet
73
A Day in the Life of a Packet
74
A Day in the Life of a Packet
75
A Day in the Life of a Packet
76
A Day in the Life of a Packet
77
A Day in the Life of a Packet
78
A Day in the Life of a Packet
79
A Day in the Life of a Packet
80
A Day in the Life of a Packet
81
A Day in the Life of a Packet
82
A Day in the Life of a Packet
83
A Day in the Life of a Packet
84
A Day in the Life of a Packet
85
A Day in the Life of a Packet
86
A Day in the Life of a Packet
87
A Day in the Life of a Packet
88
Download