I am learning about Cisco BGP networking now and came across an interesting situation. In my examples, there was one which suggested that two VLANs were configured on Layer 3 in order to run two BGP sessions. This was done in order to segregate the traffic so the client can run two distinct networks (IP prefixes) off of this ISP.

One of the guys here tried to explain it like this but I feel like I am missing something still:

"A L3 VLAN is a local VLAN only on the port side, whereas the Layer 2 VLAN "spans" an ISP's network, and if bundled together the two VLANs = a hybrid port which can carry L3 and L2 traffic."

I understand inherently VLANs are Layer 2 as they deal with MAC address transparency especially when considering QinQ traffic on an ISP network. What I was hoping someone could explain is how a VLAN (or perhaps a better way to refer to it is to call it a logical connection) on Layer 3 works by using IP rather than MAC addresses.

Thanks in advance.

  • 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 provide and accept your own answer.
    – Ron Maupin
    Commented Dec 25, 2018 at 9:29

2 Answers 2


In L3 mode - the interface is confugured with an IP address and dot1q(qinq) encapsulation. In that case when the packet arrives to this physical port the VLAN tags are used to map this packet to the correct logical ingress interface, and if the DMAC matches the confugured MAC on that interface the VLANs and the L2 header are terminated and routing takes place.


In case if you have switch with multi-layer functionality or router with switch line card, you're able to route packets from one network to another, if configured properly. For example, on Cisco Catalyst 3750 you can create so-called SVI - switch virtual interface, with same number as VLAN ID.

vlan 20
 name TEST
interface Vlan20
 ip address

With that configuration you will be able to access switch from VLAN 20. To be able to actually route packets between VLAN 20 and (let's assume we have another one, configured in a same way) VLAN 30, you will need configuration line:

ip routing

This will convert your Layer2 device into multi-layer device (your device should support this functionality).

For a router device, like Cisco 880 with built-in switch module, configuration almost the same: you need to have VLAN created and VLAN interface with same number.

# Creating VLANs
vlan 20
 name TEST
vlan 30
 name TSET

# Creating L3-interfaces
interface Vlan20
 ip address
interface Vlan30
 ip address

# Assigning switch-ports to VLANs
interface FastEthernet0
 switchport access vlan 20
interface FastEthernet1
 switchport access vlan 30


For router without switch module to be able to accept tagged traffic with multiple VLAN's on a single interface, you can use subinterfaces.

Assume that GigabitEthernet0/0 is a router interface that connected to ISP switch and it's a trunk port. ISP tags two VLAN's - 20 an 30.

interface GigabitEthernet0/0
 no shutdown
 no ip address
interface GigabitEthernet0/0.20
 encapsulation dot1q 20
 ip address
interface GigabitEthernet0/0.30
 encapsulation dot1q 30
 ip address

Using subinterface number equal to VLAN ID is not mandatory. It's just for easy-reading of config file. You can choose any integer number for it (not 0).

  • So would it be appropriate to refer to all layer 3 VLANs as SVI? In addition the IP traffic on a SVI, how does that work? Is it that the VLAN created on the layer 3 connects by matching the layer 2 VLAN ID while it carries through the IP traffic? Thank you in advance.
    – phaedrus06
    Commented Sep 20, 2018 at 12:13
  • Also, in regards the description my colleague gave, does that mean the layer 3 VLAN was just between the ISP router and the customer router? if so this would mean the same thing could effectively be accomplished if you had two physical ports that were connecting using two different BGP sessions to the ISP router from the customer router correct?
    – phaedrus06
    Commented Sep 20, 2018 at 12:21
  • There's no Layer-3 VLANs. VLAN it's only Layer-2. But SVI it's a layer-3 interface assigned to VLAN. You can have VLAN's with or without SVI's if needed. You can think about SVI as router interface connected with patchcord to switch access port. Commented Sep 20, 2018 at 12:45
  • About your question regarding to multiple BGP sessions... I think it requires more details to clarify how it works. For me, I think, requirement was to terminate two VLAN's on a same L3 router interface, as I showed in UPDATE section of my post. Commented Sep 20, 2018 at 12:48
  • Thank your Andrey. I'll do some more research today and appreciate the guidance.
    – phaedrus06
    Commented Sep 20, 2018 at 13:11

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.