Enterprise AV Home WiFi Mobile Wifi Support Shop Deals

The following figure shows an OSPF sample network.

Image

  1. Enable routing for the switch.

    (Netgear Switch) #config
    (Netgear Switch) (Config)#ip routing

     
  2. Enable routing and assign IPs for ports 1/0/2, 1/0/3, and 1/0/4.

    (Netgear Switch) (Config)#interface 1/0/2
    (Netgear Switch) (Interface 1/0/2)#routing
    (Netgear Switch) (Interface 1/0/2)#ip address 192.150.2.2 255.255.255.0
    (Netgear Switch) (Interface 1/0/2)#exit
    (Netgear Switch) (Config)#interface 1/0/3
    (Netgear Switch) (Interface 1/0/3)#routing
    (Netgear Switch) (Interface 1/0/3)#ip address 192.130.3.1 255.255.255.0
    (Netgear Switch) (Interface 1/0/3)#exit
    (Netgear Switch) (Config)#interface 1/0/4
    (Netgear Switch) (Interface 1/0/4)#routing
    (Netgear Switch) (Interface 1/0/4)#ip address 192.64.4.1 255.255.255.0
    (Netgear Switch) (Interface 1/0/4)#exit

     
  3. Specify the router ID, and enable OSPF for the switch. Set disable 1583compatibility to prevent a routing loop.

    (Netgear Switch) (Config)#router ospf
    (Netgear Switch) (Config router)#enable
    (Netgear Switch) (Config router)#router-id 192.130.1.1
    (Netgear Switch) (Config router)#no 1583compatibility
    (Netgear Switch) (Config router)#exit
    (Netgear Switch) (Config)#exit

     
  4. Enable OSPF for the ports, and set the OSPF priority and cost for the ports.

    (Netgear Switch) #config
    (Netgear Switch) (Config)#interface 1/0/2
    (Netgear Switch) (Interface 1/0/2)#ip ospf
    (Netgear Switch) (Interface 1/0/2)#ip ospf area 0.0.0.2
    (Netgear Switch) (Interface 1/0/2)#ip ospf priority 128
    (Netgear Switch) (Interface 1/0/2)#ip ospf cost 32
    (Netgear Switch) (Interface 1/0/2)#exit

    (Netgear Switch) (Config)#interface 1/0/3
    (Netgear Switch) (Interface 1/0/3)#ip ospf
    (Netgear Switch) (Interface 1/0/3)#ip ospf area 0.0.0.2
    (Netgear Switch) (Interface 1/0/3)#ip ospf priority 255
    (Netgear Switch) (Interface 1/0/3)#ip ospf cost 64
    (Netgear Switch) (Interface 1/0/3)#exit

    (Netgear Switch) (Config)#interface 1/0/4
    (Netgear Switch) (Interface 1/0/4)#ip ospf
    (Netgear Switch) (Interface 1/0/4)#ip ospf area 0.0.0.2
    (Netgear Switch) (Interface 1/0/4)#ip ospf priority 255
    (Netgear Switch) (Interface 1/0/4)#ip ospf cost 64
    (Netgear Switch) (Interface 1/0/4)#exit
    (Netgear Switch) (Config)#exit


For more information, see the following support articles:

 

XSM7224S - firmware version 9.0.1.x: license required to support the feature described in this article

Last Updated:07/07/2025 | Article ID: 21676

Our team is here to help!

Phone
Chat
Email