You are on page 1of 74

21

Data Communication
(Networks Design & Configuration -2)

IP Connectivity & Routing

1
Cisco Certified Network Associate (CCNA 200-301)

Lesson 7 : IP Connectivity & Routing

Outlines
 Lesson 7 : IP Connectivity : Introduction
 Lesson 8 : Static Route
 Lesson 9 : Inter-VLAN Routing
 Lesson 10 : OSPF Basic Configuration
 Lesson 11 : OSPF Packets and Neighbor Discovery

2
Lesson 7 : IP Connectivity : Introduction

• difference between switches and routers

• Cisco IOS Router Basic Configuration

• Accessing the Router CLI

• Router Interface IP Addresses


4

Lesson 7 : IP Connectivity : Introduction

 difference between switches and routers


• In this lesson, we will take a look at the difference between switches and routers and I’ll explain
to you the basics of routing.
• We have seen switches and you have learned that they “switch” based on MAC address
information. The only concern for our switch is to know when an Ethernet frame enters one of its
interfaces where it should send this Ethernet frame by looking at the destination MAC address.
Switches make decisions based on Data Link layer information (layer 2).
• Routers have a similar task but this time we are going to look at IP packets and as you might
recall IP is on the Network layer (layer 3). Routers look at the destination IP address in an IP
packet and send it out the correct interface.

4
5

Lesson 7 : IP Connectivity : Introduction

difference between switches and routers


• Maybe you are thinking…what is the big difference here? Why don’t we use MAC addresses everywhere and
switch? Why do we need to look at IP addresses and route?

• We have two switches and to each switch are 200 computers connected. Now if all 400 computers want to
communicate with each switch has to learn 400 MAC addresses. The need to know the MAC addresses of
the computers on the left and right side.

5
6

Lesson 7 : IP Connectivity : Introduction

difference between switches and routers


• Now think about a really large network…for example the Internet. There are millions of devices! Would it be
possible to have millions of entries in your MAC-address table? For each device on the Internet? No way! The
problem with switching is that it’s not scalable; we don’t have any hierarchy just flat 48-bit MAC addresses.

• Let’s look at the same example but now we are using routers.
6
7

Lesson 7 : IP Connectivity : Introduction

 difference between switches and routers


• Let’s look at the same example but now we are using routers.

• What we have here is our 200 computers on the left are connected to R1 and in the 192.168.1.0 /24
network. R2 has 200 computers behind it and the network we use over there is 192.168.2.0 /24. Routers
“route” based on IP information, in our example R1 only has to know that network 192.168.2.0 /24 is
behind R2. R2 only needs to know that the 192.168.1.0 /24 network is behind R1. Are you following me
here? 7
8

Lesson 7 : IP Connectivity : Introduction

difference between switches and


• Let’s look at the same example but now we are using routers.
routers

• Instead of having a MAC-address-table with 400 MAC addresses we now only need a single entry on each
router for each other’s networks. Switches use mac address tables to forward Ethernet frames and
routers use a routing table to learn where to forward IP packets to. As soon as you take a brand new
router out of the box It will build a routing table but the only information you’ll find are the directly
connected interfaces. Let’s start with a simple example:
8
9

Lesson 7 : IP Connectivity : Introduction


difference between switches and routers

 Above we have one router and two computers:


 H1 has IP address 192.168.1.1 and has configured IP address 192.168.1.254 as its default gateway.
 H2 has IP address 192.168.2.2 and has configured IP address 192.168.2.254 as its default gateway.
 On our router we have configured IP address 192.168.1.254 on interface FastEthernet 0/0 and IP address
192.168.2.254 on interface FastEthernet 1/0.
 Since we also configured a subnet mask with the IP addresses our router knows the network addresses
9
and will store these in its routing table.
10

Lesson 7 : IP Connectivity : Introduction


 Cisco IOS Router Basic Configuration
• In this lesson, you will learn how to create a basic configuration for a Cisco IOS router. If you are completely
new to the Cisco CLI, you might want to look at our Introduction to Cisco IOS CLI lesson first.

 Cisco Integrated Services Routers

• Most networking vendors, including Cisco have different router models. Cisco offers routers for small branch
offices with only a few users, up to very large routers that are used in data centers.
• If you are new to networking, you will probably start with some of the smaller routers. Cisco has
the integrated services routers which are routers but these devices also offer some other services like
wireless or Voice over IP.

10
11

