You are on page 1of 44

Introduction to Routing and Switching Simulate with GNS3

Nguyn Quc nh
Faculty of IT, Ho Chi Minh City University of Industry Sept 2012

Schedule

Part 1: Starting with GNS3 Part 2: Static routing Part 3: VLAN Part 4: LAN with STP Part 5: RIP (v2, ng) Part 6: OSPF Part 7: BGP Part 8: Multicasting Part 9: Access Control List Part 10: Review (Oh great)
2

Part 1 Starting with GNS3


Nguyn Quc nh

Why not Packet Tracer?

How different?

Packet Tracer: simulation program GNS3: emulation program

On PT, you just can't fully operate BGP, STP, multicast But the upside of PT (so it'd be there)

Lightweight Easily to configure and see the result


4

To get started with GNS3 see

GNS3: Graphical Network Simulator


by Mike Fuszner, v1.0

Notes: Setup

For this part and also later parts, use IOS 3640 Make sure to have virtual PC (vpc) for your testing (i.e. ping) GNS3 and its components run faster under Linux than under Windows

Above all, always set IDLE PC to save your computer computation

Try to remember all commands may overload your little brain, use ? for commands supported
6

Note: Saving configuration

Configurations in two locations - RAM and NVRAM. The running configuration is stored in RAM. Any configuration changes to the router are made to the running-configuration and take effect immediately after the command is entered. The startup-configuration is saved in NVRAM and is loaded into the router's running-configuration when the router boots up. To save the running-configuration to the startup configuration, type the following from privileged EXEC mode (i.e. at the "Router#" prompt.)

#copy running-config startup-config


8

Tip: Save your working frequently with


#copy running-config startup-config

Target:

Read (and do) up to page #40 of Mike's tutorial You have to setup and configure IP address of PCs in this network

PC1

PC2

PC3

10

Q: Could PC1 ping F0/0 of West? Why Q: Could PC1 ping S0/1 of West? Why Q: Could PC1 ping PC2? Why

11

Part 2 Static Routing


Nguyn Quc nh

12

Why static routing?

Static routing vs Dynamic routing


How different? What scale?

Static routing: toy game for tiny network

13

Commands

config t interface Fa0/0 ip address [ip-address] [subnet-mask] show ip route: displace routing table in a router ip route [destination-network-address] [subnetmask] [next-hop-IP-address]: configure static route statement sh ip int brief: displace brief interfaces information
14

Lab 1

Target: Use static routing to connect all PCs in this network IP addresses of interface and PCs are shown in the picture
15

Hint: configure static routing table in each

West

(config)#ip route 192.168.1.0 255.255.255.0 10.0.0.2 (config)#ip route 192.168.2.0 255.255.255.0 10.0.0.2

Central

(config)#ip route 192.168.0.0 255.255.255.0 10.0.0.1 (config)#ip route 192.168.2.0 255.255.255.0 10.0.1.2

East

(config)#ip route 192.168.0.0 255.255.255.0 10.0.1.1 (config)#ip route 192.168.1.0 255.255.255.0 10.0.1.1

16

Command show ip route on West, East, and Central Does it reveal something? Try to explain the results See more results with ping, traceroute (router), and tracert (PC)

17

Check your understanding by configure following network


7 8

6 4 5

18

Requirements for previous scenario

Grand addresses 172.(15+X).0.0/16 for X-th subnet. User static routing

All PCs could communicate through the network show ip route ping to the internet tracert from PC
19

Checking (always checking)


Part 3 VLAN
Nguyn Quc nh

20

Notes on VLAN

VLANs are assigned on the switch port. There is no VLAN assignment done on the host (usually). Assigning a host to the correct VLAN is a 2-step process:
1. Connect the host to the correct port on the switch. 2. Assign to the host the correct IP address depending on the VLAN memebership

Remember: VLAN = Subnet

Following labs, we use static VLANs


21

To use switch @GNS3

GNS3 doesn't include layer-2 and layer-3 switches.


we could utilize router as switch instead by using NM-16ESW module in router. In this way you can configure switching protocols like VLAN, STP, VTP ect. To make a switch symbol, see following slide

How?

22

To use switch @GNS3


3

1
You got a switch symbol from c3600 (c3640) Use it in the following VLAN labs

23

Commands Related to VLAN


To add more items to vlan database: #vlan database (vlan)#vlan 20 name engineering To make a host connect to current port belong to vlan 20: (config-if)#switchport mode access (config-if)#switchport acess vlan 20 To turn current port to trunking mode: (config-if)#switchport mode trunk (config-if)#switchport trunk allowed vlan all
24

Commands Related to VLAN (cont)


And to show vlan summary: #show vlan? #show vlan-switch #show interfaces fa0/1 switchport #sh vtp status Following slides explain more in few commands

25

Configure Ranges of VLANs


Switch(config)#interface range fastethernet 0/8, fastethernet 0/12 Switch(config-if)#switchport access vlan 3 Switch(config-if)#exit

vlan 3

26

Mode Acess
Switch(config)#interface fastethernet 0/1 Switch(config-if)#switchport mode access Switch(config-if)#exit Note: The switchport mode access command should be configured on all ports that the network administrator does not want to become a trunk port.

