Responsive image

Network Experience

Configuring Router-on-a stick InterVLAN Routing, VTP and DHCP

هناك تعليق واحد
Hey guys .. Well, i am so exited for this topic actually here we will do LAN configuration  where we will use multiple vlan's, advertise them through vtp(VLAN TRUNKING PROTOCOL), and we will route vlan data across vlan's using Router-on-a Stick configuration , end users will be assigned IP by DHCP 

WOW ... can you feel it , let's jump in

I am using GNS3 network emulator 

Network component 

One router . c3725

Two switch's ... Yeah, I know alot have told you there is no switching capabilities in GNS3. ope there is .. and guess what it's not a router with EtherSwitch port's, nope it's called L2 - IOU . It's IOS on UNIX it will provide you not only with switching capabilities on layer 2 but also it support L3 switching capabilities , using this you will be able to do most of switching stuff, not all ! but most of/

so i am using L2 IOU switch

and 4 VPCS Virtual PC Simulator  

Note that  distribution of IOU and IOS is strictly prohibited. Please don’t ask me! Google always will be your friend 



First Switch 1 Configuration 


First Switch 2 Configuration 


Router Configuration



We are done with the switches and router lets test it but trying to assign the VPCS ip through DHCP




WoW its working and we are up 

let's try some ping's from vlan10 to vlan 10 and vlan 10 to vlan 20 and vlan to gateway ping 



Show it your self 

you can use some show commands to verify your work 

for switch
show ip interface brief | inc Vlan
show interface switchport
show interface trunk
show vlan brief
show vtp status

for router 
show ip interface brief | exc down
show running-config | sec dhcp

so much fun , was it ??
try it your self replace VPCS with router with no ip routing to do telneting have fun ...

at last lets review our work 

we done configuration for two switch's the vtp server switch do the vlan work and just advertise their vlan configuration to the other switch 

router's interface configured as router in stick with subinterface's  to match the vlan tag   
then we configured two DHCP pools for both vlan's exit

Here is the code if you want to copy paste

switch 1

! Basic configuration
configure terminal
hostname cisco_switch1
enable secret cisco
line console 0
password cisco123
logging synchronous
no exec-timeout
no domain-lookup
exit
line vty 0 4
password ciscotelnet
login
exit

! configure vlan's

interface vlan10
ip address 192.168.10.2 255.255.255.0
no shutdown
exit

interface vlan20
ip address 192.168.20.2 255.255.255.0
no shutdown
exit

! Setup VTP
! vtp is mode server by defualt
vtp domain cisco

! Configure switchport interfaces

interface e0/1
switchport mode access
switchport access vlan 10
duplex full
exit
interface e0/2
switchport mode access
switchport access vlan 20
duplex full
exit

! Configure trunk inerfaces

interface e0/0
switchport trunk encapsulation dot1q
switchport mode trunk
duplex full
exit
interface e0/3
switchport trunk encapsulation dot1q
switchport mode trunk
duplex full
end

! We are done and now lets save out configuration
copy running-config startup-config


---------------------------------

switch 2

! Basic Configuration
configure terminal
hostname cisco_switch2
enable secret cisco
line console 0
password cisco123
logging synchronous
no exec-timeout
no domain-lookup
exit
line vty 0 4
password ciscotelnet
login
exit

! Set up VTP
! here we will set vtp mode to client

vtp domain cisco
vtp mode client

! Configure switchport interfaces
interface e0/1
switchport mode access
switchport access vlan 10
duplex full
exit
interface e0/2
switchport mode access
switchport access vlan 20
duplex full
exit

! Configure Trunk interfaces
interface e0/0
switchport trunk encapsulation dot1q
switchport mode trunk
duplex full
end

! We are done and now lets save out configuration
copy running-config startup-config

---------------------------------------------------------------------------------------------
Router

! Basic Configuration

configure terminal
hostname cisco_router
enable secret cisco
line console 0
password cisco123
logging synchronous
no exec-timeout
no domain-lookup
exit
line vty 0 4
password ciscotelnet
login
exit

! Configure Router subinterfaces

interface fastEthernet 0/0
no shutdown
exit
int fa0/0.10
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0
exit
interface fastEthernet 0/0.20
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0
exit

! Configure DHCP setting

ip dhcp excluded-address 192.168.10.1 192.168.10.10
ip dhcp excluded-address 192.168.20.1 192.168.20.10
ip dhcp pool vlan10
network 192.168.10.0 /24
default-router 192.168.10.1
dns-server 8.8.8.8
exit
ip dhcp pool vlan20
network 192.168.20.0 /24
default-router 192.168.20.1
dns-server 8.8.8.8
end

! We are done and now lets save out configuration
copy running-config startup-config

-----------------------------------------------


wish it was fun 
At the end I wish I have delivered good information to you and i would thank you for reading this article 

هناك تعليق واحد :

  1. “Benjamin Briel Lee was very professional at all times, keeping me aware of everything that was happening, If I had any questions he was always available to answer. This was my first home purchase, I didn’t know much about the loan process, he made it very easy to understand the things I had questions about. I really enjoyed working with him.”  
    He's a loan officer working with a group of investor's who are willing to fund any project or loan you any amount with a very low interest.Contact Benjamin Briel Lee E-Mail: lfdsloans@outlook.com  Whats-App Number: +1-989-394-3740.

    ردحذف