You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: confd/etc/calico/confd/templates/bird_ipam.cfg.template
+7-24
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,10 @@ function reject_disabled_pools ()
10
10
11
11
function reject_tunnel_routes () {
12
12
# Don't export tunnel routes to other nodes, Felix programs them.
13
-
# IPIP routes are handled by Bird, and it does not re-advertise them.
14
13
if (defined(ifname)) then {
15
-
if ((ifname ~ "*.cali") || (ifname ~ "*.calico")) then {
16
-
reject;
17
-
}
14
+
if ((ifname ~ "*.cali") || (ifname ~ "*.calico") || (ifname ~ "tunl0")) then {
15
+
reject;
16
+
}
18
17
}
19
18
}
20
19
@@ -67,36 +66,20 @@ function calico_export_to_bgp_peers(bool internal_peer) {
67
66
filter calico_kernel_programming {
68
67
{{- $reject_key := "/rejectcidrs"}}
69
68
{{- if ls $reject_key}}
70
-
71
69
# Don't program static routes into kernel.
72
70
{{- range ls $reject_key}}
73
71
{{- $parts := split . "-"}}
74
72
{{- $cidr := join $parts "/"}}
75
73
if ( net ~ {{$cidr}} ) then { reject; }
76
74
{{- end}}
77
-
78
75
{{- end}}
79
-
{{- if exists $network_key}}{{$network := getv $network_key}}
80
76
{{range ls "/v1/ipam/v4/pool"}}{{$data := json (getv (printf "/v1/ipam/v4/pool/%s" .))}}
77
+
{{- if or ($data.vxlan_mode) ($data.ipip_mode)}}
81
78
if ( net ~ {{$data.cidr}} ) then {
82
-
{{- if $data.vxlan_mode}}
83
-
# Don't program VXLAN routes into the kernel - these are handled by Felix.
79
+
# Don't program VXLAN or IPIP routes into the kernel - these are handled by Felix.
84
80
reject;
85
81
}
86
-
{{- else if $data.ipip_mode}}{{if eq $data.ipip_mode "cross-subnet"}}
87
-
if defined(bgp_next_hop) && ( bgp_next_hop ~ {{$network}} ) then
88
-
krt_tunnel = ""; {{- /* Destination in ipPool, mode is cross sub-net, route from-host on subnet, do not use IPIP */}}
89
-
else
90
-
krt_tunnel = "{{$data.ipip}}"; {{- /* Destination in ipPool, mode is cross sub-net, route from-host off subnet, set the tunnel (if IPIP not enabled, value will be "") */}}
91
-
accept;
92
-
} {{- else}}
93
-
krt_tunnel = "{{$data.ipip}}"; {{- /* Destination in ipPool, mode not cross sub-net, set the tunnel (if IPIP not enabled, value will be "") */}}
94
-
accept;
95
-
} {{- end}} {{- else}}
96
-
krt_tunnel = "{{$data.ipip}}"; {{- /* Destination in ipPool, mode field is not present, set the tunnel (if IPIP not enabled, value will be "") */}}
97
-
accept;
98
-
} {{- end}}
99
-
{{end}}
100
-
{{- end}}{{/* End of 'exists $network_key' */}}
82
+
{{- end}}{{/* End of '$data.vxlan_mode' */}}
83
+
{{- end}}{{/* End of 'range ls...' */}}
101
84
accept; {{- /* Destination is not in any ipPool, accept */}}
0 commit comments