cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
975
Views
5
Helpful
12
Replies

router won't give connecton to my switch with vlans configured to it

Ryan2003
Level 1
Level 1

Hello everybody,

 

The last 3 days ive been configuring a cisco 1941 router and a cisco catalyst 3750 switch for learning purposes. after configuring the router, i wanted to configure the switch with vlans. only the problem is that when i connect the switch with the router i wont get an connection. i've looked in every corner on the internet but can't vind any solution. down below ive listed my router and switch configurations. All help is appreciated and i want to thank everybody in advance. 

 

NOTE: Because this is for learning purposes, mistakes were made, so some lines of text are wrong, so keep it in mind.

 

router config:

 

 Current configuration : 2367 bytes
!
version 15.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname ITSR1
!
boot-start-marker
boot-end-marker
!
!
enable secret 5 $1$q3Zq$sQNEwBPwVkSe.eGCo2XoF.
!
no aaa new-model
!
!
!
!
!
!
!
!
!
!
!
ip dhcp excluded-address 192.168.150.1 192.168.150.50
!
ip dhcp pool lan-pool
network 192.168.150.0 255.255.255.0
default-router 192.168.150.1
dns-server 8.8.8.8
!
!
!
no ip domain lookup
ip domain name ITsolutions.nl
ip cef
no ipv6 cef
multilink bundle-name authenticated
!
cts logging verbose
!
!
license udi pid CISCO1941/K9 sn FCZ201760HM
!
!
username 
redundancy
!
!
!
!
!
!
interface Embedded-Service-Engine0/0
no ip address
shutdown
!
interface GigabitEthernet0/0
description Broadband internet
mac-address 0844.0322.0133
ip address dhcp
ip access-group 1 in
ip nat outside
ip virtual-reassembly in
duplex auto
speed auto
!
interface GigabitEthernet0/1
description ITsoluctions LAN
ip address 192.168.150.1 255.255.255.0
ip nat inside
ip virtual-reassembly in
duplex auto
speed auto
!
interface GigabitEthernet0/1.10
encapsulation dot1Q 10
ip address dhcp
ip nat inside
ip virtual-reassembly in
!
interface GigabitEthernet0/1.20
encapsulation dot1Q 20
ip address dhcp
ip nat inside
ip virtual-reassembly in
!
interface GigabitEthernet0/1.99
description ITsoluctions LAN
encapsulation dot1Q 99
ip address dhcp
ip nat inside
ip virtual-reassembly in
!
ip forward-protocol nd
!
no ip http server
no ip http secure-server
!
ip nat inside source list 1 interface GigabitEthernet0/0 overload
ip route 0.0.0.0 0.0.0.0 100.100.100.2
ip route 0.0.0.0 0.0.0.0 192.168.100.2
ip route 0.0.0.0 0.0.0.0 192.168.0.1
ip route 200.200.200.0 255.255.255.0 100.100.100.2
!
!
!
access-list 1 permit 0.0.0.255
access-list 1 permit 192.168.150.0 0.0.0.255
access-list 1 permit 0.0.0.1 255.255.255.0
access-list 1 permit any
access-list 10 permit 192.168.0.0 0.0.0.255
!
control-plane
!
!
banner motd ^C
Pas mijn instellingen niet aan!^C
!
line con 0
line aux 0
line 2
no activation-character
no exec
transport preferred none
transport output pad telnet rlogin lapb-ta mop udptn v120 ssh
stopbits 1
line vty 0 4
password 
login local
transport input ssh
!
scheduler allocate 20000 1000

!
end

 

 

switch config: 

 

