Skip to content

Instantly share code, notes, and snippets.

@goffinet
Last active August 6, 2019 13:42
Show Gist options
  • Save goffinet/c12e31747db3af4ee70342cc5e1ce5ed to your computer and use it in GitHub Desktop.
Save goffinet/c12e31747db3af4ee70342cc5e1ce5ed to your computer and use it in GitHub Desktop.

Exercices BGP

BGP 1

Topologie

Note

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13762-40.html

Setup

ISP1

conf t
hostname ISP1
interface Lo0
description ISP1 Internet Network
ip address 10.1.1.1 255.255.255.0
exit
interface G0/2
description ISP1 -> ITA
ip address 10.0.0.1 255.255.255.252
no shutdown
end
wr

ITA

conf t
hostname ITA
interface Lo0
description Core router network link 1
ip address 192.168.0.1 255.255.255.0
exit
interface Lo1
description Core router network link 2
ip address 192.168.1.1 255.255.255.0
exit
interface G0/1
description ITA -> ISP1
ip address 10.0.0.2 255.255.255.252
no shutdown
exit
interface G0/3
description ITA -> ISP2
ip address 172.16.0.2 255.255.255.252
no shutdown
end
wr

ISP2

conf t
hostname ISP2
interface Lo0
description ISP2 Internet Network
ip address 172.16.1.1 255.255.255.0
exit
interface G0/2
description ISP2 -> ITA
ip address 172.16.0.1 255.255.255.252
no shutdown
end
wr

Configuration BGP

ISP1

router bgp 200
neighbor 10.0.0.2 remote-as 100
network 10.1.1.0 mask 255.255.255.0

ISP2

router bgp 300
neighbor 172.16.0.2 remote-as 100
network 172.16.1.0 mask 255.255.255.0

ITA

router bgp 100
neighbor 10.0.0.1 remote-as 200
neighbor 172.16.0.1 remote-as 300
network 192.168.0.0
network 192.168.1.0

test

tclsh
foreach address {
10.0.0.1
10.0.0.2
10.1.1.1
172.16.0.1
172.16.0.2
172.16.1.1
192.168.0.1
192.168.1.1
} {
ping $address }
show ip bgp

Filtrage sur RTA

access-list 1 permit 192.168.0.0 0.0.1.255
router bgp 100
neighbor 10.0.0.1 distribute-list 1 out
neighbor 172.16.0.1 distribute-list 1 out

Routes statiques flottantes sur RTA

ip route 0.0.0.0 0.0.0.0 10.0.0.1 210
ip route 0.0.0.0 0.0.0.0 172.16.0.1 220

sur ISP1

int lo 100
ip address 192.168.100.1 255.255.255.0

Désactivation des routes statiques

no ip route 0.0.0.0 0.0.0.0 10.0.0.1 210
no ip route 0.0.0.0 0.0.0.0 172.16.0.1 220

BGP propage une route par défaut

Sur ISP1

router bgp 200
neighbor 10.0.0.2 default-originate

Sur ISP2

router bgp 300

BGP 2

Topologie

Setup

ISP

conf t
hostname R2-ISP
interface Loopback0
ip address 10.2.2.1 255.255.255.0
interface G0/1
ip address 192.168.1.6 255.255.255.252
no shutdown
exit
interface G0/3
ip address 172.24.1.17 255.255.255.252
no shutdown
end
wr

SanJose

conf t
hostname R1-SanJose
interface Loopback0
ip address 10.1.1.1 255.255.255.0
exit
interface G0/2
ip address 192.168.1.5 255.255.255.252
no shutdown
end
wr

CustRtr

conf t
hostname CustRtr
interface Loopback0
ip address 10.3.3.1 255.255.255.0
exit
interface G0/2
ip address 172.24.1.18 255.255.255.252
no shutdown
end
wr

Test

A partir de ISP :

ping 172.24.1.18
ping 192.168.1.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment