I have a switch that connects to a 2800's f/e port. The switches port is configured to trunk only vlan 2. There is also an SVI on the switch for vlan 2. However, the router port only does layer 3 and the SVI needs to be routed across the WAN. How can I trunk vlan 2 from the switch to the router and keep the router's port layer3.
Here is the 2800's port:
ip vrf forwarding VRF10
ip address 10.33.10.17 255.255.255.240
ip helper-address 10.10.33.10
vlan-id dot1q 2
The last command I added, vlan-id dot1q 2 is a shot in the dark...not sure if that works...anybody know?
Here is the switch:
ip address 10.33.10.18 255.255.255.240
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 2
switchport mode trunk
The suggestion by Mark is good if you need the connection from the switch to the router to be a trunk - especially if there are multiple VLANs to transport.
But your original post specifies that only a single VLAN is supposed to go over that link. In this case there are a couple of alternatives to consider:
- you would not need to configure the router interface with subinterfaces if you leave the switch port as a trunk and configure VLAN 2 as the native VLAN on the switch. Frames for the native VLAN are sent untagged (they are just normal Ethernet frames) which the router interface should recognize and be able to process.
- if only a single VLAN is transported I question why the switch port should be a trunk. To transport only VLAN 2 traffic you could just make the switch port an access port in VLAN 2. In this case the router interface would just be a standard FastEthernet interface configuration and there is no consideration of trunking.
On the 2800's FE port you will need to create a sub interface on for vlan 2. Here is an example below.
no ip address
description Data VLAN
encapsulation dot1Q 30
ip address 10.0.30.1 255.255.255.0
description Voice VLAN
encapsulation dot1Q 40
ip address 10.0.40.1 255.255.255.0