Lesson 7 : IP Connectivity : Introduction


 Cisco IOS Router Basic Configuration
 Cisco Integrated Services Routers

• Figure 15-3 shows a photo of the Cisco 4321 ISR, with some
of the more important features highlighted. The top part of
the figure shows a full view of the back of the router. This
model comes with two built-in Gigabit Ethernet interfaces
and two modular slots (WIC slots) that allow you to add
small cards called Network Interface Modules (NIMs). The
bottom of the figure shows one example NIM (a NIM that
provides two serial interfaces). The router has other items as
well, including both an RJ-45 that supports UTP cabling only
and USB console port.

11
12

Lesson 7: IP Connectivity : Introduction


 Cisco IOS Router Basic Configuration
 Accessing the Router CLI
• Accessing a router’s command-line interface (CLI) works much like a switch In fact, it works so much like
accessing a Cisco switch CLI that this book relies on Chapter 4
• Cisco switches and routers share many of the same CLI navigation features and many of the same configuration
commands for management features. The following list mentions the highlights:

 User and Enable (privileged) mode


 Entering and exiting configuration mode, using the configure terminal, end, and exit
commands and the Ctrl+Z key sequence
 Configuration of console, Telnet (vty), and enable secret passwords
 Configuration of Secure Shell (SSH) encryption keys and username/password login
credentials
 Configuration of the hostname and interface description

12
13

Lesson 7 : IP Connectivity : Introduction


 Cisco IOS Router Basic Configuration
 Accessing the Router CLI

• Let’s see if we can configure a 2800 router. First we will connect


our blue Cisco console cable to our router and start Putty so that
we can connect to the router:

• Make sure you select “Serial line” and set the speed at 9600. The
COM port might be different for you, especially if you are using a
USB to Serial adapter. Make sure to check this number in the
Windows device manager.

13
14

Lesson7: IP Connectivity : Introduction


 Cisco IOS Router Basic Configuration
 Accessing the Router CLI = First Boot
• Once you are connected to the console port and switch on the power, you will see something like this:
System Bootstrap, Version 12.4(13r)T, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 2006 by cisco Systems, Inc.

Initializing memory for ECC


...
c2811 platform with 786432 Kbytes of main memory
Main memory is configured to 64 bit mode with ECC enabled

Readonly ROMMON initialized


program load complete, entry point: 0x8000f000, size: 0xcb80
program load complete, entry point: 0x8000f000, size: 0xcb80

program load complete, entry point: 0x8000f000, size: 0x40c7678


14
15

Lesson 7: IP Connectivity : Introduction


 Cisco IOS Router Basic Configuration
 Accessing the Router CLI = First Boot
• When the router starts, it first initializes ROMMON. This is a bit similar to the BIOS of a computer. It allows
the router to perform some basic functions like loading the IOS operating system, which occurs next:

Self decompressing the image :


########################################################################################
########################################################################################
########################################################################################
########################################################################################
############################################################# [OK]

15
16

Lesson 7 : IP Connectivity : Introduction


 Cisco IOS Router Basic Configuration
 Accessing the Router CLI = First Boot
• Once the operating system is decompressed, you will be greeted with Cisco’s copyright information:
Smart Init is disabled. IOMEM set to: 5

Using iomem percentage: 5

Restricted Rights Legend


Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c) of the
Commercial Computer Software - Restricted Rights clause at FAR sec. 52.227-19 and subparagraph (c) (1) (ii) of the
Rights in Technical Data and Computer Software clause at DFARS sec. 252.227-7013.

cisco Systems, Inc.


170 West Tasman Drive
San Jose, California 95134-1706

Cisco IOS Software, 2800 Software (C2800NM-ADVENTERPRISEK9-M), Version 15.1(4)M10, RELEASE SOFTWARE
(fc2) 16
17

Lesson 7 : IP Connectivity : Introduction


 Cisco IOS Router Basic Configuration
 Accessing the Router CLI = First Boot
• And you will see some basic information about the router:

Installed image archive


Cisco 2811 (revision 1.0) with 747520K/38912K bytes of memory.
Processor board ID FTX1145A0XN
2 FastEthernet interfaces
2 Serial(sync/async) interfaces
1 Virtual Private Network (VPN) Module
DRAM configuration is 64 bits wide with parity enabled.
239K bytes of non-volatile configuration memory.
3906504K bytes of ATA CompactFlash (Read/Write)

• Above we can see that this is a Cisco 2811 router which has 2 FastEthernet interfaces and 2 Serial
interfaces. It also tells us how much RAM this router has and how big the compact flash memory is.