Current configuration : 2590 bytes
!
version 12.2
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname SW40Server
!
!
username admin password 0 cisco
no aaa new-model
switch 1 provision ws-c3750g-24ts
ip subnet-zero
ip domain-name 
!
!
!
!
no file verify auto
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
interface GigabitEthernet1/0/1
switchport access vlan 10
switchport mode access
!
interface GigabitEthernet1/0/2
switchport access vlan 10
!
interface GigabitEthernet1/0/3
switchport access vlan 10
!
interface GigabitEthernet1/0/4
switchport access vlan 10
!
interface GigabitEthernet1/0/5
switchport access vlan 10
!
interface GigabitEthernet1/0/6
switchport access vlan 10
!
interface GigabitEthernet1/0/7
switchport access vlan 10
!
interface GigabitEthernet1/0/8
switchport access vlan 10
!
interface GigabitEthernet1/0/9
switchport access vlan 10
!
interface GigabitEthernet1/0/10
switchport access vlan 10
!
interface GigabitEthernet1/0/11
switchport access vlan 10
!
interface GigabitEthernet1/0/12
switchport access vlan 10
!
interface GigabitEthernet1/0/13
switchport access vlan 20
!
interface GigabitEthernet1/0/14
switchport access vlan 20
!
interface GigabitEthernet1/0/15
switchport access vlan 20
!
interface GigabitEthernet1/0/16
switchport access vlan 20
!
interface GigabitEthernet1/0/17
switchport access vlan 20
!
interface GigabitEthernet1/0/18
switchport access vlan 20
!
interface GigabitEthernet1/0/19
switchport access vlan 20
!
interface GigabitEthernet1/0/20
switchport access vlan 20
!
interface GigabitEthernet1/0/21
switchport access vlan 20
!
interface GigabitEthernet1/0/22
switchport access vlan 20
!
interface GigabitEthernet1/0/23
switchport access vlan 99
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 10,20
switchport mode trunk
!
interface GigabitEthernet1/0/24
switchport access vlan 99
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface GigabitEthernet1/0/25
switchport access vlan 99
!
interface GigabitEthernet1/0/26
switchport access vlan 99
!
interface GigabitEthernet1/0/27
switchport access vlan 99
!
interface GigabitEthernet1/0/28
switchport access vlan 99
!
interface Vlan1
no ip address
shutdown
!
interface Vlan10
ip address dhcp
!
interface Vlan20
ip address dhcp
!
interface Vlan99
ip address dhcp
!
ip default-gateway 192.168.150.1
ip classless
ip http server
!
!
control-plane
!
!
line con 0
line vty 0 4
no login
line vty 5 15
no login
!
!
end

 

Thank you for the help.

12 Replies 12

Hello,

 

make the changes marked in bold to your switch configuration. 

 

The subinterfaces on your router are set to 'dhcp'. Where is the DHCP server ?

 

Current configuration : 2590 bytes
!
version 12.2
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname SW40Server
!
!
username admin password 0 cisco
no aaa new-model
switch 1 provision ws-c3750g-24ts
ip subnet-zero
ip domain-name
!
no file verify auto
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
interface GigabitEthernet1/0/1
switchport access vlan 10
switchport mode access
!
interface GigabitEthernet1/0/2
switchport access vlan 10
!
interface GigabitEthernet1/0/3
switchport access vlan 10
!
interface GigabitEthernet1/0/4
switchport access vlan 10
!
interface GigabitEthernet1/0/5
switchport access vlan 10
!
interface GigabitEthernet1/0/6
switchport access vlan 10
!
interface GigabitEthernet1/0/7
switchport access vlan 10
!
interface GigabitEthernet1/0/8
switchport access vlan 10
!
interface GigabitEthernet1/0/9
switchport access vlan 10
!
interface GigabitEthernet1/0/10
switchport access vlan 10
!
interface GigabitEthernet1/0/11
switchport access vlan 10
!
interface GigabitEthernet1/0/12
switchport access vlan 10
!
interface GigabitEthernet1/0/13
switchport access vlan 20
!
interface GigabitEthernet1/0/14
switchport access vlan 20
!
interface GigabitEthernet1/0/15
switchport access vlan 20
!
interface GigabitEthernet1/0/16
switchport access vlan 20
!
interface GigabitEthernet1/0/17
switchport access vlan 20
!
interface GigabitEthernet1/0/18
switchport access vlan 20
!
interface GigabitEthernet1/0/19
switchport access vlan 20
!
interface GigabitEthernet1/0/20
switchport access vlan 20
!
interface GigabitEthernet1/0/21
switchport access vlan 20
!
interface GigabitEthernet1/0/22
switchport access vlan 20
!
interface GigabitEthernet1/0/23
switchport access vlan 99
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 10,20
switchport mode trunk
!
interface GigabitEthernet1/0/24
switchport access vlan 99
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface GigabitEthernet1/0/25
switchport access vlan 99
!
interface GigabitEthernet1/0/26
switchport access vlan 99
!
interface GigabitEthernet1/0/27
switchport access vlan 99
!
interface GigabitEthernet1/0/28
switchport access vlan 99
!
--> interface Vlan1
--> ip address 192.168.150.2 255.255.255.0
!
--> no interface Vlan10
ip address dhcp
!
--> no interface Vlan20
ip address dhcp
!
--> no interface Vlan99
ip address dhcp
!
ip default-gateway 192.168.150.1
!
ip classless
ip http server
!
control-plane
!
line con 0
line vty 0 4
no login
line vty 5 15
no login
!
end

