summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2006-01-07 17:43:50 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2006-01-07 17:43:50 +0000
commita16d703c48d3f6d48ec8d66df294ca75be67b9b7 (patch)
treea82e32c57af23761bc82465a4e484699f93afa15
parent6421e45c29538235724040e17c0739a0e487e1f3 (diff)
Make default networks configureable
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@53 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-xGenerate23
1 files changed, 12 insertions, 11 deletions
diff --git a/Generate b/Generate
index a942738..3dca294 100755
--- a/Generate
+++ b/Generate
@@ -75,13 +75,6 @@ log syslog
!debug bgp updates
!
'
-QUAGGA_BGPD_DEFAULT_PREFIX_LIST_PERMIT=
-'
-ip prefix-list LISTNAME seq 10 permit 10.200.0.0/16 le 32
-ip prefix-list LISTNAME seq 11 permit 172.22.0.0/16 le 32
-ip prefix-list LISTNAME seq 12 permit 192.168.224.0/24 le 32'
-
-QUAGGA_BGPD_DEFAULT_PREFIX_LIST_STARTEXTRASEQ = 31
DEFAULT_OPENSSLCNF = '
HOME = CA
oid_section = new_oids
@@ -426,15 +419,23 @@ hostlist.each{ |host|
bgpdfilename = "#{dir}/#{$NAMESPACE}.quagga.bgpd"
bgpd = File.new(bgpdfilename, "w")
bgpd.puts QUAGGA_BGPD_HEAD.gsub('HOSTNAME', host['name'])
- bgpd.puts QUAGGA_BGPD_DEFAULT_PREFIX_LIST_PERMIT.gsub('LISTNAME', 'VPNn2')
+ count = 10
+ makelist($config['default_networks']).each{ |net|
+ bgpd.puts "ip prefix-list VPNn2 seq #{count} permit #{net} #{net =~ /\/32/ ? '' : "le 32"}"
+ count = count + 1
+ }
bgpd.puts "!"
%w(import export).each{ |inout|
if host.has_key?('extra_'+inout)
host['extra_'+inout].each_pair{ |peer, extras|
listname = makelistname(peer, inout)
- bgpd.puts QUAGGA_BGPD_DEFAULT_PREFIX_LIST_PERMIT.gsub('LISTNAME', listname) unless host.has_key?('no_defaults_'+inout) and
- host['no_defaults_'+inout]
- count = QUAGGA_BGPD_DEFAULT_PREFIX_LIST_STARTEXTRASEQ
+ count = 10
+ unless host['no_defaults_'+inout]
+ makelist($config['default_networks']).each{ |net|
+ bgpd.puts "ip prefix-list #{listname} seq #{count} permit #{net} #{net =~ /\/32/ ? '' : "le 32"}"
+ count = count + 1
+ }
+ end
makelist(extras).each{ |net|
bgpd.puts "ip prefix-list #{listname} seq #{count} permit #{net} #{net =~ /\/32/ ? '' : "le 32"}"
count = count + 1