17
18

Lesson 7 : IP Connectivity : Introduction


 Cisco IOS Router Basic Configuration
 Accessing the Router CLI = First Boot
• Finally, the router asks us if we want to start the initial configuration dialog:

--- System Configuration Dialog ---


Would you like to enter the initial configuration dialog? [yes/no]: no

• Let’s enter no and continue. We will configure everything ourselves.


• The system configuration message above will only appear if your router has no startup configuration.

• The final message is:

Press RETURN to get started!


• At the bottom of the console, you will see this line:

Router>

• This means we are in user mode.


18
19

Lesson 7 : IP Connectivity : Introduction


 Cisco IOS Router Basic Configuration
 Accessing the Router CLI = Erase Startup Configuration
• The first thing we’ll do, just to be sure is remove the startup configuration so that we can start with a clean
slate.
• Let’s enter enable mode:

Router>enable

• If your router asks you for a password and you have no idea what it is, you will have to perform
a password recovery.
• Let’s erase the startup configuration:
Router#erase startup-config
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete

19
20

Lesson 7 : IP Connectivity : Introduction


 Cisco IOS Router Basic Configuration
 Accessing the Router CLI = Erase Startup Configuration
• And reload the router so that we start with a blank configuration:

Router#reload

System configuration has been modified. Save? [yes/no]: no


Proceed with reload? [confirm]

• It might take a few minutes for the router to reload. Once it’s ready, head back to privileged mode by
typing enable and we will continue.

20
21

Lesson 7 : IP Connectivity : Introduction


 Cisco IOS Router Basic Configuration
 Accessing the Router CLI = Interfaces
• Routers have an IP address on each interface that they have. Let’s say that we want to configure for the
following scenario:

192.168.1.254/24

Fa0/0

192.168.1.1/24

• Above you can see that R1 is connected to H1 on its FastEthernet 0/0 interface, it should use IP
address 192.168.1.254 and the subnet mask is 255.255.255.0 (/24)..

21
22

Lesson 7 : IP Connectivity : Introduction


 Cisco IOS Router Basic Configuration
 Accessing the Router CLI = Interfaces
• Here’s how you can see all interfaces on our router:

Router#show ip interface brief


Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset administratively down down
FastEthernet0/1 unassigned YES unset administratively down down

• Above you can see the four interfaces that this router has. It also tells us:
 IP-Address: if the interface has an IP address or not.
 OK: whether the interface is performing correctly or not.
 Method: how the IP address is configured. For example, we can configure an IP address manually or through
DHCP.
 Status: this tells us if the interface is active or not.
 Protocol: this tells us if the protocol that the interface is using is working or not.

22
23

Lesson 7 : IP Connectivity : Introduction


 Cisco IOS Router Basic Configuration
 Accessing the Router CLI = Interfaces
• All router interfaces are disabled by default. Administratively down means that the interface has a shutdown
command.
• We can also take a closer look at any of these interfaces like this:
Router#show interfaces FastEthernet 0/0
FastEthernet0/0 is administratively down, line protocol is down
Hardware is MV96340 Ethernet, address is 001d.a18b.36d0 (bia 001d.a18b.36d0)
MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Auto-duplex, Auto Speed, 100BaseTX/FX
23
24

Lesson 7 : IP Connectivity : Introduction


 Cisco IOS Router Basic Configuration
 Accessing the Router CLI = Interfaces
• Above we can see that the FastEthernet 0/0 interface is currently not in use. Let’s see if we can configure this
interface.
• First, open the configuration mode:
Router#configure terminal
• Now go to the interface, add an IP address and enable it:

Router(config)#interface FastEthernet 0/0


Router(config-if)#ip address 192.168.1.254 255.255.255.0
Router(config-if)#no shutdown

• Now we can continue by setting an IP address and enabling the interface.


• This interface is now active.

24
25

Lesson 7: IP Connectivity : Introduction


 Cisco IOS Router Basic Configuration
 Accessing the Router CLI = Interfaces
• Our router should now have one active interfaces. Let’s verify that:

Router#show ip interface brief


Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.1.254 YES manual up up

25
26

Lesson 7 : IP Connectivity : Introduction


 Cisco IOS Router Basic Configuration
 Accessing the Router CLI = Interfaces
• An alternative command that gives you a similar result is the show protocols command:

Router#show protocols
Global values:
Internet Protocol routing is enabled
FastEthernet0/0 is up, line protocol is up
Internet address is 192.168.1.254/24
FastEthernet0/1 is administratively down, line protocol is down

• This router now has two active interfaces with IP addresses. In other lessons, we’ll look at how it can route
packets from one interface to another.

26
27
Cisco Certified Network Associate (CCNA 200-301)

Lesson 8 : Static Route

Guideline
• Functions of a Router
• IP Routing Explained
• What is a default gateway
• Route Types
• Static routing
• Static Route Configuration
• Verify a Static Route

27
28

Lesson 8 : Static Route


IP Routing Explained
• The actual forwarding of IP packets by routers is called IP routing. This has nothing to do with the “learning” of
network routes through static or dynamic routing protocols. but has everything to do with the steps that routers have
to take when they forward an IP packet from one interface to another.

• In this lesson, I will walk you through an example and


show you all steps that occur.

• To do this, I will use the following topology:

28
29

Lesson 8 : Static Route


IP Routing Explained
• Let’s look at this step-by-step, device-by-device.
• Above we have two host computers and two routers. H1 is going to send an IP packet to H2 which has to be routed by
R1 and R2.

• Let’s start with H1. This host creates an IP packet with its own IP address (192.168.1.1) as the source and H2
(192.168.2.2) as the destination. The first question that H1 will ask itself is:
• Is the destination local or remote?
29
30

Lesson 8 : Static Route

IP Routing Explained
• It answers this question by looking at its own IP address, its subnet mask and the destination IP address:

C:\Users\H1>ipconfig

Windows IP Configuration

Ethernet adapter Ethernet 1:

Connection-specific DNS Suffix . : nwl.local


Link-local IPv6 Address . . . . . : fe80::88fd:962a:44d6:3a1f%4
IPv4 Address. . . . . . . . . . . : 192.168.1.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.254
• H1 is in network 192.168.1.0/24 so all IP addresses in the 192.168.1.1 – 254 range are local.  Our destination
(192.168.2.2) is outside of the local subnet so that means we have to use the default gateway.

30
31

Lesson 8 : Static Route


IP Routing Explained
H1 will now build an Ethernet frame, enters its own source MAC address and asks itself the second question, do I know
the destination MAC address of the default gateway? It checks its ARP table to find the answer:
C:\Users\H1>arp -a

Interface: 192.168.1.1 --- 0x4

Internet Address Physical Address Type


192.168.1.254 fa-16-3e-3f-fd-3c dynamic
192.168.1.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
• H1 has an ARP entry for 192.168.1.254. If not, it would have sent an ARP request. We now have an Ethernet
frame that carries an IP packet with the following addresses:

The frame will be on its way to R1.


31
32

Lesson 8 : Static Route


 What is a default gateway

• When a host wants to reach a destination that is outside of its own network, it has to use a default gateway.

We use a router or multilayer switch (that’s a switch that can do routing) as a default gateway.

• When one host wants to send something to another host then it will check if the destination is inside or outside its

own network. When the destination is in the same network then it will use ARP to find the MAC address of the

destination and it can send the IP packet. How does the host check if the destination is in the same network? This is

done by checking the subnet mask.

32
33

Lesson 8 : Static Route

 Functions of a Router

• The router is responsible for the routing of traffic between networks.

• Routers can connect multiple networks.

• Routers Choose Best Paths:

Determine the best path to send packets

Uses its routing table to determine path

33
34

Lesson 8 : Static Route


 The Routing Table
 Routing Table is a file stored in RAM that contains information about
 Directly Connected Routes
 Remote Routes
 Network or Next hop Associations

R2#show ip route

Codes: L - local, C - connected,

Gateway of last resort is not set

S 192.168.1.0/24 [1/0] via 192.168.12.1


192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.2.0/24 is directly connected, GigabitEthernet0/1

34
35

Lesson 8 : Static Route

 Route Types :
The different types of routing are:
• Static routing
 Manually configured
 Define an explicit path between two networking devices.
 Must be manually updated if the topology changes.
 Benefits include improved security and control of resources.

• Default routing
 A default route is actually a special static route that uses this format:
 This is sometimes referred to as a “Quad-Zero” route.

• Dynamic routing
 information is learned from other routers, and routing protocols adjust routes
automatically.
35
36

Lesson 8 : Static Route

 Static Route Configuration


• In this lesson we’ll take a look at static routes, and in particular how to configure them.
• Let me show you the following topology:

ip route [destination_network] [mask] [next-hop_address or exitinterface]