Hello Sir,

 

At the moment there is no dhcp server, but i was planning to implemt it later on. Ive changed the setting, but i still get a ''unknown network, no internet'' error on my laptop.

 

Thanks in advance,

Ryan

Hello,

 

with your current configuration (and the changes I suggested), you will only be able to access the router if your laptop is connected to the switch on a port that is configured like this:

 

interface GigabitEthernet1/0/1
switchport mode access

spanning-tree portfast

Would you post the output of these commands on the switch

show cdp neighbor

show interface status

show interface trunk

And would you tell us which switch interface connects to the router and which switch interface connects to your laptop.

HTH

Rick

Dear Mr Burts,

 

Here are the following outputs: 

 

Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone

Device ID Local Intrfce Holdtme Capability Platform Port ID
ITSR1.ITsolutions.nl
Gig 1/0/23 129 R B S I CISCO1941/Gig 0/1

 

Port Name Status Vlan Duplex Speed Type
Gi1/0/1 connected 10 a-full a-1000 10/100/1000BaseTX
Gi1/0/2 notconnect 10 auto auto 10/100/1000BaseTX
Gi1/0/3 notconnect 10 auto auto 10/100/1000BaseTX
Gi1/0/4 notconnect 10 auto auto 10/100/1000BaseTX
Gi1/0/5 notconnect 10 auto auto 10/100/1000BaseTX
Gi1/0/6 notconnect 10 auto auto 10/100/1000BaseTX
Gi1/0/7 notconnect 10 auto auto 10/100/1000BaseTX
Gi1/0/8 notconnect 10 auto auto 10/100/1000BaseTX
Gi1/0/9 notconnect 10 auto auto 10/100/1000BaseTX
Gi1/0/10 notconnect 10 auto auto 10/100/1000BaseTX
Gi1/0/11 notconnect 10 auto auto 10/100/1000BaseTX

Port Name Status Vlan Duplex Speed Type
Gi1/0/12 notconnect 10 auto auto 10/100/1000BaseTX
Gi1/0/13 notconnect 20 auto auto 10/100/1000BaseTX
Gi1/0/14 notconnect 20 auto auto 10/100/1000BaseTX
Gi1/0/15 notconnect 20 auto auto 10/100/1000BaseTX
Gi1/0/16 notconnect 20 auto auto 10/100/1000BaseTX
Gi1/0/17 notconnect 20 auto auto 10/100/1000BaseTX
Gi1/0/18 notconnect 20 auto auto 10/100/1000BaseTX
Gi1/0/19 notconnect 20 auto auto 10/100/1000BaseTX
Gi1/0/20 notconnect 20 auto auto 10/100/1000BaseTX
Gi1/0/21 notconnect 20 auto auto 10/100/1000BaseTX
Gi1/0/22 notconnect 20 auto auto 10/100/1000BaseTX
Gi1/0/23 connected trunk a-full a-1000 10/100/1000BaseTX

Port Name Status Vlan Duplex Speed Type
Gi1/0/24 notconnect 99 auto auto 10/100/1000BaseTX
Gi1/0/25 notconnect 99 auto auto Not Present
Gi1/0/26 notconnect 99 auto auto Not Present
Gi1/0/27 notconnect 99 auto auto Not Present
Gi1/0/28 notconnect 99 auto auto Not Present

