2

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

2

With your switch configuration, you are adding VLAN tags to the frames, but the router is not, so the switch assumes the traffic belongs to VLAN 1.

Since this is layer-3 switch, you should simply configure the switch interface as a layer-3 interface:

interface 1/0/10
 no switchport
 ip address 192.168.50.20 255.255.255.0
!

Alternatively, you could configure a trunk on the router interface.

interface 0/1
 no ip address
!
interface 0/1.50
 encapsulation dot1Q 50
 ip address 192.168.50.10 255.255.255.0
!
  • okay, but the Layer 2 port on the Switch is configured as trunk with no default vlan, which means it's vlan 1 native (and vlan 200 allowed). So that still doesn't work? thank you – user1556073 Sep 10 '18 at 16:19
  • No. You are configuring the switch interface to only allow tagged VLAN 50, but the router is not sending tagged frames. With a layer-3 switch to router, it normally should be a routed link, but you can configure a trunk on the router if you need to. What you cannot do is mix a trunk and access interface the way you are doing. – Ron Maupin Sep 10 '18 at 16:46
2

Depending on your needs, the best configuration may vary significantly. Alternatively, on SW1:

you could add -

switchport trunk native vlan 50

The actual issue in this case is that the switch needs to take the tag off the frame before forwarding it the the router, due to being layer 2 adjacent. Ron explains why above, and this is considered best practice.

However, you can still use your router interface config if you add the command I noted above to the trunk.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.