3

I have a Layer-3 switch with three VLANs and a router, using OSPF routing protocol.

My current setting:

  • A router with router-id 1.1.1.1
  • An interface connect to L3 switch with 192.168.2.1/24
  • A L3 switch with router-id 2.2.2.2
  • VLAN 1 on L3 switch 192.168.1.10/24
  • VLAN 2 on L3 switch 192.168.2.10/24, a port connected to router
  • VLAN 10 on L3 switch 192.168.10.1/24

I didn't set VLANs on the router. So maybe that's why it doesn't aware there are VLANs from 192.168.2.1/24. I have looked into InterVLAN routing and set same VLANs on router with switchport command. However, only VLAN 2 is working and I lost LSA of subnet of 192.168.2.0/24. I guess I still don't know how to achieve that.

Under current setting, I can advertise a LSA of subset 192.168.2.0/24 with a direct link on VLAN 2 to the router, and that makes OSPF network aware subnet of 192.168.2.0/24. However, I want OSPF network know it can connect to subnet of 192.168.1.0/24 and subnet of 192.168.10.0/24 too. How do I do that? Or is it possible?

2
  • Is this a router or are you routing on a layer-3 switch?
    – Ron Maupin
    Nov 25, 2015 at 2:16
  • A L3 switch support ospf and rip, and a router supports ospf and bgp.
    – Pue-Tsuâ
    Nov 25, 2015 at 2:20

3 Answers 3

2

This is with some assumptions since you didn't include a drawing or configurations.

If you have a router connected to a layer-3 switch, you should probably make the link between the two a point-to-point routed link (use no switchport on the layer-3 switch port) and give the link a point-to-point address like /30 or /31.

On the layer-3 switch, you have SVIs with IP addresses for your VLANs, and you use network statements (or redistribute connected routes) in the OSPF configuration so that OSPF will share the networks with the router.

You probably want the router to send a default route to the layer-3 switch, so you use the default-information originate command on the router, and it will inject the default route into OSPF if it exists in the routing table.

2
  • Great answer so far. But is it normal that other subnets are advertised as AS externel?
    – Pue-Tsuâ
    Nov 25, 2015 at 2:53
  • If you do a redistribution, yes. If you use network statements (you can use network 0.0.0.0 255.255.255.255 area <area> to get all the interfaces, it won't do that. Another good practice is to use passive-interface default and then no passive-interface <interface> for interfaces with OSPF neighbors. This prevents OSPF from sending hellos on toward hosts.
    – Ron Maupin
    Nov 25, 2015 at 2:58
3

may you create loopback interfaces on the router with ips in these ranges to advertise it on the OSPF.

2
  • Good idea but my router couldn't route paths to these VLANs yet.
    – Pue-Tsuâ
    Nov 25, 2015 at 2:15
  • 1
    so you must configure sup interfaces in the range of the vlans IP from the side of the router and configure trunk from switch side
    – Gadeliow
    Nov 26, 2015 at 8:26
2

You need to create subinterfaces on the router.
It's called "inter vlan routing" what you want to use.
After that you can tell OSPF to which vlans it should connect.

1
  • I have looked into it and updated my problem.
    – Pue-Tsuâ
    Nov 25, 2015 at 2:12

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.