Professional Documents
Culture Documents
Data Communication
(Networks Design & Configuration -2)
1
Cisco Certified Network Associate (CCNA 200-301)
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
4
5
• 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
• Let’s look at the same example but now we are using routers.
6
7
• 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
• 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
• 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
• 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
12
13
• 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
15
16
Cisco IOS Software, 2800 Software (C2800NM-ADVENTERPRISEK9-M), Version 15.1(4)M10, RELEASE SOFTWARE
(fc2) 16
17
• 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
Router>
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
Router#reload
• 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
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
• 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
24
25
25
26
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)
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
28
29
• 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
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
30
31
• 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
32
33
Functions of a Router
33
34
R2#show ip route
34
35
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
36
37
37
38
38
39
39
40
• R2
R1(config)#ip route 192.168.1.0 255.255.255.0 192.168.12.1
40
41
• 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
44
45
• 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
• 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
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
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
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
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
• The router will be able to route because these two networks are directly connected.
53
54
• 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.
54
55
55
56
56
57
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
• 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
58
59
59
60
60
61
• 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)
62
63
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
area 0
64
65
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:
• 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
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
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
68
69
Cisco Certified Network Associate (CCNA 200-301)
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
Loading exchange of LSRs (Link state request) and LSUs (Link state update) packets.
70
71
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
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
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
database description
Exchange
exchange of LSRs
Loading
74