36
37

Lesson 8 : Static Route

 Static Route Configuration


 Next-Hop Options
• The next hop can be identified by an IP address, exit interface, or both. How the destination is specified creates
one of the three following route types:
• Next-hop route - Only the next-hop IP address is specified.
• Directly connected static route - Only the router exit interface is specified.

37
38

Lesson 8 : Static Route

 Static Route Configuration


• First I’ll go to enable mode and enter configuration mode to configure R1
R1>enable
R1#configure terminal
R1(config)#interface G1/0
R1(config-if)#no shutdown
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#exit
R1(config)#interface G2/0
R1(config-if)#no shutdown
R1(config-if)#ip address 192.168.12.1 255.255.255.0

38
39

Lesson 8 : Static Route

 Static Route Configuration


• First I’ll go to enable mode and enter configuration mode to configure R2
R2>enable
R2#configure terminal
R2(config)#interface G1/0
R2(config-if)#no shutdown
R2(config-if)#ip address 192.168.2.254 255.255.255.0
R2(config-if)#exit
R2(config)#interface G2/0
R2(config-if)#no shutdown
R2(config-if)#ip address 192.168.12.2 255.255.255.0

39
40

Lesson 8 : Static Route

 Static Route Configuration


• Configure a Next-Hop Static Route
• R1

R1(config)#ip route 192.168.2.0 255.255.255.0 192.168.12.2

• R2
R1(config)#ip route 192.168.1.0 255.255.255.0 192.168.12.1

40
41

Lesson 8 : Static Route

 Verify a Static Route

• Along with ping and traceroute, useful commands to verify static routes include:
• show ip route
• show ip route static
• show ip route network

41
42

Lesson 8 : Static Route


 Floating Static Route
• Static routes have a very low administrative distance of 1, this means that your router will prefer a static
route over any routes that were learned through a dynamic routing protocol. If we want to use a static
route as a backup route, we’ll have to change its administrative distance.
This is called a floating static route.
• In this lesson, I’ll show you how to do this.
We will use the following topology for this:

R1 can use R2 or R3 to get to the 192.168.23.0/24 network.


42
43

Lesson 8 : Static Route


 Floating Static Route
Configuration

R1 can use R2 or R3 to get to the 192.168.23.0/24 network.


43
44
Cisco Certified Network Associate (CCNA 200-301)

Lesson 9 : Inter-VLAN Routing


Guideline
 What is Inter-VLAN Routing?

 Configure router-on-a-stick inter-VLAN routing

 Configure inter-VLAN routing using Layer 3 switching

• SVI (Switch Virtual Interface)

 Troubleshooting Inter-VLAN Routing

44
45

Lesson 9 : Inter-VLAN Routing


 What is Inter-VLAN Routing?

• Layer 2 switches can’t forward traffic between VLANs without the assistance of a router
• Inter-VLAN routing is a process for forwarding network traffic from one VLAN to another using a router
• In this lesson we are going to take a look at routing between VLANs. When we want communication between
different VLANs we’ll need a device that can do routing. We could use an external router but it’s also possible to use
a multilayer switch (aka layer 3 switches).
45
46

Lesson 9 : Inter-VLAN Routing


 Router-On-A-Stick Inter-VLAN Routing

• router-on-a-stick approach uses a different path to route between VLANs


• One of the router’s physical interfaces is configured as a 802.1Q trunk port. Now that interface can understand
VLAN tags
• Logical subinterfaces are then created. One subinterface per VLAN
• Each subinterface is configured with an IP address from the VLAN it represents
• VLAN members (hosts) are configured to use the subinterface address as a default gateway.
• Only one of the router’s physical interface is used
46
47

Lesson 9 : Inter-VLAN Routing


 Router-On-A-Stick Inter-VLAN Routing

• SW1 has two VLANs so we have two different subnets. If we want communication between these VLANs we’ll have
to use a device that can do routing. In this example we’ll use a router for the job. R1 will need access to both
VLANs so we’ll create a 802.1Q trunk between SW1 and R1. Here’s how to configure this

47
48

Lesson 9 : Inter-VLAN Routing


 Router-On-A-Stick Inter-VLAN Routing

Here’s what the configuration looks like on the switch:

SW1(config)#interface fa0/3
SW1(config-if)# switchport trunk allowed vlan all
SW1(config-if)#switchport mode trunk
SW1(config-if)#switchport trunk allowed vlan 10,20

