0

I'm trying to connect 4 networks with 1 router, i created 2 sub-interfaces in the router, when i tried to create the 3rd sub-interface i got this output "%Cannot create sub-interface", this is my topology: enter image description here

This is my Router's configuration:

hostname Router
!
ip cef
ip ipv6 cef
!
spanning-tree mode pvst
!
interface GigabitEthernet0/0/0
no ip address
duplex auto
speed auto
!
interface GigabitEthernet0/0/0.10
encapsulation dot 1Q 10
ip address 10.1.1.254 255.255.255.0
!
interface GigabitEthernet0/0/1
no ip address
duplex auto
speed auto
!
interface GigabitEthernet0/0/1.20
no ip address
!
interface GigabitEthernet0/0/2
no ip address
duplex auto
speed auto
shutdown
!
interface GigabitEthernet0/1/0
swithport mode access
switchport nonegotiate
!
!
interface GigabitEthernet0/1/1
swithport mode access
switchport nonegotiate
!
!
interface GigabitEthernet0/1/2
swithport mode access
switchport nonegotiate
!
!
interface GigabitEthernet0/1/3
swithport mode access
switchport nonegotiate
!
interface Vlan1
no ip address 
!
ip classless
!
ip flow-export version 9
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
end

I need to create 4 networks, each network has a unique VLAN. And add default gateway to each VLAN to make the PC's communicate with each other. I know it's much better to put 1 network only and separate the VLAN's by 1 switch. But i want to use more interfaces in a Router, than Switches.

3
  • The idea is that subinterfaces are used on a physical interface, but you are putting one subionterface per physical interface, and that does not make sense. You normally would put all your subinterfaces on a single physical interface, then turn on trunking on the switch interface that connects to the router interface. It looks like you only have three router interfaces: GigabitEthernet0/0/0 to GigabitEthernet0/0/2. The other four interfaces are switch interfaces, and you cannot use them as router interfaces.
    – Ron Maupin
    Jul 2, 2020 at 11:06
  • 5
    The GigabitEthernet0/1/0 and GigabitEthernet0/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.
    – Ron Maupin
    Jul 2, 2020 at 11:09
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer.
    – Ron Maupin
    Nov 19, 2022 at 23:40

3 Answers 3

0

You cannot create a subinterface (L3) for a port that's in switchport (L2) mode. Remove the switchport mode (no switchport), then try again.

If you do need to use switchport mode, you need to create a VLAN, allow it on the required interfaces and configure the IP address on an SVI instead of an L3 subinterface.

0

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

  1. Delete all switches except Switch1.
  2. Attach PC to Fa0/10 of Switch1 (N0 - VLAN 10)
  3. Attach PC1 to Fa0/11 of Switch1 (N1 - VLAN 11)
  4. Attach PC2 to Fa0/12 of Switch1 (N2 - VLAN 12)
  5. Attach PC3 to Fa0/13 of Switch1 (N3 - VLAN 13)
  6. 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
  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.

2
  • Please accept your answer so that the question does not keep popping up forever, looking for an answer.
    – Ron Maupin
    Dec 16, 2022 at 18:30
  • 1
    "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" The router interfaces can be bridge interfaces without too much trouble. Many Cisco routers, including the 4331, can set router interfaces to bridge, and there is also IRB (see this answer about that).
    – Ron Maupin
    Dec 16, 2022 at 18:33
0

Please follow my configuration and try

Router(config)
#int gigabit Ethernet 0/0/0
#no ip address
#no shutdown

Router(config)
#int gigabit Ethernet 0/0/0.10
#ip address x.x.x.x x.x.x.x
#encapusation dot1q 10
#no shut

Router(config)
#int gigabit ethernet 0/0/0.20
#encapsulation dot1q 20
#ip address x.x.x.x  x.xx.x
#no shutdown

Router (config)
#int gigabit ethernet 0/0/0.30
#encapsulation dot1q 30
#ip address x.x.x.x x.x.x.x
#no shutdown

Router(config)
#int gigabit Ethernet 0/0/0.40
#encapsulation dot1q 40
#ip address x.x.x.x x.x.x.x
#no shutdown

In layer2 switch configuration

Configure the trunk Port in the switch interface connected to the router so that vlan 10, Vlan20, Vlan30, and Vlan40 traffic will flow from the router towards the switch from this trunk Port

Switch(config)# int 0/1
#switch Port trunk
#switch trunk allowed vlan all
#no shutdown`

Create access ports as per your requirements, for example, below

Switch (config)#int 0/2
#switchport mode access
#switch Port access vlan10
#no shutdown /*please connect this interface to end devices*/

Create VLANs in this switch

Switch(config)
#vlan 10
#name finances

Switch(config)#vlan 20
#name account

Switch(config)
#vlan30
#name operation

Switch(config)
#Vlan40
#name hr

Try the above configuration...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.