When would you need this: When you want to perform routing between different VLANs.
Special Requirements: You have to make sure that your router support the frame tagging technology used between the switches.
Before jumping into the router configuration, you have to configure a port in the switch that will be connected to the router to be a trunk port. And keep remembering the VLAN tagging method that you configured the switch to use (ISL or 802.1Q, 802.10, or LANE).
What will be done in this procedure is creating logical interfaces inside the single physical interface that will be linking the switch to the router. These logical interfaces will be treated as separate interfaces in the routing decisions.
1. Remove the IP address from the physical interface, and turn it on,
Router(config-if)#no ip address
2. Create a logical interface to be assigned to one of the VLANs
Router(config-if)#int fastethernet 0/0.X
You can change the ‘fastethernet’ to the type you have and the ‘0/0’ with the interface number that you are using.
X represent the logical interface number (not number of logical interfaces). You can use any number here, but I think it is better to use the same number of the VLAN that you will assign to this logical interface. For example, for the logical interface that you will use for VLAN 5 use ‘int fastethernet 0/0.5'. This way, you will easily know which interface refers to which VLAN.
3. Assign the logical interface to a VLAN number
Router(config-subif)#encapsulation XXX Y
where XXX is the encapsulation type you are using for the VLANs (ex: isl or dot1q which is 802.1Q)
and Y is the VLAN number that this logical interface will be assigned to.
Read the rest of the article in the Router Geek Book: Guide to Cisco Routers Configuration