• This is how we configure SW1. Make interface fa0/3 a trunk port and for security measures I made sure that only
VLAN 10 and 20 are allowed.

48
49

Lesson 9 : Inter-VLAN Routing


 Router-On-A-Stick Inter-VLAN Routing

Here’s what the configuration looks like on the switch:

SW1(config)#interface fa0/1
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 10
SW1(config-if)#exit
SW1(config)#interface fa0/2
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 20
• Interface configuration

49
50

Lesson 9 : Inter-VLAN Routing


 Router-On-A-Stick Inter-VLAN Routing

Here’s what the configuration looks like on the router:

R1(config)#interface fa0/0.10
R1(config-subif)#encapsulation dot1Q 10
R1(config-subif)#ip address 192.168.10.254 255.255.255.0
R1(config)#interface fa0/0.20
R1(config-subif)#encapsulation dot1Q 20
R1(config-subif)#ip address 192.168.20.254 255.255.255.0

• Create two sub-interfaces on the router and tell it to which VLAN they belong. Don’t forget to add an IP address for
each VLAN.

50
51

Lesson 9 : Inter-VLAN Routing


 Router-On-A-Stick Inter-VLAN Routing

Here’s what the configuration looks like on the router:

R1#show ip route
Codes: 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
i - IS-IS, su - IS-IS summary, 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
C 192.168.10.0/24 is directly connected, FastEthernet0/0.10
C 192.168.20.0/24 is directly connected, FastEthernet0/0.20

• The router will be able to route because these two networks are directly connected.
51
52

Lesson 9 : Inter-VLAN Routing


 Router-On-A-Stick Inter-VLAN Routing

C:\Documents and Settings\H1>ipconfig


Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.10.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.10.254

C:\Documents and Settings\H2>ipconfig


Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.20.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.20.254

• Don’t forget to set your IP address and gateway on the computers.


52
53

Lesson 9 : Inter-VLAN Routing


 Router-On-A-Stick Inter-VLAN Routing

Let’s try a ping:

C:\Documents and Settings\H1>ping 192.168.20.1


Pinging 192.168.20.1 with 32 bytes of data:

Reply from 192.168.20.1: bytes=32 time<1ms TTL=128


Reply from 192.168.20.1: bytes=32 time<1ms TTL=128
Reply from 192.168.20.1: bytes=32 time<1ms TTL=128
Reply from 192.168.20.1: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.1.2:


Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

• The router will be able to route because these two networks are directly connected.
53
54

Lesson 9 : Inter-VLAN Routing


 Router-On-A-Stick Inter-VLAN Routing

• That’s how you do it. So why would you want to use a solution like this? It’s cheap! You don’t need a multilayer
switch for your routing. Any layer 2 switch will do.
• The Cisco Catalyst 2960 is a layer 2 switch; the cheapest multilayer switch is the Cisco Catalyst 3560. Compare
the price on those two and you’ll see what I’m talking about.
• Some of the disadvantages of this solution is that your router is a single point of failure and that traffic flows up
and down on the same link which might cause congestion.

• So what other solutions do we have? SVI (Switch Virtual Interface)

54
55

Lesson 9 : Inter-VLAN Routing


 Multilayer Switch Inter-VLAN Routing

• Multilayer switches can perform Layer 2 and


Layer 3 functions. Routers are not required
anymore
• Each VLAN existent in the switch is a SVI
• SVI are seen as layer 3 interfaces
• The switch understands network layer PDUs
and therefore, it can route between its SVIs
just as a router routes between its interfaces
• With a multilayer switch, traffic is routed
internal to the switch device
• Very scalable solution

55
56

Lesson 9 : Inter-VLAN Routing


 Multilayer Switch Inter-VLAN Routing

• This is the picture of a multilayer


switch. This switch has routing
capabilities! I can configure something
called a SVI (Switch Virtual
Interface) for each VLAN and put an
IP address on it. This IP address can be
used for computers as their default
gateway. Here’s how to configure it:

56
57

Lesson 9 : Inter-VLAN Routing


 Multilayer Switch Inter-VLAN Routing

Here’s what the configuration looks like on the switch:

SW1(config)#ip routing
SW1(config)#interface vlan 10
SW1(config-if)#no shutdown
SW1(config-if)#ip address 192.168.10.254 255.255.255.0
SW1(config)#interface vlan 20
SW1(config-if)#no shutdown
SW1(config-if)#ip address 192.168.20.254 255.255.255.0