27

Face Mistake, to Remove


Deleting a Port VLAN Membership
Switch(config-if)#no switchport access vlan vlan_number

Deleting a VLAN
Switch#vlan database Switch(vlan)#no vlan <vlan_number> Switch(vlan)#exit
28

VLAN Tagging
No VLAN Tagging

VLAN Tagging

To turn current port to trunking mode: (config-if)#switchport mode trunk (config-if)#switchport trunk allowed vlan all Or more selective (config-if)#switchport trunk allowed vlan 10 20
29

Lab 1: Assign VLAN Port


Target: Create this VLAN table @R1: VLAN 1: default VLAN 10: engineering VLAN 20: r-d VLAN 30: accounting VLAN 40: sale VLAN 10 owns 172.168.10.0/24 subnet VLAN 20 owns 172.168.11.0/24 subnet VLAN 30 owns 172.168.12.0/24 subnet VLAN 40 owns 172.168.13.0/24 subnet

30

Lab 1: Assign VLAN Port (cont)


Assign following: C0 owned by an engineer C1 owned by an engineer C2 owned by a seller Their IP addresses assigned by your own Configure the network. Then answer: Can C0 ping C1? Why? Can C0 ping C2? Why?
31

Lab 2: VLAN Trunking

switchport mode trunk switchport mode access


32

Lab 2: VLAN Trunking (cont)

Assign following: C0 owned by an engineer C1 owned by an engineer C2 owned by a seller C3 owned by an engineer C4 owned by a seller

Their IP addresses assigned by your own


Check if all engineers/sellers assigned to the same subnet
33

Lab 3 (option): Testing your understanding with VLAN Trunking

For guidance, see attached documentation (part3-lab3.pdf) from TruongTan Inst.

34

Lab 4 (option): Routing between VLANs

For guidance, see attached documentation (part3-lab4.pdf) from TruongTan Inst.

35

Part 4 LAN with STP


Nguyn Quc nh

36

Objective

Learn how to identify which switch is elected as the root bridge. Learn how to determine the optimum bridge placement. Learn to optimize Spanning Tree convergence. Learn to change connection cost.

37

(1) Network scenario

Put the switch in order as shown in the picture. In which the R4 is put in the last

4 2 3
38

By default, STP is build in VLAN 1. And R1 is the root. Why? R1#show spanning-tree

VLAN1 is executing the ieee compatible Spanning Tree protocol Bridge Identifier has priority 32768, address cc00.597e.0000 Configured hello time 2, max age 20, forward delay 15 We are the root of the spanning tree Topology change flag not set, detected flag not set Port 1 (FastEthernet0/0) of VLAN1 is forwarding Port path cost 19, Port priority 128, Port Identifier 128.1. Designated root has priority 32768, address cc01.60ce.0000 Designated bridge has priority 32768, address cc01.60ce.0000 Designated port id is 128.1, designated path cost 0 BPDU: sent 24, received 0 Port 2 (FastEthernet0/1) of VLAN1 is forwarding Port path cost 19, Port priority 128, Port Identifier 128.2.
39

R1#show spanning-tree

VLAN1 is executing the ieee compatible Spanning Tree protocol Bridge Identifier has priority 32768, address cc00.597e.0000 Configured hello time 2, max age 20, forward delay 15 We are the root of the spanning tree Topology change flag not set, detected flag not set

R2#show spanning-tree

VLAN1 is executing the ieee compatible Spanning Tree protocol Bridge Identifier has priority 32768, address cc01.597e.0000 Configured hello time 2, max age 20, forward delay 15 Current root has priority 32768, address cc00.597e.0000 Root port is 2 (FastEthernet0/1), cost of root path is 38
40

Where's the root

R1 is the root. By default a Root Bridge is elected, and the one has slowest Bridge ID (determined by the Bridge Priority and the MAC address) is the winner. Want to make

R4 to be the root bridge

41

Change the root bridge

By default, all bridge has priority of 32768 To change priority of one bridge:
Switch(config)#spanningtreevlan<vlanlist> priority<bridgepriority>

To make one bridge be root-bridge (priority = 8192)


Switch(config)#spanningtreevlan<vlanlist> rootprimary

To make one bridge be secondary root-bridge for redundancy (priority = 16384)


Switch(config)#spanningtreevlan<vlanlist> rootsecondary
42

Let's make some changes

Make R4 become the root:


R4(config)#spanningtreevlan1root primary

Make R3 has one port to be blocked (why we has following setting?)


R3(config)#spanningtreevlan1priority 61440

43

(2) Change the cost of each link

Default path costs


10BaseT: 100BaseT: 1000Baset: 100 19 4

To change the cost in each link


switch(configif)#spanningtreevlan<vlan list>cost<cost>

What happens when the port of R4 which links to R2 has the cost of 15?
44

(3) Spanning tree convergence

STP uses several timers to recover from topology changes Modifying STP timers

spanningtreevlanvlanlisthellotimeseconds spanningtreevlanvlanlistforwardtimeseconds spanningtreevlanvlanlistmaxageseconds

45

You might also like