Showing results for 
Search instead for 
Did you mean: 

OSPF on vlan interfaces


Will this configuration work for ospf routing on a vlan interface on a 3850 L3 switch? Never done it on a vlan interface before but having trouble getting it to work in GNS3.


interface Vlan100
ip address
ip ospf network broadcast

router ospf 100
redistribute connected metric 1 subnets
network area 0
network area 0
network area 0

passive-interface default

no passive-interface vlan 100

1 Accepted Solution

Accepted Solutions
16 Replies 16

MHM Cisco World

I think if you use GNS3 L3SW image then it will not work, 
you need VM IOS2 to make it work.
your config is OK but this is limitation of GNS3.

David Ruess
Rising star
Rising star


Will it work, yes. Will it form an adjacency with another neighbor, no. What the

 OSPF network 

command does is enable OSPF in the range of networks you specify. If one of those IP's are on a physical interface and the other side agrees then it will for an adjacency. I'm pretty sure you cant form an adjacency on a SVI.

Hope that helps



Why will this not work?

Our L3 switch has the

vlan interface 

and that

network area 0

will be advertised in OSPF. The neighboring router will have an ip address on the 192.168.100.x/24 subnet connected to

vlan 100


not sure if I'm missing something. Please explain.

in real network
each L3SW have SVI of

VLAN 100

config L2 trunk between both L3SW 
then both L3SW will establish OSPF between the SVI of both L3SW,
but here gns3 with ethermodule so if you do above config and not work then this is limit of gns3.

Sorry was not clear. Our end is a cisco 3850 L3 switch. The other OSPF neighbor is a velocloud SDWAN router using a L3 interface, not a L3 switch. this is the plan for our real production network.


I was testing it in GNS3 just to see if it would work.



for real 
config SVI for VLAN 
config other subnet for interconnect between L3SW and Router (the port connect L3SW to router must be router port here)
run OSPF in for interconnect subnet 
config SVI for VLAN 
config interconnect but this time it L2 not L3 (l2 port of L3SW connect to router)
run OSPF in SVI 

for these config you can use PKT since it simple.

I will make lab in PKT share here with some command.

FYI, we have our L3 switch SVI connecting with static routes to an AT&T DMVPN router and MPLS router. The idea was to have this new SDWAN router also connected to the same SVI but with a dynamic routing protocol.  THe SDWAN router needs to be able to forward traffic directly to the adjacent DMVPN/MPLS routers for prefixes in the DMVPN and MPLS networks. 


R0.pngR1 config.png

this small LAB
one L3SW in middle connect to two router, 
i config the both case using VLAN and using router port.


This works i packet tracer but not GNS3?????



As i mention, both pkt and gns3 have some limitations.

In your case l3sw need vm to work the local host gns3 with sw image not work.

Joseph W. Doherty
Hall of Fame Master Hall of Fame Master
Hall of Fame Master

No experience on 3850s, but I have used OSPF, with SVIs, on many other Catalyst switches, e.g. 3560s, 3750s, 4500s, 6500s, although usually, not always, just as passive (i.e. edge) networks.

Regarding GNS3, I recall it doesn't well support switches.

BTW, unsure you need

ip ospf network broadcast

under SVI.

Why are you both (?) noting specific networks for inclusion in OSPF and redistributing connected networks?

Why are you using a non-loopback interface for/with your router-id?

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers