This repository showcases a simple lab to practice BGP path selection for both inbound and outbound traffic. The lab uses a scenario where one ISP has a higher bandwidth link compared to the other, requiring BGP tuning to influence traffic. Local Preference and AS Path Prepending are used in this lab. The IP 4.4.4.4 is used as an example Internet resource.
- Pnetlabs
- 4 Cisco routers
Loopbacks:
| Router | Loopback |
|---|---|
| R1 | 1.1.1.1/32 |
| ISP2 | 2.2.2.2/32 |
| ISP3 | 3.3.3.3/32 |
| Internet | 4.4.4.4/32 |
Links:
| Link | Network |
|---|---|
| R1–ISP2 | 10.0.12.0/30 |
| R1–ISP3 | 10.0.13.0/30 |
| ISP2–Internet | 10.0.24.0/30 |
| ISP3–Internet | 10.0.34.0/30 |
- Without BGP tuning, the link via ISP2 is selected because it has the lower Router ID, which is used as the tiebreaker when other attributes are equal.
- Outbound Traffic: Local Preference is used to influence R1's exit path. Weight could also be used.
- Inbound Traffic: AS Path Prepending is used to influence traffic arriving at R1. MED could also be used.
Steps:
- A route-map for ISP3 is created and assigned a Local Preference of 200.
- A route-map for ISP2 is optionally assigned a Local Preference of 100.
- The route-maps are applied to the respective BGP neighbors.
- A route-map for AS Path Prepending is created, adding
65001 65001to the path for ISP2. - The AS Path prepend route-map is applied to ISP2.
- After tuning, the link via ISP3 is now preferred for both inbound and outbound traffic at R1.
- Show commands (
show ip bgp,show run | begin bgp) confirm the route-maps are applied and working as intended.





