| 1 |
/* |
| 2 |
* This is an example configuration file for MP-BGP setting |
| 3 |
*/ |
| 4 |
|
| 5 |
|
| 6 |
log "bird.log" all; |
| 7 |
# debug protocols all; |
| 8 |
|
| 9 |
router id 192.168.1.1; |
| 10 |
|
| 11 |
ipv4 table master4; |
| 12 |
ipv6 table master6; |
| 13 |
|
| 14 |
ipv4 table mcast4; |
| 15 |
ipv6 table mcast6; |
| 16 |
|
| 17 |
ipv4 table mtab4; |
| 18 |
ipv6 table mtab6; |
| 19 |
|
| 20 |
vpn4 table vpntab4; |
| 21 |
vpn6 table vpntab6; |
| 22 |
|
| 23 |
vpn4 table vpn4mc; |
| 24 |
vpn6 table vpn6mc; |
| 25 |
|
| 26 |
flow4 table flowtab4; |
| 27 |
flow6 table flowtab6; |
| 28 |
|
| 29 |
|
| 30 |
protocol device { |
| 31 |
} |
| 32 |
|
| 33 |
protocol kernel kernel4 { |
| 34 |
ipv4 { |
| 35 |
export all; |
| 36 |
}; |
| 37 |
} |
| 38 |
|
| 39 |
protocol kernel kernel6 { |
| 40 |
ipv6 { |
| 41 |
export all; |
| 42 |
}; |
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
protocol static static4 { |
| 47 |
ipv4; |
| 48 |
|
| 49 |
route 10.10.0.0/24 via 192.168.1.2; |
| 50 |
route 10.10.1.0/24 via 192.168.1.2 { bgp_large_community.add((10,20,30)); bgp_large_community.add((10,(20*3),10)); }; |
| 51 |
} |
| 52 |
|
| 53 |
protocol static static6 { |
| 54 |
ipv6; |
| 55 |
|
| 56 |
route 2001:db8:10:10::/64 via 2001:db8:1:1::10; |
| 57 |
route 2001:db8:10:11::/64 via 2001:db8:1:1::10; |
| 58 |
|
| 59 |
route 2001:db8:1:1::/64 via fe80::ec9b:67ff:fe60:fd5d % ve1; |
| 60 |
} |
| 61 |
|
| 62 |
# VPNv4 routes with MPLS labels |
| 63 |
protocol static statvpn4 { |
| 64 |
vpn4; |
| 65 |
|
| 66 |
route 10:10 10.20.0.0/24 via 192.168.1.2 mpls 210; |
| 67 |
route 10:10 10.20.1.0/24 via 192.168.1.2 mpls 210; |
| 68 |
route 10:20 10.20.0.0/24 via 192.168.1.2 mpls 220; |
| 69 |
route 10:20 10.20.1.0/24 via 192.168.1.2 mpls 220; |
| 70 |
} |
| 71 |
|
| 72 |
protocol static statvpn6 { |
| 73 |
vpn6; |
| 74 |
|
| 75 |
route 10:10 2001:db8:20:10::/64 via 2001:db8:1:1::10 mpls 200/210; |
| 76 |
route 10:10 2001:db8:20:11::/64 via 2001:db8:1:1::10 mpls 200/210; |
| 77 |
route 10:20 2001:db8:20:10::/64 via 2001:db8:1:1::10 mpls 200/220; |
| 78 |
route 10:20 2001:db8:20:11::/64 via 2001:db8:1:1::10 mpls 200/220; |
| 79 |
} |
| 80 |
|
| 81 |
# RFC 8955 flow specification |
| 82 |
protocol static flowstat4 { |
| 83 |
flow4; |
| 84 |
|
| 85 |
route flow4 { |
| 86 |
dst 10.0.0.0/8; |
| 87 |
proto = 23; |
| 88 |
dport > 24 && < 30 || 40..50,60..70,80; |
| 89 |
sport > 24 && < 30 || = 40 || 50,60..70,80; |
| 90 |
icmp type 80; |
| 91 |
icmp code 90; |
| 92 |
tcp flags 0x03/0x0f; |
| 93 |
length 2048..65535; |
| 94 |
dscp = 63; |
| 95 |
fragment dont_fragment, is_fragment || !first_fragment; |
| 96 |
}; |
| 97 |
|
| 98 |
route flow4 { |
| 99 |
dst 11.0.0.0/8; |
| 100 |
proto = 0x12; |
| 101 |
sport > 0x5678 && < 0x9abc || 0xdef0 || 0x1234,0x5678,0x9abc..0xdef0; |
| 102 |
dport = 50; |
| 103 |
tcp flags 0x000/0xf00; |
| 104 |
}; |
| 105 |
|
| 106 |
route flow4 { |
| 107 |
dst 12.0.0.0/32; |
| 108 |
tcp flags ! 0/0x999; |
| 109 |
}; |
| 110 |
|
| 111 |
route flow4 { |
| 112 |
dst 220.0.254.0/24; |
| 113 |
tcp flags 0x99/0x999; |
| 114 |
}; |
| 115 |
|
| 116 |
route flow4 { |
| 117 |
dst 220.0.254.192/28; |
| 118 |
tcp flags ! 0xfff/0xfff; |
| 119 |
}; |
| 120 |
|
| 121 |
route flow4 { |
| 122 |
dst 15.0.0.0/8; |
| 123 |
tcp flags ! 0x999/0x999; |
| 124 |
}; |
| 125 |
} |
| 126 |
|
| 127 |
# RFC 8956 flow specification |
| 128 |
protocol static flowstat6 { |
| 129 |
flow6; |
| 130 |
|
| 131 |
route flow6 { |
| 132 |
dst fec0:1122:3344:5566::1/128; |
| 133 |
src 0000:0000:0000:0001:1234:5678:9800:0000/101 offset 63; |
| 134 |
next header = 23; |
| 135 |
sport 24..30, 42 || 50,60,70..80; |
| 136 |
dport = 50; |
| 137 |
tcp flags 0x03/0x0f, !0/0xff || 0x33/0x33; |
| 138 |
fragment !is_fragment || !first_fragment; |
| 139 |
label > 1111 && != 1234; |
| 140 |
}; |
| 141 |
|
| 142 |
route flow6 { |
| 143 |
dst fec0:1122:3344:5566::1/128; |
| 144 |
src ::1:1234:5678:9800:0/101 offset 63; |
| 145 |
next header = 23; |
| 146 |
dport = 50; |
| 147 |
sport > 24 && < 30 || = 40 || = 50 || = 60 || >= 70 && <= 80; |
| 148 |
tcp flags 0x3/0x3 && 0x0/0xc; |
| 149 |
}; |
| 150 |
} |
| 151 |
|
| 152 |
|
| 153 |
protocol pipe { |
| 154 |
table master4; |
| 155 |
peer table mcast4; |
| 156 |
import none; |
| 157 |
export where source = RTS_OSPF; |
| 158 |
} |
| 159 |
|
| 160 |
protocol pipe { |
| 161 |
table master6; |
| 162 |
peer table mcast6; |
| 163 |
import none; |
| 164 |
export where source = RTS_OSPF; |
| 165 |
} |
| 166 |
|
| 167 |
protocol ospf v2 ospf4 { |
| 168 |
ipv4 { |
| 169 |
import all; |
| 170 |
# export where source = RTS_STATIC; |
| 171 |
}; |
| 172 |
|
| 173 |
area 0 { |
| 174 |
interface "ve0" { stub; }; |
| 175 |
interface "ve1" { hello 5; type ptp; }; |
| 176 |
interface "ve2" { hello 5; type bcast; ttl security; }; |
| 177 |
interface "ve3" { hello 5; type bcast; ttl security; }; |
| 178 |
}; |
| 179 |
} |
| 180 |
|
| 181 |
|
| 182 |
protocol ospf v3 ospf6 { |
| 183 |
ipv6 { |
| 184 |
import all; |
| 185 |
# export where source = RTS_STATIC; |
| 186 |
}; |
| 187 |
|
| 188 |
area 0 { |
| 189 |
interface "ve0" { stub; }; |
| 190 |
interface "ve1" { hello 5; type ptp; }; |
| 191 |
interface "ve2" { hello 5; type bcast; }; |
| 192 |
}; |
| 193 |
} |
| 194 |
|
| 195 |
protocol bgp { |
| 196 |
local 192.168.11.1 as 1000; |
| 197 |
neighbor 192.168.11.2 as 2000; |
| 198 |
# local 192.168.1.1 as 1000; |
| 199 |
# neighbor 192.168.2.1 as 2000; |
| 200 |
# multihop; |
| 201 |
# rr client; |
| 202 |
# strict bind; |
| 203 |
# debug all; |
| 204 |
|
| 205 |
# regular IPv4 unicast (1/1) |
| 206 |
ipv4 { |
| 207 |
# connects to master4 table by default |
| 208 |
import all; |
| 209 |
export where source ~ [ RTS_STATIC, RTS_BGP ]; |
| 210 |
}; |
| 211 |
|
| 212 |
# regular IPv6 unicast (2/1) |
| 213 |
ipv6 { |
| 214 |
# connects to master6 table by default |
| 215 |
import all; |
| 216 |
export where source ~ [ RTS_STATIC, RTS_BGP ]; |
| 217 |
# next hop address 2001:db8:1:1::1; |
| 218 |
}; |
| 219 |
|
| 220 |
# IPv4 multicast topology (1/2) |
| 221 |
ipv4 multicast { |
| 222 |
# explicit IPv4 table |
| 223 |
table mcast4; |
| 224 |
import all; |
| 225 |
export all; |
| 226 |
}; |
| 227 |
|
| 228 |
# IPv6 multicast topology (2/2) |
| 229 |
ipv6 multicast { |
| 230 |
# explicit IPv6 table |
| 231 |
table mcast6; |
| 232 |
import all; |
| 233 |
export all; |
| 234 |
# next hop address 2001:db8:1:1::1; |
| 235 |
}; |
| 236 |
|
| 237 |
# IPv4 with MPLS labels (1/4) |
| 238 |
ipv4 mpls { |
| 239 |
# explicit IPv4 table |
| 240 |
table mtab4; |
| 241 |
import all; |
| 242 |
export all; |
| 243 |
}; |
| 244 |
|
| 245 |
# IPv6 with MPLS labels (2/4) |
| 246 |
ipv6 mpls { |
| 247 |
# explicit IPv6 table |
| 248 |
table mtab6; |
| 249 |
import all; |
| 250 |
export all; |
| 251 |
# allows IPv4 next hops (6PE) |
| 252 |
# extended next hop; |
| 253 |
}; |
| 254 |
|
| 255 |
# VPNv4 with MPLS labels (1/128) |
| 256 |
vpn4 mpls { |
| 257 |
# connects to vpntab4 table by default |
| 258 |
import all; |
| 259 |
export all; |
| 260 |
}; |
| 261 |
|
| 262 |
# VPNv6 with MPLS labels (2/128) |
| 263 |
vpn6 mpls { |
| 264 |
# connects to vpntab6 table by default |
| 265 |
import all; |
| 266 |
export all; |
| 267 |
}; |
| 268 |
|
| 269 |
# VPNv4 multicast topology (1/129) |
| 270 |
vpn4 multicast { |
| 271 |
table vpn4mc; |
| 272 |
import all; |
| 273 |
export all; |
| 274 |
}; |
| 275 |
|
| 276 |
# VPNv6 multicast topology (2/129) |
| 277 |
vpn6 multicast { |
| 278 |
table vpn6mc; |
| 279 |
import all; |
| 280 |
export all; |
| 281 |
}; |
| 282 |
|
| 283 |
# IPv4 Flowspec (1/133) |
| 284 |
flow4 { |
| 285 |
# connects to flowtab4 table by default |
| 286 |
import all; |
| 287 |
export all; |
| 288 |
}; |
| 289 |
|
| 290 |
# IPv6 Flowspec (2/133) |
| 291 |
flow6 { |
| 292 |
# connects to flowtab6 table by default |
| 293 |
import all; |
| 294 |
export all; |
| 295 |
}; |
| 296 |
} |
| 297 |
|
| 298 |
protocol bgp { |
| 299 |
local 192.168.1.1 as 1000; |
| 300 |
neighbor 192.168.3.1 as 1000; |
| 301 |
multihop; |
| 302 |
rr client; |
| 303 |
|
| 304 |
ipv4 { |
| 305 |
import all; |
| 306 |
export where source ~ [ RTS_STATIC, RTS_BGP ]; |
| 307 |
}; |
| 308 |
|
| 309 |
ipv6 { |
| 310 |
import all; |
| 311 |
export where source ~ [ RTS_STATIC, RTS_BGP ]; |
| 312 |
next hop address 2001:db8:1:1::1; |
| 313 |
}; |
| 314 |
} |
| 315 |
|
| 316 |
protocol bgp { |
| 317 |
local 2001:db8:1:1::1 as 1000; |
| 318 |
neighbor 2001:db8:4:1::1 as 1000; |
| 319 |
multihop; |
| 320 |
rr client; |
| 321 |
|
| 322 |
ipv4 { |
| 323 |
import all; |
| 324 |
export where source ~ [ RTS_STATIC, RTS_BGP ]; |
| 325 |
next hop address 192.168.4.1; |
| 326 |
}; |
| 327 |
|
| 328 |
ipv6 { |
| 329 |
import all; |
| 330 |
export where source ~ [ RTS_STATIC, RTS_BGP ]; |
| 331 |
}; |
| 332 |
} |
| 333 |
|