From 3c66523aabce3130714a68dc70bcad553cefd751 Mon Sep 17 00:00:00 2001 From: Chris Wedgwood Date: Tue, 13 Mar 2018 21:37:16 +0000 Subject: [PATCH] calico: only specify ipv6 listen address if we have one Change-Id: I2bb381c227b06f5c511497b3e1720f9336f6d1c8 --- calico/templates/etc/bird/_bird6.cfg.mesh.template.tpl | 7 ++++--- calico/templates/etc/bird/_bird6.cfg.no-mesh.template.tpl | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/calico/templates/etc/bird/_bird6.cfg.mesh.template.tpl b/calico/templates/etc/bird/_bird6.cfg.mesh.template.tpl index 860a3aa8b..a43ea155f 100644 --- a/calico/templates/etc/bird/_bird6.cfg.mesh.template.tpl +++ b/calico/templates/etc/bird/_bird6.cfg.mesh.template.tpl @@ -5,9 +5,6 @@ include "bird6_ipam.cfg"; {{`{{$node_ip_key := printf "/host/%s/ip_addr_v4" (getenv "NODENAME")}}`}}{{`{{$node_ip := getv $node_ip_key}}`}} {{`{{$node_ip6_key := printf "/host/%s/ip_addr_v6" (getenv "NODENAME")}}`}}{{`{{$node_ip6 := getv $node_ip6_key}}`}} -# ensure we only listen to a specific ip and address -listen bgp address {{`{{$node_ip6}}`}} port {{.Values.networking.bgp.ipv6.mesh.port.listen}}; - router id {{`{{$node_ip}}`}}; # Use IPv4 address since router id is 4 octets, even in MP-BGP {{`{{define "LOGGING"}}`}} @@ -46,6 +43,10 @@ protocol direct { {{`{{if eq "" ($node_ip6)}}`}}# IPv6 disabled on this node. {{`{{else}}`}}{{`{{$node_as_key := printf "/host/%s/as_num" (getenv "NODENAME")}}`}} + +# ensure we only listen to a specific ip and address +listen bgp address {{`{{$node_ip6}}`}} port {{.Values.networking.bgp.ipv6.mesh.port.listen}}; + # Template for all BGP clients template bgp bgp_template { {{`{{template "LOGGING"}}`}} diff --git a/calico/templates/etc/bird/_bird6.cfg.no-mesh.template.tpl b/calico/templates/etc/bird/_bird6.cfg.no-mesh.template.tpl index 3493ac210..44c8731af 100644 --- a/calico/templates/etc/bird/_bird6.cfg.no-mesh.template.tpl +++ b/calico/templates/etc/bird/_bird6.cfg.no-mesh.template.tpl @@ -5,9 +5,6 @@ include "bird6_ipam.cfg"; {{`{{$node_ip_key := printf "/host/%s/ip_addr_v4" (getenv "NODENAME")}}`}}{{`{{$node_ip := getv $node_ip_key}}`}} {{`{{$node_ip6_key := printf "/host/%s/ip_addr_v6" (getenv "NODENAME")}}`}}{{`{{$node_ip6 := getv $node_ip6_key}}`}} -# ensure we only listen to a specific ip and address -listen bgp address {{`{{$node_ip6}}`}} port {{.Values.networking.bgp.ipv6.no_mesh.port.listen}}; - router id {{`{{$node_ip}}`}}; # Use IPv4 address since router id is 4 octets, even in MP-BGP {{`{{define "LOGGING"}}`}} @@ -46,6 +43,10 @@ protocol direct { {{`{{if eq "" ($node_ip6)}}`}}# IPv6 disabled on this node. {{`{{else}}`}}{{`{{$node_as_key := printf "/host/%s/as_num" (getenv "NODENAME")}}`}} + +# ensure we only listen to a specific ip and address +listen bgp address {{`{{$node_ip6}}`}} port {{.Values.networking.bgp.ipv6.no_mesh.port.listen}}; + # Template for all BGP clients template bgp bgp_template { {{`{{template "LOGGING"}}`}}