Configuring OSPF (Open Shortest Path First) or BGP (Border Gateway Protocol) correctly keeps traffic moving efficiently across your network. The steps below assume Cisco IOS; adapt syntax for other platforms.
Configuring OSPF (Open Shortest Path First)
OSPF runs inside a single Autonomous System (AS). It builds a link-state database and calculates shortest paths using cost derived from interface bandwidth.
1. Plan Your Network
- Map the topology and define OSPF areas (Area 0 must be the backbone).
- Assign IP addresses and subnet masks to every router interface.
2. Enable OSPF on Routers
- Log into each router and enter configuration mode.
- Start the OSPF process and declare participating networks.
Example Configuration (Cisco IOS):
router ospf 1
network 192.168.1.0 0.0.0.255 area 0
network 192.168.2.0 0.0.0.255 area 0
– The network command uses a wildcard mask to select interfaces and assign them to an area.
– Area 0 is mandatory for inter-area routing.
3. Set Interface Priorities
- Influence DR/BDR election on multi-access segments:
interface GigabitEthernet0/0
ip ospf priority 100
4. Verify OSPF Neighbor Relationships
- Confirm adjacencies and learned routes:
show ip ospf neighbor
show ip route ospf
5. Tune OSPF Parameters (Optional)
- Adjust timers, enable authentication, or override cost:
ip ospf hello-interval 10
ip ospf authentication message-digest
ip ospf cost 10
Configuring BGP (Border Gateway Protocol)
BGP exchanges routes between autonomous systems. It selects paths using attributes such as AS-path, next-hop, local preference, and MED.
1. Plan Your BGP Deployment
- Record your local AS number and each peer’s AS number.
- Decide which prefixes to originate and what inbound/outbound policies you need.
2. Enable BGP on Routers
- Enter BGP configuration mode, set the local AS, and define neighbors.
- Advertise your networks with the
networkstatement (exact prefix/mask match required).
Example Configuration (Cisco IOS):
router bgp 65001
neighbor 192.168.1.2 remote-as 65002
network 10.0.0.0 mask 255.255.255.0
– 65001 is the local AS; 65002 is the peer AS.
– The network command injects a prefix into the BGP table only if it exists in the routing table.
3. Configure BGP Attributes
- Manipulate weight, local preference, MED, or prepend AS-path to steer traffic.
4. Apply Route Filtering (Optional)
- Control advertised/received prefixes with prefix-lists and route-maps:
ip prefix-list MY-PREFIX seq 5 permit 10.0.0.0/24
route-map FILTER-IN permit 10
match ip address prefix-list MY-PREFIX
router bgp 65001
neighbor 192.168.1.2 route-map FILTER-IN in
5. Verify BGP Configuration
- Check session state and routing table:
show ip bgp summary
show ip bgp neighbors
show ip route bgp
6. Enable BGP Authentication (Optional)
- Secure the TCP session with MD5:
neighbor 192.168.1.2 password your_secure_password
Best Practices for OSPF and BGP
- Documentation: Keep current topology maps, AS assignments, and area designs.
- Authentication: Enable MD5 (or SHA where supported) on every routing session.
- Monitor: Use
showcommands and your NMS to catch flapping neighbors or missing routes. - Tune timers: Lower hello/dead intervals for faster convergence where link reliability allows.
- Lab first: Validate every change in a test environment before production rollout.
- Backup configs: Archive running and startup configurations daily.

Ali YAZICI is a Senior IT Infrastructure Manager with 15+ years of enterprise experience. While a recognized expert in datacenter architecture, multi-cloud environments, storage, and advanced data protection and Commvault automation , his current focus is on next-generation datacenter technologies, including NVIDIA GPU architecture, high-performance server virtualization, and implementing AI-driven tools. He shares his practical, hands-on experience and combination of his personal field notes and “Expert-Driven AI.” he use AI tools as an assistant to structure drafts, which he then heavily edit, fact-check, and infuse with my own practical experience, original screenshots , and “in-the-trenches” insights that only a human expert can provide.
If you found this content valuable, [support this ad-free work with a coffee]. Connect with him on [LinkedIn].





