Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Routing between vlans

Hello,

I have one question about with this theme.

Imagine a connection between a router and a switch with 2 vlans. In all instalations that I made, I always create the vlans on both router and switch and the connections between the 2 equipments are made with a trunk link with 2 vlans.

Now i'm studying to icnd2 and I saw that Cisco recomends to do this type of connection using sub interfaces.

My question is if it will works in a different way comparing with the way i used until now?
It works in both ways, the only difference that I saw is that I have an ip address to the subinterface...

Am I correct?

Thanks in advance,

Tiago Reis

Everyone's tags (4)
2 ACCEPTED SOLUTIONS

Accepted Solutions
Cisco Employee

Re: Routing between vlans

Tiago,

It seems that you have always used a router with a switching card - either a built-in switch or an added HWIC module with 4 or 9 ports. Am I correct in assuming this? Can you provide us with a quick example of what commands you use to configure the router this way?

In any case, what the ICND2 course suggests is also correct (and probably the most common way of doing these things). The idea of this router-on-stick approach with subinterfaces is that you are configuring a routed port. If you are using the switching HWIC module, that configuration with creating VLANs and configuring a port as a trunk is specific for switched ports which cannot have IP addresses by themselves so a Switched Virtual Interface - the interface Vlan X has to be created that will contain the IP address of the router in the particular VLAN.

In effect, both these approaches are identical and I assume that in a software-based router like x800 or x900 series, they even work very similarly inside the router.

Best regards,

Peter

Cisco Employee

Re: Routing between vlans

Hello Tiago,

I am glad to help.

One suggestion: You have given an example of a port connecting to an IP Phone with a PC. Your configuration shows that this port is configured as a trunk. This is a workable configuration; however, it is more recommended to configure such port as an access port with a supplementary voice VLAN. The equivalent configuration of your Fa0/2 port using this approach would be:

interface FastEthernet0/2
switchport access vlan 10
switchport voice vlan 100
switchport mode access

Best regards,

Peter

4 REPLIES
Cisco Employee

Re: Routing between vlans

Tiago,

It seems that you have always used a router with a switching card - either a built-in switch or an added HWIC module with 4 or 9 ports. Am I correct in assuming this? Can you provide us with a quick example of what commands you use to configure the router this way?

In any case, what the ICND2 course suggests is also correct (and probably the most common way of doing these things). The idea of this router-on-stick approach with subinterfaces is that you are configuring a routed port. If you are using the switching HWIC module, that configuration with creating VLANs and configuring a port as a trunk is specific for switched ports which cannot have IP addresses by themselves so a Switched Virtual Interface - the interface Vlan X has to be created that will contain the IP address of the router in the particular VLAN.

In effect, both these approaches are identical and I assume that in a software-based router like x800 or x900 series, they even work very similarly inside the router.

Best regards,

Peter

New Member

Re: Routing between vlans

Hello Peter,

Thanks for your fast reply. Is that correct, I always used routers with HWIC module, like 1841, to connect to the switch.
The others FE ports I used to connect to the "main" router that makes the connection to the internet.

The last one that I made was a connection between 1 router and 2 switchs
-router
interface FastEthernet0/1/0
switchport trunk allowed vlan 10,99-100
switchport mode trunk

-switch
port for trunk:
interface FastEthernet0/1
switchport trunk allowed vlan 10,99-100
switchport mode trunk
!
ports for access (phone and pc):
interface FastEthernet0/2
switchport trunk native vlan 10
switchport trunk allowed vlan 10,100
switchport mode trunk
switchport voice vlan 100
!

interface Vlan1
no ip address
shutdown
!
interface Vlan10
ip address 192.168.10.252 255.255.255.0
!
interface Vlan99
ip address 192.168.99.252 255.255.255.240
!
interface Vlan100
ip address 192.168.100.252 255.255.255.0
!

Now I understand that if I only had one router without HWIC I am forced to use subinterfaces. Great! Always learning...

Thanks one more time :).

Best Regards,

Tiago Reis

Cisco Employee

Re: Routing between vlans

Hello Tiago,

I am glad to help.

One suggestion: You have given an example of a port connecting to an IP Phone with a PC. Your configuration shows that this port is configured as a trunk. This is a workable configuration; however, it is more recommended to configure such port as an access port with a supplementary voice VLAN. The equivalent configuration of your Fa0/2 port using this approach would be:

interface FastEthernet0/2
switchport access vlan 10
switchport voice vlan 100
switchport mode access

Best regards,

Peter

New Member

Re: Routing between vlans

Hello Peter,

Thanks, from now on I will use that kind of configuration .

Best Regards,

Tiago

761
Views
0
Helpful
4
Replies
CreatePlease login to create content