pingping-lin | ebb6fe4 | 2015-08-31 17:59:33 -0700 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | |
| 3 | for i in range(1, 101): |
| 4 | num= i + 100 |
| 5 | |
| 6 | v='quagga%d.conf' %num |
| 7 | f=open(v, 'w') |
| 8 | |
| 9 | f.write('hostname bgpd\n') |
| 10 | f.write('password hello\n') |
| 11 | k=i + 65000 |
| 12 | v='router bgp %d\n' % (k) |
| 13 | f.write(v) |
| 14 | v='bgp router-id 192.168.40.%d\n' %i |
| 15 | f.write(v) |
| 16 | v='neighbor 192.168.40.101 remote-as 64513\n' |
| 17 | f.write(v) |
| 18 | #print v |
| 19 | |
| 20 | v='neighbor 192.168.40.101 ebgp-multihop\n' |
| 21 | f.write(v) |
| 22 | v='neighbor 192.168.40.101 update-source 192.168.40.%d\n' %i |
| 23 | f.write(v) |
| 24 | v='neighbor 192.168.40.101 timers connect 300\n' |
| 25 | f.write(v) |