Pages

Main Menu

Pages

Pages

Monday, 14 July 2014

cara Setting switch dan router cisco

How to use switch in gns3 | switching labs in gns3

-->Sorry bro bro... belum di translet, gampar kalau ndak ngerti tanya om google dah :)


In this article i will show you how to use Cisco switch in gns3. In gns3 "device panel" or "node panel" of gns3 you  could not find any layer2 or layer3 Cisco switch, there is no direct way to use Cisco 2900 or 3800 series switches in gns3. But there is a way by which you can use your router as switch by using NM-16ESW module in router. In this way you can configure switching protocols like VLAN, STP, VTP ect.

Please note that these configuration steps are tested on "gns3 virtualbox edition 0.8.1" but if you are using the latest version of GNS3 you can start using switch/switing protocols on GNS3 by using 3600 series router IOS with NM-16ESW module. 
  • First open the "Symbol Manger" from Edit tab.
  • Add a ethernet_switch from  available symbol to customize nodes. Type a name for switch and in Type field assign the Cisco router IOS to switch, in my case i select the  c3600 series and i use the IOS c3640-jk9o3s-mz.124-16a (33MB). You can download switch IOS for GNS3 from this link.

  • Click on apply and then on ok button.
  • Now you can find a new switch in nodes types.

  • Now drag this switch on stage and click on configuration and add  NM-16ESW module from slot tap.

  • click on OK you may received a message "You must use 'manual mode' to connect a link with a NM-16ESW module". Therefore use the manual method to configure this.
Switching labs in gns3 
Now for test i shall configure two vlan on switch. For Vlan configuration you can use the following commands.
vlan database
vlan 10
vlan 20
 

  • Start your switch and try these commands also can see in screen-shot for vlan 10, 20.
For complete switching labs visit following posts of blog.   
--------------------lanjutan di bawah broooo

Inter vlan routing on gns3 | Router on stick configuration






Network devices in different VLANs cannot communicate with one another without a router to route traffic between the VLANs. In most network environments, VLANs are associated with individual networks or subnetworks. There are two ways to communicate different VLANs with each other.
  1. Inter vlan 
  2. Switch virtual interface SVI 

How inter VLAN works: 

Inter VLAN communicate different VLANs via sub interfaces that we have create on router for each VLANs. When Host A in VLAN 10 needs to communicate with Host B in VLAN 10, it sends a packet addressed to that host. Switch A forwards the packet directly to Host B, without sending it to the router.
When Host A in VLAN 10 sends a packet to Host B in VLAN 20, Switch forwards the packet to the router, which receives the traffic on the VLAN 10 interface sub interface and forwards this to sub interface for VLAN 20.
To implement interVLAN on gns3 I use the follow simple topology. In which R1 have two sub interfaces int f0/0.10 and int f0/0.20 for VLANs 10 and 20 respectively. And we use only two PC, one belong to VLAN 10 and other to 20.   

 
Configuration for Router R1:

R2(config)#interface f0/0
R2(config-if)#no shutdown
R2(config-subif)#interface f0/0.20
R2(config-subif)#encapsulation dot1Q 20
R2(config-subif)#ip address 20.1.1.1 255.255.255.0
R2(config-subif)#interface f0/0.10
R2(config-subif)#encapsulation dot1Q 10
R2(config-subif)#ip address 10.1.1.1 255.255.255.0

Configuration for Switch:

SW#vlan database
SW(vlan)#vlan 10 name office1
SW(vlan)#vlan 20 name office2
SW(vlan)#exit
SW(config)#interface f1/0
SW(config-if)#no shutdown
SW(config-if)#switchport mode trunk
SW(config-if)#interface f0/0
SW(config-if)#no shutdown
SW(config-if)# switchport mode access
SW(config-if)# switchport access vlan 10
SW(config-if)#interface f0/1
SW(config-if)#no shutdown
SW(config-if)#switchport mode access
SW(config-if)# switchport access vlan 20



Configuration for Qemu1

tc@box:$ sudo su 
root@box:$ Ifconfig eth0 10.1.1.2 netmask 255.255.255.0
root@box:$ Route add default gw 10.1.1.1 eth0

Configuration for Qemu2

tc@box:$ sudo su 
root@box:$ Ifconfig eth0 20.1.1.2 netmask 255.255.255.0
root@box:$ Route add default gw 20.1.1.1 eth0

Results:
Ping from qemu1 to qemu2 is successful and voice versa


-------------------------- lanjutan di bawah lagi

Switch virtual interface SVI configuration on gns3






A switch virtual interface (SVI) is a VLAN of switch ports represented by one interface to a routing or bridging system. There is no physical interface for the VLAN and the SVI provides the Layer 3 processing for packets from all switch ports associated with the VLAN.

How Switch virtual interface SVI  works:

This is much simpler than inter VLAN, but disadvantage is high cost of a layer-3 switch.
In SVI configuration we need a layer-3 switch, I use a3640 router IOS and use the NM-16ESW module for layer-3 switching. The topology I used for switch virtual interface (SVI) is consist of one switch and two hosts one of them is in VLAN 10 and other is in VLAN 20. I have create two switch virtual interface s(SVI) on switch for VLAN 10 and 20, which are responsible for communicating these two VLANs.

 
Configuration for Switch:
SW#vlan database
SW(vlan)#vlan 10 name office1
SW(vlan)#vlan 20 name office2
SW(vlan)#exit
SW(config-if)#interface vlan 10
SW(config-if)#ip address 10.1.1.1 255.255.255.0
SW(config-if)#no shu
SW(config-if)#interface vlan 20
SW(config-if)#ip address 20.1.1.1 255.255.255.0
SW(config-if)#exit
SW(config)#ip routing
SW(config-if)#interface f0/0
SW(config-if)#no shutdown
SW(config-if)# switchport mode access
SW(config-if)# switchport access vlan 10
SW(config-if)#interface f0/1
SW(config-if)#no shutdown
SW(config-if)#switchport mode access
SW(config-if)# switchport access vlan 20

Configuration for Qemu1
tc@box:$ sudo su 
root@box:$ Ifconfig eth0 10.1.1.2 netmask 255.255.255.0
root@box:$ Route add default gw 10.1.1.1 eth0

Configuration for Qemu2
tc@box:$ sudo su 
root@box:$ Ifconfig eth0 20.1.1.2 netmask 255.255.255.0
root@box:$ Route add default gw 20.1.1.1 eth0

Results:
Ping from qemu1 to qemu2 is successful and voice versa.

No comments:

Post a Comment