diff options
-rwxr-xr-x | Generate | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -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 |