Configuration Guide
IP Routing Configuration
OSPF Basic Configuration
7 min
introduction introduction ospf (open shortest path first) is an interior gateway protocol (igp) used for making routing decisions within a single autonomous system (as) it is an implementation of a link state routing protocol and operates within the context of an autonomous system currently, ospf version 2 (rfc2328) is used for ipv4 protocol, while ospf version 3 (rfc2740) is used for ipv6 protocol in this document, ospf refers to ospf version 2 configuration example configuration example network requirements network requirements there are three switches in the network now we need to achieve interoperability between the three switches, and later we can continue to expand the whole network based on switcha and switchb as the main service devices procedure procedure configure the vlan to which each interface belongs \# device a sonic(config)# vlan 100 sonic(config)# interface ethernet 50 sonic(config if 50)# switchport access vlan 100 \# device b sonic(config)# vlan 100 sonic(config)# vlan 200 sonic(config)# interface ethernet 50 sonic(config if 50)# switchport access vlan 100 sonic(config)# interface ethernet 49 sonic(config if 49)# switchport access vlan 200 \# device c sonic(config)# vlan 200 sonic(config)# interface ethernet 49 sonic(config if 49)# switchport access vlan 200 configure the ip address of each vlan interface \# device a sonic(config)# interface vlan 100 sonic(config vlanif 100)# ip address 30 0 0 2/30 \# device b sonic(config)# interface vlan 100 sonic(config vlanif 100)# ip address 30 0 0 1/30 sonic(config)# interface vlan 200 sonic(config vlanif 200)# ip address 20 0 0 1/30 \# device c sonic(config)# interface vlan 200 sonic(config vlanif 200)# ip address 20 0 0 2/30 configuring ospf basic features \# device a sonic(config)# router ospf sonic(config router)# network 30 0 0 1/30 area 2 \#device b sonic(config)# router ospf sonic(config router)# network 20 0 0 2/30 area 2 sonic(config router)# network 30 0 0 2/30 area 1 \#device c sonic(config)# router ospf sonic(config router)# network 20 0 0 1/30 area 1 verify configuration verify configuration take device b as an example to check the neighbor table sonic# show ip ospf neighbor neighbor id pri state dead time address interface rxmtl rqstl dbsml 10 15 96 5 1 full/backup 38 317s 20 0 0 2 ethernet49 30 11 13 22 0 0 0 10 15 96 5 1 full/backup 32 958s 30 0 0 2 ethernet50 30 11 13 26 0 0 0
