Configuration Guide
OSPF Configuration Guide
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 configuring ospf neighbor configuring ospf neighbor network requirements there are three devices in the network now we need to achieve interoperability between the three devices, and later we can continue to expand the whole network based on devicea and deviceb as the main service devices procedure 1 configure the vlan to which each interface belongs \# device a sonic(config)# vlan 100 sonic(config)# interface ethernet 5 sonic(config if 5)# switchport access vlan 100 \# device b sonic(config)# vlan 100 sonic(config)# vlan 200 sonic(config)# interface ethernet 5 sonic(config if 5)# switchport access vlan 100 sonic(config)# interface ethernet 4 sonic(config if 4)# switchport access vlan 200 \# device c sonic(config)# vlan 200 sonic(config)# interface ethernet 4 sonic(config if 4)# switchport access vlan 200 2 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 3 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 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 ethernet4 30 11 13 22 0 0 0 10 15 96 5 1 full/backup 32 958s 30 0 0 2 ethernet5 30 11 13 26 0 0 0
