|
|
# BGP example 1
|
|
|
|
|
|
Here is an example of a gateway router for a leaf AS, which uses BGP just for propagating its prefixes to its upstream ISP. The config uses two static protocols named static_bgp and static_ospf. First one is used for prefixes that are propagated to the upstream ISP. These prefixes are represented as unreachable routes, which seems strange but it does not matter for BGP and has a secondary advantage that packets for AS-local but unreachable destinations are rejected and not sent to the upstream. The second static protocol (static_ospf) specifies the default route, which is used both locally and propagated to the OSPF protocol.
|
|
|
|
|
|
Because we use BGP protocol just to propagate our prefixes and we use the default route, we could ignore received prefixes (_import none_ in BGP) so we don't need any filtering. XXXX is the local ASN, YYYY is the upstream ASN and W.X.Y.Z is the IP address of the upstream BGP router.
|
|
|
|
|
|
log syslog all;
|
|
|
|
|
|
router id A.B.C.D;
|
|
|
|
|
|
protocol device {
|
|
|
scan time 10;
|
|
|
}
|
|
|
|
|
|
protocol kernel {
|
|
|
export all;
|
|
|
scan time 15;
|
|
|
}
|
|
|
|
|
|
protocol static static_bgp {
|
|
|
import all;
|
|
|
|
|
|
route A.B.C.0/24 reject;
|
|
|
route D.E.F.0/24 reject;
|
|
|
}
|
|
|
|
|
|
protocol static static_ospf {
|
|
|
import all;
|
|
|
|
|
|
route 0.0.0.0/0 via W.X.Y.Z;
|
|
|
}
|
|
|
|
|
|
protocol bgp {
|
|
|
import none;
|
|
|
export where proto = "static_bgp";
|
|
|
|
|
|
local as XXXX;
|
|
|
neighbor W.X.Y.Z as YYYY;
|
|
|
}
|
|
|
|
|
|
protocol ospf {
|
|
|
import all;
|
|
|
export where proto = "static_ospf";
|
|
|
|
|
|
...
|
|
|
} |