Port Mode Encapsulation Status Native vlan
Gi1/0/23 on 802.1q trunking 1

Port Vlans allowed on trunk
Gi1/0/23 10,20

Port Vlans allowed and active in management domain
Gi1/0/23 10,20

Port Vlans in spanning tree forwarding state and not pruned
Gi1/0/23 10,20

As for you're question the router and the switch are connected thrue interface gigabyte 1/0/23 as this is my trunking port. As for my laptop, this is connected thrue interface gigabyte 1/0/1.

 

Kind regards,

Ryan

Dear Mr Pauwens,

 

I have tried you're suggestions on the switch. after troubleshooting for a while i still cant get an connection. i've put the spanning-tree porstfast in default. Does this cause the issue that i dont get an connection?

 

Kind regards,

Ryan 

Hello,

 

make sure your ports look exactly like below:

 

interface GigabitEthernet1/0/23
description Uplink to Router
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface GigabitEthernet1/0/1

description Laptop
switchport mode access

spanning-tree portfast

 

Also, post the running configs of both the router and the switch again, with the changes you have implemented.

Dear Mr Pauwens,

 

my configurations are listed below. I have applied these setting but with no succes. Am i doing something wronge with the spanning-three portfast. This is new to me, so this may cause it. 

 

Switch:

 

Building configuration...

Current configuration : 2552 bytes
!
version 12.2
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname SW40Server
!
!
username admin password 0 cisco
no aaa new-model
switch 1 provision ws-c3750g-24ts
ip subnet-zero
ip domain-name Leerdock.local
!
!
!
!
no file verify auto
spanning-tree mode pvst
spanning-tree portfast default
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
interface GigabitEthernet1/0/1
switchport access vlan 10
switchport mode access
spanning-tree portfast
!
interface GigabitEthernet1/0/2
switchport access vlan 10
!
interface GigabitEthernet1/0/3
switchport access vlan 10
!
interface GigabitEthernet1/0/4
switchport access vlan 10
!
interface GigabitEthernet1/0/5
switchport access vlan 10
!
interface GigabitEthernet1/0/6
switchport access vlan 10
!
interface GigabitEthernet1/0/7
switchport access vlan 10
!
interface GigabitEthernet1/0/8
switchport access vlan 10
!
interface GigabitEthernet1/0/9
switchport access vlan 10
!
interface GigabitEthernet1/0/10
switchport access vlan 10
!
interface GigabitEthernet1/0/11
switchport access vlan 10
!
interface GigabitEthernet1/0/12
switchport access vlan 10
!
interface GigabitEthernet1/0/13
switchport access vlan 20
!
interface GigabitEthernet1/0/14
switchport access vlan 20
!
interface GigabitEthernet1/0/15
switchport access vlan 20
!
interface GigabitEthernet1/0/16
switchport access vlan 20
!
interface GigabitEthernet1/0/17
switchport access vlan 20
!
interface GigabitEthernet1/0/18
switchport access vlan 20
!
interface GigabitEthernet1/0/19
switchport access vlan 20
!
interface GigabitEthernet1/0/20
switchport access vlan 20
!
interface GigabitEthernet1/0/21
switchport access vlan 20
!
interface GigabitEthernet1/0/22
switchport access vlan 20
!
interface GigabitEthernet1/0/23
switchport access vlan 99
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 10,20
switchport mode trunk
!
interface GigabitEthernet1/0/24
switchport access vlan 99
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface GigabitEthernet1/0/25
switchport access vlan 99
!
interface GigabitEthernet1/0/26
switchport access vlan 99
!
interface GigabitEthernet1/0/27
switchport access vlan 99
!
interface GigabitEthernet1/0/28
switchport access vlan 99
!
interface Vlan1
ip address 192.168.150.2 255.255.255.0
!
ip default-gateway 192.168.150.1
ip classless
ip http server
!
!
control-plane
!
!
line con 0
line vty 0 4
no login
line vty 5 15
no login
!
!
end

 

Router:

 

