cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1014
Views
0
Helpful
6
Replies

VLAN Issue

mjaved_khan
Level 1
Level 1

Hi,

I have configured my Cisco switch for simple VLAN, if I put Cisco switch VLAN1 IP address on my computer's default gateway then I am not able to ping Cisco switch or router. From switch, I am also not able to ping PC but able to ping router. Is there anything wrong in configuration?

10.0.12.254 is Cisco router's LAN interface.

Below is Cisco switch configuratin:

LAB#sh run
Nov 17 10:31:00.700: %SYS-5-CONFIG_I: Configured from console by console
Building configuration...

Current configuration : 6628 bytes
!
! Last configuration change at 10:31:00 UTC Tue Nov 17 2015
! NVRAM config last updated at 09:30:07 UTC Tue Nov 17 2015
!
version 15.0
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname LAB
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
switch 1 provision ws-c2960x-48fps-l
!
!
!
!
crypto pki trustpoint TP-self-signed-3848481024
 enrollment selfsigned
 subject-name cn=IOS-Self-Signed-Certificate-3848481024
 revocation-check none
 rsakeypair TP-self-signed-3848481024
!
!
crypto pki certificate chain TP-self-signed-3848481024
 certificate self-signed 01
  3082022B 30820194 A0030201 02020101 300D0609 2A864886 F70D0101 05050030
  31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274
  69666963 6174652D 33383438 34383130 3234301E 170D3135 31313137 30383338
  32325A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649
  4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D33 38343834
  38313032 3430819F 300D0609 2A864886 F70D0101 01050003 818D0030 81890281
  8100C24B 3453B7AF BB253EE3 AF46206C 3A01E8A0 622CD5AF 1BEB48DC 3FC6EBEF
  8F27DB71 1499CD5E BC913FC2 DB70E4D2 4BDC3337 97FD10FF AD118D11 51662FFF
  F429BB3A 78473EA6 B2BA7A40 8DFC9E09 2AE0C55E D0DB0483 4C698D16 F90789B7
  BA9E19BB A74CBB8B 7564ED1F 695B3EC5 CDF2AC00 A4F4B4F6 EC1A7F2F 08F00781
  31CF0203 010001A3 53305130 0F060355 1D130101 FF040530 030101FF 301F0603
  551D2304 18301680 14550FDA 6E8B7D42 A8368C92 A38C528F B37746F7 51301D06
  03551D0E 04160414 550FDA6E 8B7D42A8 368C92A3 8C528FB3 7746F751 300D0609
  2A864886 F70D0101 05050003 8181009B C43B0C8F F26EA758 176C8AF3 70EBF0DE
  7CE8460A 833FE3DC A8DA3A97 37AE7BAF 21EF06C4 65E256D3 BAC46138 8CFD6EB9
  829A8465 DFDB5E0A BF4DF18B 7C35C5F8 C7D4BE9F 67FE2989 3452D84A A783DE9C
  61E83B73 02CE937F 8ECB97C1 2F7B5CAC F5CD4F2D 3D2C0C04 21F3ADB3 146A9F4E
  470662A8 DF191CE6 077A62D5 574CE8
        quit
spanning-tree mode pvst
spanning-tree extend system-id
!
!
!
!
!
!
vlan internal allocation policy ascending
!
!
!
!
!
!
interface FastEthernet0
 no ip address
 no ip route-cache
 shutdown
!
interface GigabitEthernet1/0/1
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/2
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/3
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/4
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/5
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/6
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/7
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/8
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/9
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/10
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/11
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/12
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/13
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/14
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/15
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/16
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/17
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/18
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/19
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/20
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/21
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/22
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/23
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/24
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/25
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/26
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/27
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/28
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/29
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/30
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/31
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/32
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/33
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/34
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/35
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/36
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/37
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/38
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/39
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/40
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/41
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/42
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/43
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/44
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/45
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/46
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/47
 switchport access vlan 120
 switchport mode access
!
interface GigabitEthernet1/0/48
 description CONNECTED TO MPLS ROUTER Port G0/1
 switchport mode access
!
interface GigabitEthernet1/0/49
!
interface GigabitEthernet1/0/50
!
interface GigabitEthernet1/0/51
!
interface GigabitEthernet1/0/52
!
interface Vlan1
 ip address 10.0.12.1 255.255.255.0
 no ip route-cache
!
ip http server
ip http secure-server
!
ip route 0.0.0.0 0.0.0.0 10.0.12.254
!
!
line con 0
line vty 0 4
 login
line vty 5 15
 login
!
end

LAB#

2 Accepted Solutions

Accepted Solutions

You need to have both VLANs,

interface Vlan1

Des to-router
 ip address 10.0.12.1 255.255.255.0

interface Vlan120
Des to client
 ip address 10.0.13.1 255.255.255.0

ip route 0.0.0.0 0.0.0.0 10.0.12.254

2- On router, you need to configure a return route toward switch. The ip address of 10.0.12.254 must be set on the main router interface.

Ip route 10.0.13.0 255.255.255.0 10.0.12.1  [ this is on router]

3- Set the ip of PC 10.0.13.2 255.255.255.0

4- Set the gateway of PC 10.0.13.1

View solution in original post

Hello

To route between these subnets there neesds to be a routing device  (ether on the switch or router) with l3 interfaces for each vlan


res
Paul


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

View solution in original post

6 Replies 6

mjaved_khan
Level 1
Level 1

I removed IP address from VLAN1 and assign it to VLAN 120, now I am able to ping Cisco switch  from my PC but unable to ping router (10.0.12.254) both from PC and Cisco switch.

Below is updated config:

interface Vlan1
 no ip address
 no ip route-cache
!
interface Vlan120
 description LAB
 ip address 10.0.12.1 255.255.255.0
!
ip http server
ip http secure-server
!
ip route 0.0.0.0 0.0.0.0 10.0.12.254

LAB#ping 10.0.12.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.12.254, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
LAB#

You need to have both VLANs,

interface Vlan1

Des to-router
 ip address 10.0.12.1 255.255.255.0

interface Vlan120
Des to client
 ip address 10.0.13.1 255.255.255.0

ip route 0.0.0.0 0.0.0.0 10.0.12.254

2- On router, you need to configure a return route toward switch. The ip address of 10.0.12.254 must be set on the main router interface.

Ip route 10.0.13.0 255.255.255.0 10.0.12.1  [ this is on router]

3- Set the ip of PC 10.0.13.2 255.255.255.0

4- Set the gateway of PC 10.0.13.1

Masoud / Paul, thanks for your prompt replies. your suggestions solve the issue.

Thanks again.

Hello,

I am glad your problem was solved.

Masoud

Hello

To route between these subnets there neesds to be a routing device  (ether on the switch or router) with l3 interfaces for each vlan


res
Paul


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Hello,

What is the IP address of the router interface and your PC? Did you put PC in vlan 1 or it is in VLAN 120?

If your PC is in VLAN 1, you do not need to set any gateway on your PC, What is your PC and router IP address?

If PC is in VLAN 120, do these steps.

1- you need to create VLAN 120 on the switch with a new range of IP(as en example 10.0.13.1 255.255.255.0) 

2- On router you need to set a return route toward switch.

Ip route 10.0.13.0 255.255.255.0 10.0.12.1

3- Set the ip of PC 10.0.13.2 255.255.255.0

4- Set the gateway of PC 10.0.13.1

Masoud