GNS3 Lab Manual
GNS3 Lab Manual
GNS3 Lab Manual
By : Yaser Rahmati
Instagram : instagram.com/yaser.rahmati/
Contents at a Glance
Introduction
About GNS3
GNS3 Architecture
Windows Installation
Linux Installation
Cisco IOS images for Dynamips
Add Router IOS Image in GNS3
Add a Virtual Machine in GNS3
Upgrade The GNS3 VM
L2 Switching Simulation
L3 switching Simulation
Lab 1 : Connect 2 PCs
Lab 2 : Connect Router to Cloud in GNS3
Lab 3 : Configure Static Route in GNS3
Lab 4 : Syslog Server for Cisco Router in GNS3
Lab 5 : DHCP configuration in GNS3
Lab 6 : Router Remote Access via Telnet
About GNS3
GNS3 is used by hundreds of thousands of network engineers worldwide to emulate, configure, test
and troubleshoot virtual and real networks. GNS3 allows you to run a small topology consisting of
only a few devices on your laptop, to those that have many devices hosted on multiple servers or
even hosted in the cloud.
Testing networks
1. GNS3
2. Cisco Packet Tracer
3. Cisco VIRL
4. Physical equipment
5. Others
. GNS3 Ethernet Switch
GNS3 Advantages
1. Free software
2. Open Source software
3. No monthly or yearly license fees
4. No limitation on number of devices supported (only limitation is your hardware: CPU and
memory)
5. Supports multiple switching options (ESW16 Etherswitch, IOU/IOL Layer 2 images, VIRL
IOSvL2):
. Supports all VIRL images (IOSv, IOSvL2, IOS-XRv, CSR1000v, NX-OSv, ASAv)
7. Supports multi vendor environments
. Can be run with or without hypervisors
9. Supports both free and paid hypervisors (Virtualbox, VMware workstation, VMware player, ESXi,
Fusion)
10. Downloadable, free, pre-configured and optimized appliances available to simplify deployment
11. Native support for Linux without the need for need for additional virtualization software
12. Software from multiple vendors freely available
13. Large and active community (800,000+ members)
Disadvantages:
1. Cisco images need to be supplied by user (download from Cisco.com, or purchase VIRL
license, or copy from physical device).
2. Not a self contained package, but requires a local installation of software (GUI).
3. GNS3 can be affected by your PC’s setup and limitations because of local installation (firewall
and security settings, company laptop policies etc).
Source
https://docs.gns3.com/1PvtRW5eAb8RJZ11maEYD9_aLY8kkdhgaMB0wPCz8a38/index.html
GNS3 Architecture
Note
The controller pilot everything it’s the part that manage the state of a project, save it on disk.
Only one controller exists.
The GUI display the topology. The GUI has only direct contact with the controller.
The compute are where emulator are executed. If the compute is on the same server as the
controller, they are in the same process.
For each node of the topology will start an emulator instance.
A small schema:
2. REQUIREMENTS
MINIMUM RECOMMENDED
ITEM OPTIMAL REQUIREMENTS
REQUIREMENTS REQUIREMENTS
Virtualization
extensions Virtualization extensions Virtualization extensions
required. You may required. You may need to required. You may need to
Virtualization
need to enable enable this via your enable this via your
this via your computer's BIOS. computer's BIOS.
computer's BIOS.
Using a web browser, browse to https://gns3.com and click the Free Download link:
your details and then click Login & Continue: After login,
you will be prompted to select the version of GNS3 to download. In this guide, we will select the
Windows installation. Click the Download button to download the GNS3-all-in-one package:
your Downloads folder and then double click the GNS3-1.5.0-all-in-one.exe file:
If displayed, click the Run button to start the GNS3
installation:
GNS3 comes bundled with various prerequisite and optional software. By default most software is
selected for installation, but you can decide to only install specific software.
SolarWinds
Optional software for viewing captured traffic in an easy to read
Response Optional
format.
Time Viewer
Source
https://docs.gns3.com/11YYG4NQlPSl31YwvVvBS9RAsOLSYv0Ocy-uG2K8ytIY/index.html
Cisco IOS images for Dynamips
1. IOS images are usually run in Dynamips however R+Svms are housed in a virtual machine.
2. IOS images are lower in cpu and memory so you can fit more of them in one topology.
3. R+Svms are all vendor Routing and Switching images that are larger in size but can be
imported into GNS3 for real world network emulation.
Idle-PC value
This settings will help Dynamips to consume less CPU. It’s specific to each different IOS image.
Recommended images
We really recommend using c3640, c3660, c3725, c3745 and c7200 IOS images.
They have proven to be the most stable in GNS3 provided you use the right amount of RAM and
Idle-PC value.
Series File name Proposed idle-PC value
c3640
c7200 c7200-adventerprisek9-mz.152-4.M7.bin
Source
1 http://docs.gns3.com/1-kBrTplBltp9P3P-AigoMzlDO-ISyL1h3bYpOl5Q8mQ/
2 http://www.ciscopress.com/articles/article.asp?p=2106547
3 http://sfree.ws/model?main_group_id=1&child_group_id=104&model_id=1407&releas
Add Router IOS Image in GNS3
After installing GNS3, you need to add router IOS image in GNS3. To do so, you need to perform the
following steps:
Step 1 :
In the GNS3 console, click Edit and select Preferences to open the Preferences window. Click
Next to add a new router IOS image in GNS3, as shown in the following figure.
Step 2 :
In the IOS image page, select the New Image radio button, click Browse and select the router
IOS image that you want to add in GNS3. In this case, e will use Cisco router c2691 IOS image.
Click Next to proceed, as shown in the following figure.
Step 3 :
In the Name and platform window, specify the name and platform for the IOS image and then
click Next as shown in the following figure.
Step 4 :
In the Memory page, set the desired Default RAM size and then click Next as shown in the
following figure.
Step 5 :
In the Network adapters page, ensure that slot 0 is already listed and selected. Select the
additional slots, if required, and then click Next as shown in the following figure.
Step 6 :
In the WIC modules page, select the WIC modules to add additional modules as per your
requirement, and then click Next as shown in the following figure.
Step 7 :
On the Idle-pc page, click Finish and then click OK to close the Preferences window.
Step 8 :
In the GNS3 console, you can see that c2691 router is added. Drag it to the work view area as
shown in the following figure. Right-click on the added router and then select Start to start it.
Step 9 :
https://protechgurus.com/how-to-add-router-ios-image-in-gns3/
Add a Virtual Machine in GNS3
In order to add a virtual machine in GNS3, you need to perform the following steps:
Step 1 :
First, create a virtual machine in VMware workstation. We assume that you have already
created a virtual machine using VMware workstation. In the following figure, you can see we
have created two virtual machines named SVR1 and SVR2. In this demonstration, we will add
SVR1 virtual machine to GNS3.
Step 2 :
Once you have created the virtual machine, open the GNS3 console, click Edit and select
Preferences.
On the Preferences window, select VMware VMs in the left pane and click New to add a new
VMware virtual machine in GNS3.
Step 3 :
In the VMware Virtual Machine page, your virtual machine should be available in the VM list
drop-down menu as shown in the following figure. Select your virtual machine that you want to
add in GNS3 and then click Finish.
Step 4 :
In the GNS3 console, drag your virtual machine in the work view area. Right-click virtual
machine and select Start to start it.
Step 5 :
Now, this virtual machine can be connected to routers, switches and other devices in GNS3.
Open the console of the virtual machine and use it as a real machine to perform the hands-on
lab exercises.
Source
https://protechgurus.com/add-virtual-machine-in-gns3/
Upgrade The GNS3 VM
Step 1 :
Step 2 :
Select the upgrade option and run it:
Step 3 :
You can also change the version branch use by your GNS3:
Source
https://docs.gns3.com/1u6099Ru5cEpuszknnCRtfVF0qQZC7sDtWwjlGt4dAeQ/index.html
L2 Switching Simulation
To add and configure switches in GNS3 (Switching Simulation), you need to perform the following
steps:
Step 1 :
Step 2 :
Once you have downloaded the VMDK file, open the Preferences window in GNS3 by navigating
Edit and Preferences in the GNS3 console.
Step 3 :
Select Qemu VMs in the left pane and then click New to add a new Qemu VM template.
Step 4 :
On the QEMU VM Type page, select IOSv-l2 in from the Type drop-down list and then click
Next.
Step 5 :
On the QEMU VM name page, specify a name for this Qemu VM in the Name text box. Click
Next to proceed.
Step 6 :
In the QEMU binary and memory page, select the binary directory. If you select x86 binary for
the 64-bit system, you might get an error during opening the console of the switch in GNS3.
Hence, select the appropriate binary depending on the type of architecture of your system. Click
Next to proceed.
Step 7 :
On the Disk image page, select the New Image radio button. Browse and select the IOSv2-l2
VMDK file that you have downloaded previously. Click Finish to close the New QEMU VM
template window.
Step 8 :
Drag the recently added switch in the work view area and start the switch.
Step 9 :
Open the console of the added switch. Let’s complete the booting process. If everything goes in
the right way, the console of the switch will be displayed.
Source
https://protechgurus.com/add-use-switch-gns3-switching-simulation/
L3 switching Simulation
To add a layer 3 switch in GNS3, you need to perform the following steps:
Step 1 :
First of all, download the Cisco 3640 series IOS image file.
Step 2 :
Once you have downloaded the Cisco 3640 series IOS image, open the Preferences window by
clicking the Edit and then Preferences in the GNS3 console.
Step 3 :
In the Preferences window, select IOS routers in the left pane. Here, you will see all the added
IOS router templates. To add a new IOS router template, click New as shown in the following
figure.
Step 4 :
On the New IOS router template window, select the New Image radio button.
Step 5 :
Click Browse and navigate to the location where you have downloaded the 3640 IOS image file,
and then select it.
Step 6 :
In the IOS Image message box, click Yes to decompress the selected image, and then click
Next.
Step 7 :
On the Name and platform page, type a name such as Layer 3 Switch in the Name text box,
select the This is an EtherSwitch router check box and then click Next.
Step 8 :
On the Memory page, accept the default memory size or set the desired value, and click Next.
Step 9 :
On the Network adapters page, select NM-16ESW from the slot 0 drop-down list and then click
Next.
Step 10 :
On the Idle-PC Finder page, click Finish and close the Preferences window.
Step 11 :
You will see that a layer 3 switch in GNS3 console has been added. Drag it to the work view
area.
Step 12 :
Once it is started, select and right-click again it and select Console to open its console.
Step 14 :
On the ESW1 console, type the following commands to verify that it works as a Layer 3 switch.
1 ESW1#config t
2 ESW1(config)#hostname Switch1
3 Switch1(config)#exit
4 Switch1#vlan database
5 Switch1(vlan)#exit
6 Switch1#show vlan database
Step 15 :
The following figure shows that the preceding commands are successfully executed on the
layer 3 switch that you have added in GNS3.
Source
https://protechgurus.com/use-add-layer-3-switches-gns3/
Lab 01 : Connect 2 PCs
To create a new GNS3 topology, click the Browse End Devices button on the Devices Toolbar:
Drag and drop the VPCS node again into the GNS3 Workspace. In this example, another VPCS was
added to the GNS3 workspace (PC2):
topology. The mouse cursor will change to indicate that links can be added:
Click on PC1 in your topology to display available
Click the Show/Hide interface labels button on the GNS3 Toolbar to display interface labels in your
topology:
You are now ready to power on your network devices. Click the Start/Resume button on the GNS3
Toolbar to start up your network devices:
GNS3 indicates that the devices have been powered on
by turning the interface connectors from red to green. This can also be seen in the Topology
Summary:
Console connect to all devices button on the GNS3 Toolbar to open a connection to every device in
the topology:
A console connection is opened to every device in the topology.
gateways as follows (a default gateway is configured in this example but is not used):
PC1 should now be able to ping PC2 (use the key sequence Ctrl-C to stop the ping):
1 PC1> ping 10.1.1.2
2 84 bytes from 10.1.1.2 icmp_seq=1 ttl=64 time=0.098 ms
3 84 bytes from 10.1.1.2 icmp_seq=2 ttl=64 time=0.209 ms
4 84 bytes from 10.1.1.2 icmp_seq=3 ttl=64 time=0.197 ms
5 ^C
6 PC1>
1 PC1> save
2 Saving startup configuration to startup.vpc
3 . done
4 PC1>
5
6 PC2> save
7 Saving startup configuration to startup.vpc
8 . done
9 PC2>
Source
https://docs.gns3.com/1wr2j2jEfX6ihyzpXzC23wQ8ymHzID4K3Hn99-qqshfg/
Lab 02 : Configuring Ethernet and Serial
Interfaces
Topology Diagram
Objectives
Task 1
Task 2
Task 3
1 R1(config)#interface s1/0
2 R1(config-if)#ip address 10.0.0.1 255.255.255.252
3 R1(config-if)#no shut
4 R1(config-if)#description TO-WAN
Task 4
Configure a default route using the ISP WAN IP address as the next-hop IP address.
1 R1#show ip route
2 Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
3 D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
4 N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
5 E1 - OSPF external type 1, E2 - OSPF external type 2
6 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
7 ia - IS-IS inter area, * - candidate default, U - per-user static route
8 o - ODR, P - periodic downloaded static route
9
10 Gateway of last resort is 10.0.0.2 to network 0.0.0.0
11
12 10.0.0.0/30 is subnetted, 1 subnets
13 C 10.0.0.0 is directly connected, Serial1/0
14 C 192.168.1.0/24 is directly connected, FastEthernet0/0
15 S* 0.0.0.0/0 [1/0] via 10.0.0.2
16 R1#
Lab 03 : Basic switch setup
Objective
A new switch just purchased from Cisco contains no default configuration. You need to configure
the switch with setup mode or from scratch using the command line interface (CLI) before
connecting it in your network environment.
Network diagram
Lab instructions
This lab will test your ability to configure basic settings such as hostname, motd banner, encrypted
passwords, and terminal options on a Cisco Catalyst 2960 switch simulated in GNS3.
Task 1
vIOS-L2-01(config)#hostname LOCAL-SWITCH
Task 2
1 LOCAL-SWITCH(config)#banner motd #
2 Unauthorized access is forbidden#
Task 3
Configure the password for privileged mode access as "cisco". The password must be md5
encrypted
Task 4
Configure password encryption on the switch using the global configuration command
LOCAL-SWITCH(config)#service password-encryption
Task 5
1 LOCAL-SWITCH(config)#line con 0
2 LOCAL-SWITCH(config-line)#password ciscoconsole
3 LOCAL-SWITCH(config-line)#logging synchronous
4 LOCAL-SWITCH(config-line)#login
5 LOCAL-SWITCH(config-line)#history size 15
6 LOCAL-SWITCH(config-line)#exec-timeout 6 45
Task 6
1 LOCAL-SWITCH(config)#line vty 0 15
2 LOCAL-SWITCH(config-line)#exec-timeout 8 20
3 LOCAL-SWITCH(config-line)#password ciscotelnet
4 LOCAL-SWITCH(config-line)#logging synchronous
5 LOCAL-SWITCH(config-line)#login
6 LOCAL-SWITCH(config-line)#history size 15
Task 7
Objective
This lab will test your ability to configure the basic security settings of a Cisco ISR router and help
you to get ready for the router configuration simulation activities.
Network diagram
Lab instructions
The aim of this lab is to test your ability to perform a basic router setup.
Task 1
1 Router>enable
2 Router#configure terminal
3 Enter configuration commands, one per line. End with CNTL/Z.
4 Router(config)#hostname GATEWAY
Task 2
Task 3
GATEWAY(config)#service password-encryption
Task 4
1 GATEWAY(config)#line console 0
2 GATEWAY(config-line)#password cisco
3 GATEWAY(config-line)#login
4 GATEWAY(config-line)#logging synchronous
5 GATEWAY(config-line)#exec-timeout 2 45
6 GATEWAY(config-line)#history size 10
Lab 05: Connect Router to Cloud in GNS3
Sometimes, it is important to connect the routers to cloud in GNS3, especially when you plan to
perform lab exercises on a Laptop that is not connected to a network. There is a solution that allows
you to connect GNS3 routers to your local system using the loopback adapter.
Step 1 :
Open the Device Manager. To do so, type devmgmt.msc in the Run dialog box, and then press
Enter.
Step 2 :
In the Device Manager window, select and right-click your computer name and then select Add
legacy hardware as shown in the following figure.
Step 3 :
Step 4 :
On The wizard can help you install other hardware page, accept the default selection and click
Next.
Step 5 :
Navigate to the From the list below, select the type of hardware you are installing page and
then click Next.
Step 6 :
On the Select the device you want to install for this hardware page, select Microsoft under the
Manufacturer Select Microsoft KM-Test Loopback Adapter under the Model section, and then
click Next.
Step 7 :
Step 8 :
Step 9 :
Now, you have installed the loopback adapter on your local system. The next step is to
configure TCP/IP settings for the loopback adapter. For this, type ncpa.cpl in the Run and then
press Enter.
Step 10 :
On the Network Connections window, select and right-click the loopback adapter. Select
Properties to open its properties dialog box.
Step 11 :
On the Properties dialog box, select TCP/IPv4, and then click Properties.
Step 12 :
On the TCP/IPv4 Properties dialog box, configure the following TCP/IP settings:
1 IP address: 192.168.1.100
2 Subnet mask: 255.255.255.0
3 Default gateway: 192.168.1.1
Step 13 :
Click OK and then click Close to close the properties dialog box. Open Command Prompt, type
ping 192.168.1.100 and then press Enter.
It is highly recommended to reboot your local system.
Step 1 :
Step 2 :
Now, connect your router using the Fa0/0 interface to the cloud’s Ethernet, as shown in the
following figure. Here, you can choose your Ethernet adapter that you want to bind with GNS3
router. It may be either loopback or the physical network adapter.
Step 4 :
Start your router, open the console of R1 and configure 192.168.1.1/24 IP address on its Fa0/0
interface. To do so, execute the following commands:
1 R1(config)#interface fa0/0
2 R1(config-if)#ip add 192.168.1.1 255.255.255.0
3 R1(config-is)#no shut
4 R1(config-f)#exit
Step 5 :
Once you have configured the appropriate IP address, execute the ping 192.168.1.100
command to check the connectivity between R1 and local system using Cloud.
R1#ping 192.168.1.100
Objective
Lab Topology
Task 1:
R1 router
1 R1#configure terminal
2 R1(config)#interface s1/0
3 R1(config-if)#ip add 10.10.10.1 255.255.255.252
4 R1(config-if)#no shut
5 R1(config-if)#clock rate 64000
6 R1(config-if)#exit
7 R1(config)#interface loopback 0
8 R1(config-if)#ip address 172.168.0.1 255.255.0.0
9 R1(config-if)#no shut
10 R1(config-if)#exit
11 R1(config)#ip route 0.0.0.0 0.0.0.0 10.10.10.2
12 R1(config)#
R2 router
1 R2#configure terminal
2 R2(config)#interface s1/0
3 R2(config-if)#ip address 10.10.10.2 255.255.255.252
4 R2(config-if)#no shut
5 R2(config-if)#exit
6 R2(config)#interface loopback 0
7 R2(config-if)#ip address 192.168.0.1 255.255.255.0
8 R2(config-if)#exit
9 R2(config)#ip route 0.0.0.0 0.0.0.0 10.10.10.1
10 R2(config)#
Task 2:
R1(config)#line vty 0 4
Issue the following commands to configure the router to require the use of a login password for
remote access to R1:
1 R1(config-line)#login
2 % Login disabled on line 2, until 'password' is set
3 % Login disabled on line 3, until 'password' is set
4 % Login disabled on line 4, until 'password' is set
5 % Login disabled on line 5, until 'password' is set
6 % Login disabled on line 6, until 'password' is set
7 R1(config-line)#
Issue the following command to configure rahmati as the password that will be used to
authenticate the Telnet session:
R1(config-line)#password rahmati
From R2, issue the following commands to Telnet to R1’s Serial 1/0 interface:
1 R2#telnet 10.10.10.1
2 Trying 10.10.10.1 ... Open
3
4
5 User Access Verification
6
7 Password:rahmati
8 R1>
From R2, issue the following commands to Telnet to R1’s Loopback0 interface:
1 R2#telnet 172.168.0.1
2 Trying 172.168.0.1 ...
3 % Destination unreachable; gateway or host down
4
5 R2#telnet 172.16.0.1
6 Trying 172.16.0.1 ... Open
7
8 User Access Verification
9
10 Password:rahmati
11 R1>
Lab 07: Configure Static Route in GNS3
Static route tells the device exactly where to send traffic, no matter what.
Static route is often used when your network has only a few routers or there is only one route
from a source to a destination.
1. Scenario
Suppose that your company has 2 branches located in Tehran and Shiraz.
As the administrator of the network, you are tasked to connect them so that employees in the
two LANs can communicate with each other.
After careful consideration you decided to connect them via static route.
2. Physical Topology
3. Configuring interfaces on R1
1 R1#configure terminal
2 R1(config)#interface fastEthernet 0/0
3 R1(config-if)#ip address 192.168.1.1 255.255.255.0
4 R1(config-if)#no shut
5 R1(config-if)#exit
6 R1(config)#interface serial 1/0
7 R1(config-if)#ip address 10.0.0.1 255.255.255.252
8 R1(config-if)#no shut
9 R1(config-if)#clock rate 64000
4. Configuring interfaces on R2
1 R2#configure terminal
2 R2(config)#interface serial 1/0
3 R2(config-if)#ip address 10.0.0.2 255.255.255.252
4 R2(config-if)#no shut
5 R2(config-if)#exit
6 R2(config)#interface fastEthernet 0/0
7 R2(config-if)#ip address 172.16.0.1 255.255.0.0
8 R2(config-if)#no shut
9 R2(config-if)#exit
1 R1#show ip route
2
3 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
4 C 10.0.0.0/30 is directly connected, Serial1/0
5 L 10.0.0.1/32 is directly connected, Serial1/0
6 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
7 C 192.168.1.0/24 is directly connected, FastEthernet0/0
8 L 192.168.1.1/32 is directly connected, FastEthernet0/0
9 R1#
1 R2#show ip route
2
3 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
4 C 10.0.0.0/30 is directly connected, Serial1/0
5 L 10.0.0.2/32 is directly connected, Serial1/0
6 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
7 C 172.16.0.0/16 is directly connected, FastEthernet0/0
8 L 172.16.0.1/32 is directly connected, FastEthernet0/0
9 R2#
Source
http://www.9tut.com/configure-static-route-gns3-lab
Lab 08: Syslog Server for Cisco Router in GNS3
Monitoring the status of a device is really helpful, especially in troubleshooting the devices.
Almost all the networking devices such as PCs, Servers, Switches, and Routers, have their own
method to provide log information about the usage of devices.
Administrators use these logs to find the solutions to troubleshoot the issues caused by these
devices.
However, collecting and monitoring logs on each and every device might be a difficult job on a
network that have 100 of devices. To overcome this problem, you can use Syslog Server to
collect all the logs in a central location and then you can use these logs for the troubleshooting
devices.
Physical Topology
We will use the following topology to configure logging in Cisco IOS using GNS3. Router R1 is
connected to the local system using a Loopback interface.
Prerequisites
Once the installation of Kiwi Syslog Server is finished , next, you need to define the IP
addresses from which you want to receive the logs. To do so, in the Kiwi Syslog Server
console, click File and select Setup.
In the settings options, select Inputs, type 192.168.10.1 in the IP address box, click Add, and
then click OK. The following figure shows the settings options for Kiwi Syslog Server.
Now, your Syslog Server is ready to receive the logs. However, you may also need to disable the
firewall.
Configure Syslog Server in Cisco IOS
Open the console of R1 and execute the following commands to configure IP address on R1.
1 R1(config)#interface fa0/0
2 R1(config)-if#ip add 192.168.1.1 255.255.255.0
3 R1(config-if)#no shutdown
Next, use the logging host <syslog server IP address> command to specify the syslog server
address.
Next, make a loopback interface and shut it down and again no shut.
1 R1(config)#int loopback 0
2 R1(config-if)#shut
3 R1(config-if)#no shut
Next, move on to Kiwi Syslog Server console, and examine the output.
Source
https://protechgurus.com/configure-syslog-server-cisco-router-gns3/
Lab 09: DHCP configuration in GNS3
Objective
A DHCP server is used to automatically provide IP addresses to clients. In this lab, you will configure
a Dynamic Host Configuration Protocol (DHCP) server and two clients.
Lab Topology
IP Addresses
The IP addresses and subnet masks used in this lab are shown in the table below:
Device Interface IP Address Subnet Mask
Task 1:
On R1, issue the following commands to configure the router to respond to DHCP requests and
to enable the DHCP server process:
1 R1#configure terminal
2 R1(config)#service dhcp
Task 2:
On R1, issue the following command to add a range of IP addresses from 192.168.1.1 to
192.168.1.99 to the exclude list for all DHCP pools, which will prevent the DHCP server from
allocating those IP addresses to a DHCP client:
Task 3:
Task 4:
On R1, issue the following command to configure LANPOOL to assign IP addresses to DHCP
clients:
Task 5:
On R1, issue the following command to configure LANPOOL to lease each IP address for 2
days, which is equivalent to 48 hours:
The syntax of the lease command is lease {days [hours [minutes]], where days is an integer value
from 0 through 365, hours is an integer value from 0 through 23, and minutes is an integer value
from 0 through 59.
1 R1(dhcp-config)#lease ?
2 <0-365> Days
3 infinite Infinite lease
4
5 R1(dhcp-config)#lease 2
Task 6:
On R1, issue the following command to configure LANPOOL to use the IP address configured
on the FastEthernet 0/1 interface as the default gateway for DHCP clients from this pool:
R1(dhcp-config)#default-router 192.168.1.1
The default router is also known as the default gateway. A client directs a packet to its default
gateway if it does not have a direct route to the destination IP address in a packet’s header.
Task 7:
After you start the VPCS node you can connect to the console and issue the following
command:
1 PC1> dhcp
2 DORA IP 192.168.1.100/24 GW 192.168.1.1
3
4 PC1> show ip
5
6 NAME : PC1[1]
7 IP/MASK : 192.168.1.100/24
8 GATEWAY : 192.168.1.1
9 DNS :
10 DHCP SERVER : 192.168.1.1
11 DHCP LEASE : 172796, 172800/86400/151200
12 MAC : 00:50:79:66:68:00
13 LPORT : 10002
14 RHOST:PORT : 192.168.56.1:10003
15 MTU: : 1500
16
17 PC1>
Task 8:
Task 9:
Task 10:
On R1, issue the show ip dhcp server statistics command to examine a general summary of
each DHCP server’s operating statistics. The command output includes statistics about the
numbers of configured address pools, automatic and manual bindings, and types of DHCP
messages sent and received.
Task 11:
On R1, issue the show ip dhcp pool command to verify the address ranges of the configured
DHCP pools and their respective number of leased addresses. The output includes the number
of currently leased addresses, the IP address range of the pool, and the value of the IP address
that will be offered to the next client.
Objective
Network diagram.
Task 1
configure the interfaces on R1
1 R1#enable
2 R1#configure terminal
3 R1(config)#interface s1/1
4 R1(config-if)#ip address 10.1.1.2 255.255.255.252
5 R1(config-if)#no shut
6 R1(config-if)#clock rate 64000
7 R1(config-if)#exit
8 R1(config)#interface s1/2
9 R1(config-if)#ip add 10.2.2.2 255.255.255.252
10 R1(config-if)#no shut
11 R1(config-if)#clock rate 64000
12 R1(config-if)#exit
13 R1(config)#interface loopback 0
14 R1(config-if)#ip address 209.165.200.225 255.255.255.248
Task 2
1 R2#enable
2 R2#configure terminal
3 R2(config)#interface s1/0
4 R2(config-if)#ip add 10.1.1.1 255.255.255.252
5 R2(config-if)#no shut
6 R2(config-if)#exit
7 R2(config)#interface fastEthernet 0/0
8 R2(config-if)#ip address 192.168.10.1 255.255.255.0
9 R2(config-if)#no shut
Task 3
1 R3#enable
2 R3#configure terminal
3 R3(config)#interface s1/0
4 R3(config-if)#ip address 10.2.2.1 255.255.255.252
5 R3(config-if)#no shut
6 R3(config-if)#exit
7 R3(config)#interface fastEthernet 0/0
8 R3(config-if)#ip address 192.168.30.1 255.255.255.0
9 R3(config-if)#no shut
Task 4
Now that all devices are connected we can start by configuring OSPF (so that each router
knows about each other network). (On the R1 we are going to use the process ID of 1)
1 R1(config)#router ospf 1
2 R1(config-router)#network 10.1.1.0 0.0.0.3 area 0
3 R1(config-router)#network 10.2.2.0 0.0.0.3 area 0
4 R1(config-router)#network 209.165.200.224 0.0.0.31 area 0
Task 5
1 R2(config)#router ospf 1
2 R2(config-router)#network 192.168.10.0 0.0.0.255 area 0
3 R2(config-router)#network 10.1.1.0 0.0.0.3 area 0
Task 6
The last router (R3) is ready to be configured with OSPF (Again remember to use the process ID
of 1)
1 R3(config)#router ospf 1
2 R3(config-router)#network 10.2.2.0 0.0.0.3 area 0
3 R3(config-router)#network 192.168.30.0 0.0.0.255 area 0
Task 7
With OSPF setup you want to verify that you have full network connectivity (Every device should
be able to ping each other) This is R1’s output of the command show ip route.
1 R1#show ip route
2 Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
3 D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
4 N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
5 E1 - OSPF external type 1, E2 - OSPF external type 2
6 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
7 ia - IS-IS inter area, * - candidate default, U - per-user static route
8 o - ODR, P - periodic downloaded static route
9
10 Gateway of last resort is not set
11
12 O 192.168.30.0/24 [110/65] via 10.2.2.1, 00:00:31, Serial1/2
13 O 192.168.10.0/24 [110/65] via 10.1.1.1, 00:00:31, Serial1/1
14 209.165.200.0/29 is subnetted, 1 subnets
15 C 209.165.200.224 is directly connected, Loopback0
16 10.0.0.0/30 is subnetted, 2 subnets
17 C 10.2.2.0 is directly connected, Serial1/2
18 C 10.1.1.0 is directly connected, Serial1/1
19 R1#
Task 8
This output of R2 when issuing the command show ip route also R2.
1 R2#show ip route
2 Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
3 D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
4 N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
5 E1 - OSPF external type 1, E2 - OSPF external type 2
6 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
7 ia - IS-IS inter area, * - candidate default, U - per-user static route
8 o - ODR, P - periodic downloaded static route
9
10 Gateway of last resort is not set
11
12 O 192.168.30.0/24 [110/129] via 10.1.1.2, 00:01:08, Serial1/0
13 C 192.168.10.0/24 is directly connected, FastEthernet0/0
14 209.165.200.0/32 is subnetted, 1 subnets
15 O 209.165.200.225 [110/65] via 10.1.1.2, 00:01:08, Serial1/0
16 10.0.0.0/30 is subnetted, 2 subnets
17 O 10.2.2.0 [110/128] via 10.1.1.2, 00:01:08, Serial1/0
18 C 10.1.1.0 is directly connected, Serial1/0
19 R2#
Task 9
This output of R3 when issuing the command show ip route also R3.
1 R3#show ip route
2 Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
3 D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
4 N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
5 E1 - OSPF external type 1, E2 - OSPF external type 2
6 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
7 ia - IS-IS inter area, * - candidate default, U - per-user static route
8 o - ODR, P - periodic downloaded static route
9
10 Gateway of last resort is not set
11
12 C 192.168.30.0/24 is directly connected, FastEthernet0/0
13 O 192.168.10.0/24 [110/129] via 10.2.2.2, 00:01:33, Serial1/0
14 209.165.200.0/32 is subnetted, 1 subnets
15 O 209.165.200.225 [110/65] via 10.2.2.2, 00:01:33, Serial1/0
16 10.0.0.0/30 is subnetted, 2 subnets
17 C 10.2.2.0 is directly connected, Serial1/0
18 O 10.1.1.0 [110/128] via 10.2.2.2, 00:01:33, Serial1/0
19 R3#
Task 10
Type the command show interface serial1/1 in R1 notice in the output the encapsulation type,
which is HDLC.
Notice how OSPF is going down because of the different encapsulation. R2 is still running
HDLC, therefore, the link is down.
1 R1(config-if)#
2 *Mar 1 00:22:40.431: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.10.1 on Serial1/1
3 R1(config-if)#
4 *Mar 1 00:22:43.419: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/
Change R2 to the proper encapsulation type so communication between the routers are again
connected and to get OSPF working again.
1 R2(config)#interface serial1/0
2 R2(config-if)#encapsulation ppp
This example on R2 notice that once the encapsulation was changed to PPP the link went back
up and OSPF found an adjacent neighbor.
1 R2(config-if)#
2 *Mar 1 00:24:43.471: %OSPF-5-ADJCHG: Process 1, Nbr 209.165.200.225 on Serial
3 R2(config-if)#
4 *Mar 1 00:24:46.087: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/
5 R2(config-if)#
Task 11
Now we can also give the encapsulation protocol (PPP) some authentication.
To set up PAP the username and password must match the other router. So for this example,
R1’s username is R1 and the password is knowing.
Task 12
Topology
Objectives
Task 1
Task 2
1 R1#configure terminal
2 R1(config)#interface fastEthernet 0/0
3 R1(config-if)#ip address 172.16.99.1 255.255.255.0
4 R1(config-if)#no shut
5 R1(config-if)#exit
6 R1(config)#enable secret class
7 R1(config)#line vty 0 4
8 R1(config-line)#password cisco
9 R1(config-line)#login
10 R1(config-line)#exit
11 R1(config)#line console 0
12 R1(config-line)#password cisco
13 R1(config-line)#login
14 R1(config-line)#exit
15 R1(config)#service password-encryption
16 R1(config)#exit
17 R1#write memory
18 Building configuration...
19 [OK]
20 R1#
Task 3
1 ESW1#configure terminal
2 ESW1(config)#hostname SWLAN
3 SWLAN(config)#ip domain-name KELASPAR
4 SWLAN(config)#username yaser privilege 15 secret rahmati
5 SWLAN(config)#line vty 0 15
6 SWLAN(config-line)#transport input ssh
7 SWLAN(config-line)#login local
8 SWLAN(config-line)#exit
9 SWLAN(config)#crypto key generate rsa
10 The name for the keys will be: SWLAN.KELASPAR
11 Choose the size of the key modulus in the range of 360 to 2048 for your
12 General Purpose Keys. Choosing a key modulus greater than 512 may take
13 a few minutes.
14
15 How many bits in the modulus [512]: 1024
16 % Generating 1024 bit RSA keys, keys will be non-exportable...[OK]
17
18 SWLAN(config)#
19 *Mar 1 00:02:08.147: %SSH-5-ENABLED: SSH 1.99 has been enabled
20 SWLAN(config)#
Task 4
1 SWLAN#show ip ssh
2 SSH Enabled - version 1.99
3 Authentication timeout: 120 secs; Authentication retries: 3
1.99
Task 5
1 SWLAN#configure terminal
2 SWLAN(config)#vlan 99
3 SWLAN(config-vlan)#name management
4 SWLAN(config-vlan)#exit
5 SWLAN(config)#
Task 6
Configure the VLAN 99 management interface IP address and enable the interface.
1 SWLAN(config)#interface vlan 99
2 SWLAN(config-if)#ip address 172.16.99.11 255.255.255.0
3 SWLAN(config-if)#no shutdown
4 SWLAN(config-if)#end
5 SWLAN#
Task 7
1 SWLAN#vlan database
2 % Warning: It is recommended to configure VLAN from config mode,
3 as VLAN database mode is being deprecated. Please consult user
4 documentation for configuring VTP/VLAN in config mode.
5
6 SWLAN(vlan)#show
7 VLAN ISL Id: 1
8 Name: default
9 Media Type: Ethernet
10 VLAN 802.10 Id: 100001
11 State: Operational
12 MTU: 1500
13 Translational Bridged VLAN: 1002
14 Translational Bridged VLAN: 1003
15
16 VLAN ISL Id: 99
17 Name: management
18 Media Type: Ethernet
19 VLAN 802.10 Id: 100099
20 State: Operational
21 MTU: 1500
22
23 VLAN ISL Id: 1002
24 Name: fddi-default
25 Media Type: FDDI
26 VLAN 802.10 Id: 101002
27 State: Operational
28 MTU: 1500
29 Bridge Type: SRB
30 Translational Bridged VLAN: 1
31 Translational Bridged VLAN: 1003
32
33 VLAN ISL Id: 1003
34 Name: token-ring-default
35 Media Type: Token Ring
36 VLAN 802.10 Id: 101003
37 State: Operational
38 MTU: 1500
39 Bridge Type: SRB
40 Ring Number: 0
41 Bridge Number: 1
42 Parent VLAN: 1005
43 Maximum ARE Hop Count: 7
44 Maximum STE Hop Count: 7
45 Backup CRF Mode: Disabled
46 Translational Bridged VLAN: 1
47 Translational Bridged VLAN: 1002
48
49 VLAN ISL Id: 1004
50 Name: fddinet-default
51 Media Type: FDDI Net
52 VLAN 802.10 Id: 101004
53 State: Operational
54 MTU: 1500
55 Bridge Type: SRB
56 Bridge Number: 1
57 STP Type: IBM
58
59 VLAN ISL Id: 1005
60 Name: trnet-default
61 Media Type: Token Ring Net
62 VLAN 802.10 Id: 101005
63 State: Operational
64 MTU: 1500
65 Bridge Type: SRB
66 Bridge Number: 1
67 STP Type: IBM
68
69 SWLAN(vlan)#
Task 8
Question 2: Why is the protocol down, even though you issued the no shutdown command for
interface VLAN 99?
Topology
Objectives