Current configuration : 2437 bytes
!
! Last configuration change at 11:49:18 UTC Mon Oct 12 2020 by ryan
!
version 15.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname ITSR1
!
boot-start-marker
boot-end-marker
!
!
enable secret 5 $1$q3Zq$sQNEwBPwVkSe.eGCo2XoF.
!
no aaa new-model
!
!
!
!
!
!
!
!
!
!
!
ip dhcp excluded-address 192.168.150.1 192.168.150.50
!
ip dhcp pool lan-pool
network 192.168.150.0 255.255.255.0
default-router 192.168.150.1
dns-server 8.8.8.8
!
!
!
no ip domain lookup
ip domain name ITsolutions.nl
ip cef
no ipv6 cef
multilink bundle-name authenticated
!
cts logging verbose
!
!
license udi pid CISCO1941/K9 sn FCZ201760HM
!
!
username 
redundancy
!
!
!
!
!
!
interface Embedded-Service-Engine0/0
no ip address
shutdown
!
interface GigabitEthernet0/0
description Broadband internet
mac-address 0844.0322.0133
ip address dhcp
ip access-group 1 in
ip nat outside
ip virtual-reassembly in
duplex auto
speed auto
!
interface GigabitEthernet0/1
description ITsoluctions LAN
ip address 192.168.150.1 255.255.255.0
ip nat inside
ip virtual-reassembly in
duplex auto
speed auto
!
interface GigabitEthernet0/1.10
encapsulation dot1Q 10
ip address dhcp
ip nat inside
ip virtual-reassembly in
!
interface GigabitEthernet0/1.20
encapsulation dot1Q 20
ip address dhcp
ip nat inside
ip virtual-reassembly in
!
interface GigabitEthernet0/1.99
description ITsoluctions LAN
encapsulation dot1Q 99
ip address dhcp
ip nat inside
ip virtual-reassembly in
!
ip forward-protocol nd
!
no ip http server
no ip http secure-server
!
ip nat inside source list 1 interface GigabitEthernet0/0 overload
ip route 0.0.0.0 0.0.0.0 100.100.100.2
ip route 0.0.0.0 0.0.0.0 192.168.100.2
ip route 0.0.0.0 0.0.0.0 192.168.0.1
ip route 200.200.200.0 255.255.255.0 100.100.100.2
!
!
!
access-list 1 permit 0.0.0.255
access-list 1 permit 192.168.150.0 0.0.0.255
access-list 1 permit 0.0.0.1 255.255.255.0
access-list 1 permit any
access-list 10 permit 192.168.0.0 0.0.0.255
!
control-plane
!
!
banner motd ^C
Passen Sie meine Einstellungen nicht an!^C
!
line con 0
line aux 0
line 2
no activation-character
no exec
transport preferred none
transport output pad telnet rlogin lapb-ta mop udptn v120 ssh
stopbits 1
line vty 0 4
password 
login local
transport input ssh
!
scheduler allocate 20000 1000
ntp server 
!

 

kind regards,

Ryan 

Hello,

 

you have not implemented the changes I suggested. Spanning-tree portfast is not the problem. The problem is that the port conneced to the laptop is an access port in Vlan 10. There is no ip address on the subinterface of the router for Vlan 10. With your current router configuration, you can only get an IP address from Vlan 1. Change the settings to:

 

interface GigabitEthernet1/0/1
--> no switchport access vlan 10
switchport mode access
spanning-tree portfast

Ryan

 

Thank you for the outputs that I requested. They do confirm that there is connectivity between router and switch and do confirm that trunking is configured and is operating correctly. 

 

@Georg Pauwen has correctly identified that there is no IP address on the router for vlan 10 (or for vlan 20). Both router subinterfaces are configured to use DHCP to get an address. But where would that DHCP come from? The solution that he suggests, to configure the switch port where PC connects to be in vlan 1 would solve the issue for that device. But it does not address the fundamental issue for vlan 10 and 20. Either you need to provide something that would provide DHCP addressing for those interfaces or you need to remove the DHCP from those router interfaces and assign IP addresses and masks for the interfaces. This is a much better long term solution. 

HTH

Rick

One IP address for each sub interface in router.

 

Dear HMH,

 

thank you for your reply, but i have already tried this, and it didint work. Beside i was planning to add more divices so i think 1 IP address wont work.

 

Kind regards,

Ryan

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card