Exemple iBGP

De Guifi.net - Wiki Català

Aquesta és la configuració iBGP dels dos routers R1 i R2 de [Carmel guifi.net/carmel], en aquest cas s'utilitza perquè els dos routers tinguin el mateix AS, però també serveix si es fa un tunnel (ipip o eoip) entre dos routers frontera dintre d'una xarxa ospf que són fronteres de xarxes BGP.

Ambdós routers ténen a la instància el AS 51471.

Les IPs de R1 són 10.139.39.129/28 i 172.25.42.17/30
Les IPs de R2 són 10.139.39.145/28 i 172.25.42.18/30


#R1
/routing filter
add action=passthrough chain="ebgp-in CARMEL" comment="A. Set next hop" disabled=no invert-match=no set-bgp-prepend-path="" set-in-nexthop=172.25.42.18 set-out-nexthop=172.25.42.18
add action=passthrough chain="ebgp-in CARMEL" comment="B. Set pref source" disabled=no invert-match=no set-bgp-prepend-path="" set-pref-src=10.139.39.129
add action=discard chain="ebgp-in CARMEL" comment="D. Discard send non 10.x routes to BGP peer" disabled=no invert-match=no prefix=!10.0.0.0/8 prefix-length=8-32 set-bgp-prepend-path=""
add action=accept chain="ebgp-in CARMEL" comment="C. Accept 10.x routes from BGP peer" disabled=no invert-match=no prefix=10.0.0.0/8 prefix-length=8-32 set-bgp-prepend-path=""
add action=discard chain="ebgp-out CARMEL" comment="E. Discard send non 10.x routes to BGP peer" disabled=no invert-match=no prefix=!10.0.0.0/8 prefix-length=8-32 set-bgp-prepend-path=""
/routing bgp peer
add in-filter="ebgp-in CARMEL" name=BCNxsfcoopCarmelR2 out-filter="ebgp-out CARMEL" remote-address=172.25.42.18 remote-as=51471 ttl=default


#R2
/routing filter
add action=passthrough chain="ebgp-in CARMEL" comment="A. Set next hop" disabled=no invert-match=no set-bgp-prepend-path="" set-in-nexthop=172.25.42.17 set-out-nexthop=172.25.42.17
add action=passthrough chain="ebgp-in CARMEL" comment="B. Set pref source" disabled=no invert-match=no set-bgp-prepend-path="" set-pref-src=10.139.39.145
add action=discard chain="ebgp-in CARMEL" comment="D. Discard send non 10.x routes to BGP peer" disabled=no invert-match=no prefix=!10.0.0.0/8 prefix-length=8-32 set-bgp-prepend-path=""
add action=accept chain="ebgp-in CARMEL" comment="C. Accept 10.x routes from BGP peer" disabled=no invert-match=no prefix=10.0.0.0/8 prefix-length=8-32 set-bgp-prepend-path=""
add action=discard chain="ebgp-out CARMEL" comment="E. Discard send non 10.x routes to BGP peer" disabled=no invert-match=no prefix=!10.0.0.0/8 prefix-length=8-32 set-bgp-prepend-path=""
/routing bgp peer
add in-filter="ebgp-in CARMEL" name=BCNxsfcoopCarmelR1 out-filter="ebgp-out CARMEL" remote-address=172.25.42.17 remote-as=51471 ttl=default
Eines de l'usuari