In order to perform the lab exercises that require switches in GNS3, first, you need to add and configure switches in GNS3. There are three options to simulate switching in GNS3.
- Use an Ethernet Switch in GNS3.
- Add a Layer 2 Switch in GNS3.
- Add a Layer 3 Switch in GNS3.
Ethernet switches are included in the GNS3 console, by default. However, you cannot take console of or configure an Ethernet switch in GNS3 that is added by default. An Ethernet switch in GNS3 provides just the basic connectivity option, nothing else. So, it cannot be used to perform VLAN, VTP, STP lab exercises. If you are looking for switching emulation that can be used to perform VLAN, VTP, InterVLAN routing functions, you have to use a layer 3 switch.
- You may also like: How to Add Layer 3 Switches in GNS3
In this post, we will focus on how to add and use switches in GNS3 (especially layer 2 switches). For this, you need to add a Qemu VM in GNS3 that will act as a Layer 2 switch. This switch can be used to perform VLAN, VTP, STP, and other switch-based lab exercises. Since it is a simulated method, it may not support all of the features provided by the traditional physical switches.
Switching Simulation in GNS3
To add and configure switches in GNS3 (Switching Simulation), you need to perform the following steps:
- Download and extract the IOSv-L2 VMDK image file. [Image Credit: Nathanash]
- Once you have downloaded the VMDK file, open the Preferences window in GNS3 by navigating Edit and Preferences in the GNS3 console.
- Select Qemu VMs in the left pane and then click New to add a new Qemu VM template.
- On the QEMU VM Type page, select IOSv-l2 in from the Type drop-down list and then click Next.
- On the QEMU VM name page, specify a name for this Qemu VM in the Name text box. Click Next to proceed.
- 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.
- 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.
- Drag the recently added switch in the work view area and start the switch.
- 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.
Now, start to perform switching labs in GNS3. We hope, you have loved and enjoyed it.