cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7234
Views
10
Helpful
1
Replies

Connecting Layer 2 switchport to layer 3 port

thedot331
Level 1
Level 1

I have a config that I am trying to bring up, and in my mind it should work, but perhaps I am missing something.

 

The idea is that one end of the link is a layer 3 interface on a router. The other end is a switchport trunk, on a vlan with an IP interface. They should be able to communicate, no?

 

RTR1

Interface 0/1
# ip address 192.168.50.10 255.255.255.0

SW1 - Layer 3 switch

Interface 1/0/10
 # switchport
 # switchport mode trunk
 # switchport trunk allowed vlan 50

vlan 50
 # name test vlan

Interface vlan 50
# ip address 192.168.50.20 255.255.255.0

There are no gateways configured on either devices, but that should not matter? All I am trying to do is reach them directly.

# ping 192.168.50.20 source int0/1

or

# ping 192.168.50.10 source vlan 50

neither works. The physical connection is good because both devices see each other as CDP neighbors. The Interfaces are both up/up, vlan 50 interface is up. The subnet is in each device's routing table, as directly connected.

 

Any help would be appreciated. Am i missing something?

 

thank you

1 Accepted Solution

Accepted Solutions

On the router you need to specify the VLAN tag, or make the VLAN 50 untagged at the swtich. at this moment, the switch is sending the traffic with VLAN tag of 50, and the router does not process the VLAN tag. So you have two options:

Option 1 (and the best solution is the following):

at the router:

Interface 0/1
no ip address
no shutdown
int 0/1.50
encapsulation dot1q 50
ip address 192.168.50.10 255.255.255.0

And it should work. If you need more VLANs afterwards you can just keep adding subinterfaces repeating the above config and changing IP addresses and replacing 50 by the new VLAN.

Option 2: The other option is, at the switch you can add this command:

Interface 1/0/10
switchport trunk native vlan 50

But this won't scale, so i would go for optuon 1. That is called router on-a-stick.. you should eb able to find few guides online.
** Please rate helpful posts **

CCIE #58023

View solution in original post

1 Reply 1

On the router you need to specify the VLAN tag, or make the VLAN 50 untagged at the swtich. at this moment, the switch is sending the traffic with VLAN tag of 50, and the router does not process the VLAN tag. So you have two options:

Option 1 (and the best solution is the following):

at the router:

Interface 0/1
no ip address
no shutdown
int 0/1.50
encapsulation dot1q 50
ip address 192.168.50.10 255.255.255.0

And it should work. If you need more VLANs afterwards you can just keep adding subinterfaces repeating the above config and changing IP addresses and replacing 50 by the new VLAN.

Option 2: The other option is, at the switch you can add this command:

Interface 1/0/10
switchport trunk native vlan 50

But this won't scale, so i would go for optuon 1. That is called router on-a-stick.. you should eb able to find few guides online.
** Please rate helpful posts **

CCIE #58023
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