Disclaimer: I realize this is an exercise in a course, and below is a discussion about, and a solution to, the exercise. Use the solution only as a last resort after you have tried for at least 2 hours to solve the exercise on your own and still haven't figured it out on your own. Cheating by simply getting the answer to an exercise will not get you anywhere.
I have little to add to the other answers, but I will try to clarify the issues with the question, and propose an alternative solution:
Issues with the question
For the purposes of this discussion, I will be referring to the networks as follows:
- Network attached to Switch1 and PC: N0
- Network attached to PC1: N1
- Network attached to Switch3 and PC2: N2
- Network attached to PC3: N3
From the provided diagram, the networks are each attached to a separate interface of Router0:
Router0 interface |
Network |
Gig0/0/0 |
N0 |
Gig0/0/1 |
N1 |
Gig0/1/0 |
N2 |
Gig0/1/1 |
N3 |
N0 and N1 are each attached to router interfaces proper. "Proper" router interfaces are interfaces that can only be router interfaces and you cannot configure them to act as switch ports (or at least it would be very difficult and is obviously not what you are trying to do here). This means they must have an IP address, and you can create subinterfaces on them.
N2 and N3, on the other hand, are connected to what seems to be a switch module that is plugged into Router0. Now, it depends on the switch module, but often these switch modules are switch ports proper. "Proper switch ports" are ports that you cannot configure routing on, cannot give them an IP address, and you cannot configure subinterfaces on them. For the purposes of my answer, though, I will entertain the scenario that you can configure these ports as either L2 or L3 ports. More on that later.
In the question statement, you say that each network must have a "unique VLAN". VLANs only matter in the switched segment of the network. This means that once traffic hits a router, you can have the same VLAN on the other side of the router. Since here you have four switched segments separated by a router you do not strictly require unique VLANs. Nonetheless, requirements are requirements, so we will provide for that.
We will, for the sake of argument, assign the following VLANs to each switched segment:
Network |
VLAN ID |
N0 |
10 |
N1 |
11 |
N2 |
12 |
N3 |
13 |
Now let us consider the configuration of Switch3:
interface Fast0/2
description port to PC2
switchport mode access
switchport access vlan 12
interface Fast0/1
description port to Router0 Gig0/1/0
switchport mode access
switchport access vlan 12
With the above configuration stanza we configured N2 traffic to go to Router0 untagged. If you insist on Switch3 to tag traffic that it sends to Router0, you must configure a trunk to Router0:
!on Switch3:
interface Fast0/1
description trunk port to Router0 Gig0/1/0
switchport encapsulation dot1q
switchport mode trunk
switchport trunk native vlan 1
This way, the switch will be tagging all VLAN 12 traffic that it sends to Router0. The same is true for all four switches.
Solution if router's switch module has L3 interfaces
First, we must verify if the router's switch module's interfaces can be configured as L2 interfaces:
! on Router0:
interface Gig0/1/0
no switchport
end
show interface Gig0/1/0 | include switch
If there are no errors, you should move on with this scenario. If the router does not let you configure the port as a L3 port, then you simply cannot solve this exercise with the existing cabling. Move to the section where I discuss the exercise's alternative solution.
! on Router0:
interface Gig0/1/0
no switchport
interface Gig0/1/0.12
encapsulation dot1Q 12
ip address <VLAN-12 default GW> <mask>
If Switch3 is not tagging VLAN12 traffic, you need to tell Router0 that it will be receiving untagged VLAN12 traffic:
! on Router0:
interface Gig0/1/0.12
encapsulation dot1Q 12 native
And repeat on Gig0/1/1.
On the router interfaces:
! on Router0:
interface Gig0/0/0
no ip address
interface Gig0/1/0.10
encapsulation dot1Q 10 ! add native if Switch1 is not trunking
ip address <VLAN-10 default GW> <mask>
And repeat for Gig0/0/1.
Alternative solution
- Delete all switches except Switch1.
- Attach PC to Fa0/10 of Switch1 (N0 - VLAN 10)
- Attach PC1 to Fa0/11 of Switch1 (N1 - VLAN 11)
- Attach PC2 to Fa0/12 of Switch1 (N2 - VLAN 12)
- Attach PC3 to Fa0/13 of Switch1 (N3 - VLAN 13)
- Configure Switch1:
!on Switch1:
interface Fast0/10
description Access port to PC (VLAN 10)
switchport mode access
switchport access vlan 10
interface Fast0/11
description Access port to PC1 (VLAN 11)
switchport mode access
switchport access vlan 11
interface Fast0/12
description Access port to PC2 (VLAN 12)
switchport mode access
switchport access vlan 12
interface Fast0/13
description Access port to PC3 (VLAN 13)
switchport mode access
switchport access vlan 13
interface Fast0/3
description Trunk port to Router0 Gig0/0/0
switchport encapsulation dot1q
switchport mode trunk
switchport trunk native vlan 1
- Configure Router0 with the subinterfaces that the question is asking:
! on Router0:
interface Gig0/0/0.10
encapsulation dot1Q 10
ip address <VLAN-10 default GW> <mask>
interface Gig0/0/0.11
encapsulation dot1Q 11
ip address <VLAN-11 default GW> <mask>
interface Gig0/0/0.12
encapsulation dot1Q 12
ip address <VLAN-12 default GW> <mask>
interface Gig0/0/0.13
encapsulation dot1Q 13
ip address <VLAN-13 default GW> <mask>
The above is (or at least used to be) called Router-On-a-Stick.
Note: The commands are from memory, I do not have access to this topology or equipment right now, so forgive any errors in the commands and adjust the commands on the CLI as needed.
GigabitEthernet0/0/0
toGigabitEthernet0/0/2
. The other four interfaces are switch interfaces, and you cannot use them as router interfaces.GigabitEthernet0/1/0
andGigabitEthernet0/1/1
in your router are switch interfaces in the switch module. They are not router interfaces, and you cannot use them as router interfaces. In any case, your topology does not need subinterfaces.