]>
Commit | Line | Data |
---|---|---|
12919c42 PG |
1 | #!/usr/bin/env python |
2 | ||
3 | """ | |
4 | exa-send.py: Send a few testroutes with ExaBGP | |
5 | """ | |
6 | ||
787e7624 | 7 | from sys import stdout, argv |
12919c42 PG |
8 | from time import sleep |
9 | ||
10 | sleep(5) | |
11 | ||
12 | # 1st arg is peer number | |
13 | # 2nd arg is number of routes to send | |
14 | peer = int(argv[1]) | |
15 | numRoutes = int(argv[2]) | |
16 | asnum = 99 | |
17 | ||
18 | # Announce numRoutes equal routes per PE - different neighbor AS | |
19 | for i in range(0, numRoutes): | |
787e7624 | 20 | stdout.write( |
21 | "announce route 10.201.%s.0/24 med 100 community %i:1 next-hop 10.0.%i.%i\n" | |
22 | % (i, i, (((peer - 1) / 5) + 1), peer + 100) | |
23 | ) | |
12919c42 PG |
24 | stdout.flush() |
25 | ||
787e7624 | 26 | # Loop endlessly to allow ExaBGP to continue running |
12919c42 PG |
27 | while True: |
28 | sleep(1) |