Place your GNS3 router as below, i use Cisco 3640 with additional slot NM-16ESW to act as a layer 3 switch
port 12 access port for vlan 200
port 13 trunk, dot1q encapsulation
create vlan 100 and 200 on router
Router>en
Router#vlan da
Router(vlan)#vla 100
repeat the same to create vlan 200
enable inter vlan routing
Router(config)#ip routing
Router(config)#
configure the vlan interface(routed interface for that vlan), vlan 1 is for management
interface Vlan1
ip address 172.16.1.1 255.255.255.0
!
interface Vlan100
ip address 192.168.100.1 255.255.255.0
!
interface Vlan200
ip address 192.168.200.1 255.255.255.0
*always remember to no shutdown on interface, by default, like router, the interface is shutdown, unlike switch. Once the interface is up, trunk will work then the int vlan will be up
Router(config)#int fa 0/1
Router(config-if)#switchport trun encap dot1 //set the encapsulation
Router(config-if)#switchport mo trunk //set to trunk unconditionally
Now you should be able to ping from host on vlan 100 and 200 to the 192.168.100.1 and 192.168.200.1
VPCS 2 >ping 192.168.100.1
192.168.100.1 icmp_seq=1 time=5.188 ms
192.168.100.1 icmp_seq=2 time=3.645 ms
192.168.100.1 icmp_seq=3 time=3.547 ms
192.168.100.1 icmp_seq=4 time=20.745 ms
192.168.100.1 icmp_seq=5 time=34.342 ms
VPCS 2 >ping 192.168.200.1
192.168.200.1 icmp_seq=1 time=3.296 ms
192.168.200.1 icmp_seq=2 time=12.255 ms
192.168.200.1 icmp_seq=3 time=4.190 ms
192.168.200.1 icmp_seq=4 time=2.341 ms
192.168.200.1 icmp_seq=5 time=17.070 ms
you can use this command to check on the CEF status
show ip int vlan 100
Router#sh ip int vlan 100
Vlan100 is up, line protocol is up
Internet address is 192.168.100.1/24
Broadcast address is 255.255.255.255
Address determined by non-volatile memory
MTU is 1500 bytes
Helper address is not set
Directed broadcast forwarding is disabled
Outgoing access list is not set
Inbound access list is not set
Proxy ARP is enabled
Local Proxy ARP is disabled
Security level is default
Split horizon is enabled
ICMP redirects are always sent
ICMP unreachables are always sent
ICMP mask replies are never sent
IP fast switching is enabled
IP fast switching on the same interface is disabled
IP Flow switching is disabled
IP CEF switching is enabled
IP CEF Fast switching turbo vector
IP multicast fast switching is enabled
IP multicast distributed fast switching is disabled
IP route-cache flags are Fast, CEF
Router Discovery is disabled
IP output packet accounting is disabled
IP access violation accounting is disabled
TCP/IP header compression is disabled
RTP/IP header compression is disabled
Policy routing is disabled
Network address translation is disabled
BGP Policy Mapping is disabled
WCCP Redirect outbound is disabled
WCCP Redirect inbound is disabled
WCCP Redirect exclude is disabled
sh ip route to show all the connected subnet
running config for router
Router#sh run
Building configuration...
Current configuration : 1064 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
!
interface FastEthernet0/1
switchport mode trunk
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
ip address 172.16.1.1 255.255.255.0
!
interface Vlan100
ip address 192.168.100.1 255.255.255.0
!
interface Vlan200
ip address 192.168.200.1 255.255.255.0
!
ip http server
no ip http secure-server
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
login
!
!
end
show ip int vlan 100
Router#sh ip int vlan 100
Vlan100 is up, line protocol is up
Internet address is 192.168.100.1/24
Broadcast address is 255.255.255.255
Address determined by non-volatile memory
MTU is 1500 bytes
Helper address is not set
Directed broadcast forwarding is disabled
Outgoing access list is not set
Inbound access list is not set
Proxy ARP is enabled
Local Proxy ARP is disabled
Security level is default
Split horizon is enabled
ICMP redirects are always sent
ICMP unreachables are always sent
ICMP mask replies are never sent
IP fast switching is enabled
IP fast switching on the same interface is disabled
IP Flow switching is disabled
IP CEF switching is enabled
IP CEF Fast switching turbo vector
IP multicast fast switching is enabled
IP multicast distributed fast switching is disabled
IP route-cache flags are Fast, CEF
Router Discovery is disabled
IP output packet accounting is disabled
IP access violation accounting is disabled
TCP/IP header compression is disabled
RTP/IP header compression is disabled
Policy routing is disabled
Network address translation is disabled
BGP Policy Mapping is disabled
WCCP Redirect outbound is disabled
WCCP Redirect inbound is disabled
WCCP Redirect exclude is disabled
show ip cef summary
show ip cef
sh ip route to show all the connected subnet
running config for router
Router#sh run
Building configuration...
Current configuration : 1064 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
!
interface FastEthernet0/1
switchport mode trunk
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
ip address 172.16.1.1 255.255.255.0
!
interface Vlan100
ip address 192.168.100.1 255.255.255.0
!
interface Vlan200
ip address 192.168.200.1 255.255.255.0
!
ip http server
no ip http secure-server
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
login
!
!
end
Thanks man..
ReplyDeletewill try this soon
vipul
hi, I am not very familiar with vlans & inter vlan, i have already config my switch with 2 vlans & segregated them into 2 for 2 vlans leaving port 48 as the trunk port, now i have a firewall from where i have a subnet 10.10.10.x, on the switch which is 3560G i created 2 vlans.. vlan 1 & vlan 10... vlan 1 holds an ip 10.10.10.254 vlan 10 172.16.16.x i added a route on the firewall so the 172.16.16.x can have internet & enabled ip routing so 172.16.16.x can access the servers on 10.10.10.x, now my problem here is any user on vlan 10 the internet is slow but if i put them on vlan 1 is runs smooth, user on vlan 10 i have an other switch connected a normal dlink giga switch since i have 2 floors & linksys access points, the only way i achieved a stable speed on vlan 10 was making the access mode to desktop via the http.. well i hope i have kept it as simple as possible.. plz let me know if theres any thing else that i need to do.
ReplyDeletei m using svi interface on gns3 switch but when i ping from router it give me the message encapsultion mismatch.plz tell me the problem
ReplyDeletethis i awsome.. thank you very much you rock
ReplyDeletefaiq try this.. good luck
ReplyDelete(config-if)#switchport trunk encapsulation dot1q
This worked very well, I had to remember to configure the default gw's on my qemu boxes, but after that it worked without a hitch
ReplyDeletei can ping to VLANs from PC but cannot ping two PCs of different vlans
ReplyDelete