cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
283
Views
2
Helpful
3
Replies

Subinterfaces and VLANs

michal-miac
Level 1
Level 1

I have a few general questions when it comes to my network. Maybe someone could even suggest how to name the topic of my question. But firstly, I'd like to introduce you to my network.

Screenshot from 2024-03-27 09-44-56.png


The special thing about the network is that subinterfaces are configured on the two connected interfaces of the routers, so the configuration looks like this on the first router:

interface GigabitEthernet2.1
encapsulation dot1Q 2
ip address 192.168.10.2 255.255.255.0

interface GigabitEthernet2.2
encapsulation
dot1Q 3 native
ip address 192.168.9.2 255.255.255.0

and on the second router:

interfacedc GigabitEthernet1.1
encapsulation dot1Q 2
ip address 192.168.10.1 255.255.255.0

interface GigabitEthernet1.2
encapsulation dot1Q 3 native
ip address 192.168.9.1 255.255.255.0

Communication between the network 192.168.10.2 255.255.255.0 can only take place if this configuration is carried out on the switch:

interface Ethernet1/1
switchport
switchport mode trunk
switchport trunk allowed vlan add 2
no shutdown

interface Ethernet1/2
switchport
switchport mode trunk
switchport trunk allowed vlan add 2
no shutdown

The background idea is that I want to be able to create different networks on the same interfaces. My concerns are:

1. is it common to use such configuration?

2. is it best practice to use such configurations?

3. does it make sense to configure the switch interfaces as trunk?

3. what would be another solution that would mimic the same as my network?

1 Accepted Solution

Accepted Solutions

1. is it common to use such configuration?Yes

2. is it best practice to use such configurations?this is optimal config

3. does it make sense to configure the switch interfaces as trunk?sure since you use subinterface in router then router and SW must use tag frame and tag frame only work with trunk port

3. what would be another solution that would mimic the same as my network?there is no other solution except if the router supports vlan, then you can config vlan SVI instead of subinterface and still you need trunk port in SW for both vlan and subinterface.

MHM

View solution in original post