• Start by enabling routing using the ip routing command. If you forget this your switch won’t build a routing table!
Next step is to create a SVI for VLAN 10 and 20 and configure IP addresses on them. This configuration might look
familiar if you worked with layer 2 switches before. On a layer 2 switch like the Cisco Catalyst 2950/2960 we also
have a SVI but you can only use it for remote management.
57
58

Lesson 9 : Inter-VLAN Routing


 Multilayer Switch Inter-VLAN Routing

• I have two computers in VLAN 10 and created a SVI for VLAN 10.
• You’ll see that the status says up/up so that’s good

• Once you create a SVI and type no shutdown it will normally be


“up” since it’s only a virtual interface, there are however a number
of requirements or it will show up as “down”:
• The VLAN has to exist in the VLAN database and it should be active.
• At least one access or trunk port should use this VLAN actively and it
should be in spanning-tree forwarding mode.

SW1#show ip interface brief vlan 10


Interface IP-Address OK? Method Status Protocol
Vlan10 192.168.10.254 YES manual up up

58
59

Lesson 9 : Inter-VLAN Routing


 Multilayer Switch Inter-VLAN Routing

• If I shutdown one interface nothing will change, my SVI will still


show up/up because interface fa0/2 is still active.

SW1#show ip interface brief vlan 10


Interface IP-Address OK? Method Status Protocol
Vlan10 192.168.10.254 YES manual up up

59
60

Lesson 9 : Inter-VLAN Routing


 Multilayer Switch Inter-VLAN Routing

• Once I shut both interfaces we don’t have anything active anymore


in VLAN 10. As a result the SVI will go to up/down.

SW1#show ip interface brief vlan 10


Interface IP-Address OK? Method Status Protocol
Vlan10 192.168.10.254 YES manual up down

60
61

Lesson 9 : Inter-VLAN Routing


 Multilayer Switch Inter-VLAN Routing

• Now if I want I can exclude an interface from the SVI state. Imagine I want to make sure that whatever happens
to interface fa0/2 doesn’t influence the SVI state:

SW1(config)#interface fa0/2
SW1(config-if)#switchport autostate exclude

• I can use the switchport autostate exclude command. This means it won’t influence the state of the SVI interface
anymore. Fa0/1 is the only interface that can now influence the SVI state, as soon as it goes down you’ll see that
SVI state go down as well, even though fa0/2 is still up and running
• Enough about the SVI, there’s another method we can use our multilayer switch for routing. By default all
interfaces on a switch are switchports (layer 2) but we can change them to routed ports (layer 3). A routed port is
the exact same interface as what we use on a router.

61
62
Cisco Certified Network Associate (CCNA 200-301)

Lesson 10 : OSPF Basic Configuration


 Having said that, let’s configure OSPF! This is the topology I will use:
All routers are in OSPF Area 0.

62
63

Lesson 10 : OSPF Basic Configuration


 We’ll start with the configuration between R2 and R3:

R2(config)#router ospf 1
R2(config-router)#network 192.168.23.0 0.0.0.255 area 0

R3(config)#router ospf 1
R3(config-router)#network 192.168.23.0 0.0.0.255 area 0

• I need to use the router ospf command to get into the OSPF configuration. The number “1” is a process ID and you
can choose any number you like. It doesn’t matter and if you want you can use a different number on each router.

• The second step is to use the network command. It works similar to RIP but it is slightly different, let me break it
down for you:

63
64

Lesson 10 : OSPF Basic Configuration


 We’ll start with the configuration between R2 and R3:

network 192.168.23.0 0.0.0.255

• Just like RIP the network command does two things:

• Advertise the networks that fall within this range in OSPF.


• Activate OSPF on the interface(s) that fall within this range. This means that OSPF will send hello packets on the
interface.
• Behind 192.168.23.0 you can see it says 0.0.0.255. This is not a subnet mask but a wildcard mask. A wildcard
mask is a reverse subnet mask.
• OSPF uses areas so you need to specify the area:
• In our example we have configured single area OSPF. All routers belong to area 0.

area 0

64
65

Lesson 10 : OSPF Basic Configuration


 We’ll start with the configuration between R2 and R3:
• After typing in my network command you’ll see this message in the console:

R3# %OSPF-5-ADJCHG: Process 1, Nbr 192.168.23.2 on FastEthernet0/0 from LOADING to FULL, Loading Done

R2# %OSPF-5-ADJCHG: Process 1, Nbr 192.168.23.3 on FastEthernet1/0 from LOADING to FULL, Loading Done

