Switches and Router sub-interfaces


Switch-1 Port:G0/0-G0/3-G1/0 Vlan 10
Switch-1 Port:G0/1-G1/1-G1/2 Vlan 20
Switch-1 Port:G0/2 Trunk

Switch-2 Port:G0/1-G0/0-G0/3 Vlan 20
Switch-2 Port:G0/2-G1/0-G1/1 Vlan 10
Switch 2 Port:G1/2 Trunl

Router 1 Port:G0/0 Interface G0/0.10
encapsulation dot1q 10
Router 1 Port:G0/0 Interface G0/0.20
encapsulation dot1q 20
Router 1 Port:G0/1

The system won’t allow me to do:

Interface G0/0.10
encapsulation dot1q 10

Hello Juan

I’d just like to confirm your specific problem. So you are saying that on Router 1, you are able to configure a subinterface on GigabitEthernet0/0 as 0/0.10 but you cannot configure a subinterface on GigabitEthernet 0/1 as 0/1.10 correct?

Can you share with us the specific command you are inputting and the error message that appears? This will help us further understand the possible issues.

Now having said that, there is something that’s not quite right with the topology that you have created. If you have a router between the two switches, then you will never be able to have the VLANs on Switch1 communicate directly (on Layer 2) with their counterpart VLANs on Switch2. In order for you to have that work, you need to remove the router, and simply create a trunk between the switches that allows both VLANs 10 and 20. If you then want to route between VLANs, you would then create one interface on Router 1 with two subinterfaces (on VLANs 10 and 20) to act as the default gateway for each VLAN, and have that router connect to only one of the two switches. Does that make sense?

I hope this has been helpful!

Laz

Hello Lazarus;

Thank you in responding my email.

I am taking the CCNA course. I am using Cisco CML for my lab training, and I was just following a YouTube tutorial with this setup:

Switch 1:

  • 6 computers connected
  • 2 VLANs: VLAN 10 and VLAN 20
  • 3 computers in VLAN 10, 3 in VLAN 20
  • VLAN 10: IP address 10.6.10.x/24, gateway 10.6.10.1
  • VLAN 20: IP address 10.6.20.x/24, gateway 10.6.20.1
  • Port connecting to the router is a trunk

Router:

  • Subinterface for VLAN 10 on port G0/0 (10.6.10.1)
  • Subinterface for VLAN 20 on port G0/0 (10.6.20.1)

Switch 2:

  • Same scenario as Switch 1

When I try this on Router port# G0/1 that connects to switch2:

After I type interface g0/1.10, when I assign the default gateway, 10.6.10.1 won’t allow it because that ip address is assigned to G0/0.

What should I do in Port #G0/1 for Switch 2 with six computers vlan 10 and 20?

As I understand, if I want to ping from 10.6.10.50 to 10.6.20.30, the router will allow it.

Sincerely,

Juan Terc

Hello Juan

A router, by definition, cannot have the same IP address assigned to two different interfaces. Indeed, it cannot have two interfaces assigned two different IP addresses that are in the same subnet!

For example, if you have 192.168.1.1/24 assigned to Gi0/1 it will not allow you to assign 192.168.1.2/24 to Gi0/2 because they’re in the same subnet.

Routers are designed to route traffic from one subnet to another, where each interface is connected to a different subnet. So it looks like the scenario that the tutorial suggests is incorrect. Let me explain why:

Remember that a VLAN creates a single broadcast domain within which a subnet will function. In your scenario, VLAN 10 exists on both Switch 1 and Switch 2 and hosts within VLAN 10 on both switches are assigned addresses in the same subnet. However, routers act as “borders” or as the “edge” of a broadcast domain. So by placing the router between the two switches, you are essentially splitting the broadcast domain into two. The only way that will work is if you use different subnets for each broadcast domain. Does that make sense?

So you must either change your IP addressing scheme, or remove the router completely from the topology.

I hope this has been helpful!

Laz