• Great! It seems that R3 and R2 have become neighbors. There’s another command we can use to verify that we have
become neighbors:

R3#show ip ospf neighbor


192.168.23.2 1 FULL/BDR 00:00:36 192.168.23.2 FastEthernet0/0

R2#show ip ospf neighbor


192.168.23.3 1 FULL/DR 00:00:32 192.168.23.3 FastEthernet1/0

• Show ip ospf neighbor is a great command to see if your router has OSPF neighbors. When the state is full you know
that the routers have successfully become neighbors.
65
66

Lesson 10 : OSPF Basic Configuration


 Each OSPF router has a router ID and we check it with the show ip protocols command:

R2#show ip protocols
Routing Protocol is "ospf 1"
Router ID 192.168.23.2

R3#show ip protocols
Routing Protocol is "ospf 1"
Router ID 192.168.23.3
• Above you see the router ID of R2 and R3. They used their highest active IP address as the router ID.

66
67

Lesson 10 : OSPF Basic Configuration


 Right now we have an OSPF neighbor adjacency between R2 and R3. Let’s configure our routers so that R2/R1
and R1/R3 also become OSPF neighbors:

R2(config)#router ospf 1
R2(config-router)#network 192.168.12.0 0.0.0.255 area 0

R1(config)#router ospf 1
R1(config-router)#network 192.168.12.0 0.0.0.255 area 0
R1(config-router)#network 192.168.13.0 0.0.0.255 area 0

R3(config)#router ospf 1
R3(config-router)#network 192.168.13.0 0.0.0.255 area 0
I’ll advertise all networks in OSPF. Before we check the routing table it’s a good idea to see if our routers have
become OSPF neighbors:

67
68

Lesson 10 : OSPF Basic Configuration


 Let’s check the routing tables:

R2#show ip route ospf


O 192.168.13.0/24 [110/2] via 192.168.23.3, 00:09:45, FastEthernet1/0

68
69
Cisco Certified Network Associate (CCNA 200-301)

Lesson 11 : OSPF Packets and Neighbor Discovery


 OSPF packet types:
• Let’s continue by looking at the different OSPF packet types:

Hello neighbor discovery, build neighbor adjacencies and maintain them.

Database Description (DBD) This packet is used to check if the LSDB between 2 routers is the same. The DBD is a
summary of the LSDB.

Link-State Request (LSR) Requests specific link-state records from an OSPF neighbor

Link-State Update (LSU) Sends specific link-state records that were requested. This packet is like an envelope
with multiple LSAs in it.

Link-State Acknowledgment OSPF is a reliable protocol so we have a packet to acknowledge the others.
(LSAcK)

69
70

Lesson 11 : OSPF Packets and Neighbor Discovery


 OSPF Neighbor Adjacencies:
• OSPF has to get through 7 states in order to become neighbors…here they are:
Down no OSPF neighbors detected at this moment.

Init Hello packet received.

Two-way own router ID found in received hello packet.

Exstart master and slave roles determined.

Exchange database description packets (DBD) are sent.

Loading exchange of LSRs (Link state request) and LSUs (Link state update) packets.

Full OSPF routers now have an adjacency.

70
71

Lesson 11 : OSPF Packets and Neighbor Discovery


 Neighbor States

Down

• As soon as I configure OSPF on R1 it will start sending hello packets. R1 has no clue about other OSPF routers at this
moment so it’s in the down state. The hello packet will be sent to the multicast address 224.0.0.5.

71
72

Lesson 11: OSPF Packets and Neighbor Discovery


 Neighbor States

Init
• R2 receives the hello packet and will put an entry for R1 in the OSPF neighbor table. We are now in the init state.

Two-way
• R2 has to respond to R1 with a hello packet. This packet is not sent using multicast but with unicast and in the neighbor
field it will include all OSPF neighbors that R2 has. R1 will see its own name in the neighbor field in this hello packet.
• R1 will receive this hello packet and sees its own router ID. We are now in the two-way state. 72
73

Lesson 11: OSPF Packets and Neighbor Discovery


 Neighbor States

Exstart

• Our next stop is the exstart state. Our routers are ready to sync their LSDB. At this step we have to select a master
and slave role. The router with the highest router ID will become the master. R2 has the highest router ID and will
become the master.

73
74

Lesson 11 : OSPF Packets and Neighbor Discovery


 Neighbor States

database description

Exchange

exchange of LSRs

Loading

74

You might also like