5591cd5032401bb0fea431e933e1d2ea07d8a095
_Sidebar.md
| ... | ... | @@ -46,16 +46,10 @@ |
| 46 | 46 | * Internal |
| 47 | 47 | * [Internal services](/internal/Internal-Services) |
| 48 | 48 | * [APIs](/internal/APIs) |
| 49 | - * [Show and Tell](/internal/ShowAndTell) |
|
| 50 | - * [Historical services](/internal/Historical-Services) |
|
| 51 | - |
|
| 52 | -* Historical |
|
| 53 | - * [Bird 1](/historical/Bird) |
|
| 54 | - * [Quagga](/historical/Quagga) |
|
| 49 | + * [Show and Tell](/internal/ShowAndTell) |
|
| 55 | 50 | |
| 56 | 51 | * External Tools |
| 57 | 52 | * [Paste Board](https://paste.dn42.us) |
| 58 | - * [HedgeDoc](https://hedgedoc.dn42.eu) |
|
| 59 | 53 | * [Git Repositories](https://git.dn42.dev) |
| 60 | 54 | * [Registry](https://git.dn42.dev/dn42/registry) |
| 61 | 55 |
historical/Bird.md
| ... | ... | @@ -1,447 +0,0 @@ |
| 1 | -Bird is a commonly used BGP daemon. This page provides configuration and help to run Bird for dn42. |
|
| 2 | -Compared to quagga, bird supports multiple routing tables, which is useful, if you also plan to peer with other federated networks such as freifunk. In the following a working configuration for dn42 is shown. If you |
|
| 3 | -want to learn the practical details behind routing protocols in bird, see the following [guide](https://github.com/knorrie/network-examples) |
|
| 4 | - |
|
| 5 | -**Bird 1.6.x will be EOL by the end of 2023, it's recommended to upgrade to 2.13.** |
|
| 6 | - |
|
| 7 | -# Debian |
|
| 8 | -In the Debian release cycle the bird packages may become outdated at times, if that is the case you should use the official bird package repository maintained by the developers of nic.cz. |
|
| 9 | - |
|
| 10 | -This is not necessary for Debian Stretch, which currently ships the most recent version (1.6.3) in this repositories. |
|
| 11 | - |
|
| 12 | -```sh |
|
| 13 | -echo "deb http://deb.debian.org/debian buster-backports main" > /etc/apt/sources.list.d/buster-backports.list |
|
| 14 | -apt update |
|
| 15 | -apt install bird |
|
| 16 | -``` |
|
| 17 | - |
|
| 18 | -# Example configuration |
|
| 19 | - |
|
| 20 | -Note: This file covers the configuration of Bird 1.x. For an example configuration of Bird 2.x see [howto/Bird2](/howto/Bird2) |
|
| 21 | - |
|
| 22 | -* Replace `<AS>` with your Autonomous System Number (only the digits) |
|
| 23 | -* Replace `<GATEWAY_IP>` with your gateway ip (the internal dn42 ip address you use on the host, where dn42 is running) |
|
| 24 | -* Replace `<SUBNET>` with your registered dn42 subnet |
|
| 25 | -* Replace `<PEER_IP>` with the ip of your peer who is connected with you using your favorite vpn protocol (openvpn, ipsec, tinc, ...) |
|
| 26 | -* Replace `<PEER_AS>` the Autonomous System Number of your peer (only the digits) |
|
| 27 | -* Replace `<PEER_NAME>` a self chosen name for your peer |
|
| 28 | - |
|
| 29 | -## IPv6 |
|
| 30 | - |
|
| 31 | -```conf |
|
| 32 | -#/etc/bird/bird6.conf |
|
| 33 | -protocol device { |
|
| 34 | - scan time 10; |
|
| 35 | -} |
|
| 36 | - |
|
| 37 | -# local configuration |
|
| 38 | -###################### |
|
| 39 | - |
|
| 40 | -include "/etc/bird/local6.conf"; |
|
| 41 | - |
|
| 42 | -# filter helpers |
|
| 43 | -################# |
|
| 44 | - |
|
| 45 | -##include "/etc/bird/filter6.conf"; |
|
| 46 | - |
|
| 47 | -# Kernel routing tables |
|
| 48 | -######################## |
|
| 49 | - |
|
| 50 | - |
|
| 51 | -/* |
|
| 52 | - krt_prefsrc defines the source address for outgoing connections. |
|
| 53 | - On Linux, this causes the "src" attribute of a route to be set. |
|
| 54 | - |
|
| 55 | - Without this option outgoing connections would use the peering IP which |
|
| 56 | - would cause packet loss if some peering disconnects but the interface |
|
| 57 | - is still available. (The route would still exist and thus route through |
|
| 58 | - the TUN/TAP interface but the VPN daemon would simply drop the packet.) |
|
| 59 | -*/ |
|
| 60 | -protocol kernel { |
|
| 61 | - scan time 20; |
|
| 62 | - import none; |
|
| 63 | - export filter { |
|
| 64 | - if source = RTS_STATIC then reject; |
|
| 65 | - krt_prefsrc = OWNIP; |
|
| 66 | - accept; |
|
| 67 | - }; |
|
| 68 | -} |
|
| 69 | - |
|
| 70 | -# static routes |
|
| 71 | -################ |
|
| 72 | - |
|
| 73 | -protocol static { |
|
| 74 | - route <SUBNET> reject; |
|
| 75 | - import all; |
|
| 76 | - export none; |
|
| 77 | -} |
|
| 78 | - |
|
| 79 | -template bgp dnpeers { |
|
| 80 | - local as OWNAS; |
|
| 81 | - path metric 1; |
|
| 82 | - import keep filtered; |
|
| 83 | - import filter { |
|
| 84 | - if is_valid_network() && !is_self_net() then { |
|
| 85 | - accept; |
|
| 86 | - } |
|
| 87 | - reject; |
|
| 88 | - }; |
|
| 89 | - export filter { |
|
| 90 | - if is_valid_network() && source ~ [RTS_STATIC, RTS_BGP] then { |
|
| 91 | - accept; |
|
| 92 | - } |
|
| 93 | - reject; |
|
| 94 | - }; |
|
| 95 | - import limit 1000 action block; |
|
| 96 | -} |
|
| 97 | - |
|
| 98 | -include "/etc/bird/peers6/*"; |
|
| 99 | -``` |
|
| 100 | - |
|
| 101 | -```conf |
|
| 102 | -# /etc/bird/local6.conf |
|
| 103 | -# should be a unique identifier, use same id as for ipv4 |
|
| 104 | -router id <GATEWAY_IP>; |
|
| 105 | - |
|
| 106 | -define OWNAS = <AS>; |
|
| 107 | -define OWNIP = <GATEWAY_IP>; |
|
| 108 | - |
|
| 109 | -function is_self_net() { |
|
| 110 | - return net ~ [<SUBNET>+]; |
|
| 111 | -} |
|
| 112 | - |
|
| 113 | -function is_valid_network() { |
|
| 114 | - return net ~ [ |
|
| 115 | - fd00::/8{44,64} # ULA address space as per RFC 4193 |
|
| 116 | - ]; |
|
| 117 | -} |
|
| 118 | -``` |
|
| 119 | - |
|
| 120 | -```conf |
|
| 121 | -# /etc/bird/peers6/<PEER_NAME> |
|
| 122 | -protocol bgp <PEER_NAME> from dnpeers { |
|
| 123 | - neighbor <PEERING_IP> as <PEER_AS>; |
|
| 124 | - # if you use link-local ipv6 addresses for peering using the following |
|
| 125 | - # neighbor <PEERING_IP> % '<INTERFACE_NAME>' as <PEER_AS>; |
|
| 126 | -}; |
|
| 127 | -``` |
|
| 128 | - |
|
| 129 | -### IPv4 |
|
| 130 | - |
|
| 131 | -```conf |
|
| 132 | -# /etc/bird/bird.conf |
|
| 133 | -# Device status |
|
| 134 | -protocol device { |
|
| 135 | - scan time 10; # recheck every 10 seconds |
|
| 136 | -} |
|
| 137 | - |
|
| 138 | -protocol static { |
|
| 139 | - # Static routes to announce your own range(s) in dn42 |
|
| 140 | - route <SUBNET> reject; |
|
| 141 | - import all; |
|
| 142 | - export none; |
|
| 143 | -}; |
|
| 144 | - |
|
| 145 | -# local configuration |
|
| 146 | -###################### |
|
| 147 | - |
|
| 148 | -# keeping router specific in a seperate file, |
|
| 149 | -# so this configuration can be reused on multiple routers in your network |
|
| 150 | -include "/etc/bird/local4.conf"; |
|
| 151 | - |
|
| 152 | -# filter helpers |
|
| 153 | -################# |
|
| 154 | - |
|
| 155 | -##include "/etc/bird/filter4.conf"; |
|
| 156 | - |
|
| 157 | -# Kernel routing tables |
|
| 158 | -######################## |
|
| 159 | - |
|
| 160 | -/* |
|
| 161 | - krt_prefsrc defines the source address for outgoing connections. |
|
| 162 | - On Linux, this causes the "src" attribute of a route to be set. |
|
| 163 | - |
|
| 164 | - Without this option outgoing connections would use the peering IP which |
|
| 165 | - would cause packet loss if some peering disconnects but the interface |
|
| 166 | - is still available. (The route would still exist and thus route through |
|
| 167 | - the TUN/TAP interface but the VPN daemon would simply drop the packet.) |
|
| 168 | -*/ |
|
| 169 | -protocol kernel { |
|
| 170 | - scan time 20; |
|
| 171 | - import none; |
|
| 172 | - export filter { |
|
| 173 | - if source = RTS_STATIC then reject; |
|
| 174 | - krt_prefsrc = OWNIP; |
|
| 175 | - accept; |
|
| 176 | - }; |
|
| 177 | -}; |
|
| 178 | -# DN42 |
|
| 179 | -####### |
|
| 180 | - |
|
| 181 | -template bgp dnpeers { |
|
| 182 | - local as OWNAS; |
|
| 183 | - # metric is the number of hops between us and the peer |
|
| 184 | - path metric 1; |
|
| 185 | - # this lines allows debugging filter rules |
|
| 186 | - # filtered routes can be looked up in birdc using the "show route filtered" command |
|
| 187 | - import keep filtered; |
|
| 188 | - import filter { |
|
| 189 | - # accept every subnet, except our own advertised subnet |
|
| 190 | - # filtering is important, because some guys try to advertise routes like 0.0.0.0 |
|
| 191 | - if is_valid_network() && !is_self_net() then { |
|
| 192 | - accept; |
|
| 193 | - } |
|
| 194 | - reject; |
|
| 195 | - }; |
|
| 196 | - export filter { |
|
| 197 | - # here we export the whole net |
|
| 198 | - if is_valid_network() && source ~ [RTS_STATIC, RTS_BGP] then { |
|
| 199 | - accept; |
|
| 200 | - } |
|
| 201 | - reject; |
|
| 202 | - }; |
|
| 203 | - import limit 1000 action block; |
|
| 204 | - #source address OWNIP; |
|
| 205 | -}; |
|
| 206 | - |
|
| 207 | -include "/etc/bird/peers4/*"; |
|
| 208 | -``` |
|
| 209 | - |
|
| 210 | -```conf |
|
| 211 | -#/etc/bird/local4.conf |
|
| 212 | -# should be a unique identifier, <GATEWAY_IP> is what most people use. |
|
| 213 | -router id <GATEWAY_IP>; |
|
| 214 | - |
|
| 215 | -define OWNAS = <AS>; |
|
| 216 | -define OWNIP = <GATEWAY_IP>; |
|
| 217 | - |
|
| 218 | -function is_self_net() { |
|
| 219 | - return net ~ [<SUBNET>+]; |
|
| 220 | -} |
|
| 221 | - |
|
| 222 | -function is_valid_network() { |
|
| 223 | - return net ~ [ |
|
| 224 | - 172.20.0.0/14{21,29}, # dn42 |
|
| 225 | - 172.20.0.0/24{28,32}, # dn42 Anycast |
|
| 226 | - 172.21.0.0/24{28,32}, # dn42 Anycast |
|
| 227 | - 172.22.0.0/24{28,32}, # dn42 Anycast |
|
| 228 | - 172.23.0.0/24{28,32}, # dn42 Anycast |
|
| 229 | - 172.31.0.0/16+, # ChaosVPN |
|
| 230 | - 10.100.0.0/14+, # ChaosVPN |
|
| 231 | - 10.127.0.0/16{16,32}, # neonetwork |
|
| 232 | - 10.0.0.0/8{15,24} # Freifunk.net |
|
| 233 | - ]; |
|
| 234 | -} |
|
| 235 | -``` |
|
| 236 | - |
|
| 237 | -```conf |
|
| 238 | -# /etc/bird/peers4/<PEER_NAME> |
|
| 239 | -protocol bgp <PEER_NAME> from dnpeers { |
|
| 240 | - neighbor <PEERING_IP> as <PEER_AS>; |
|
| 241 | -}; |
|
| 242 | -``` |
|
| 243 | - |
|
| 244 | -# Bird communities |
|
| 245 | - |
|
| 246 | -Communities can be used to prioritize traffic based on different flags, in DN42 we are using communities to prioritize based on latency, bandwidth and encryption. It is really easy to get started with communities and we encourage all of you to get the basic configuration done and to mark your peerings with the correct flags for improved routing. |
|
| 247 | -More information can be found [here](/howto/BGP-communities). |
|
| 248 | - |
|
| 249 | -# Route Origin Authorization |
|
| 250 | - |
|
| 251 | -Route Origin Authorizations should be used in BIRD to authenticate prefix announcements. These check the originating AS and validate that they are allowed to advertise a prefix. |
|
| 252 | - |
|
| 253 | -## ROA Tables |
|
| 254 | - |
|
| 255 | -The ROA table can be generated from the registry directly or you can use pre-built ROA tables. |
|
| 256 | - |
|
| 257 | -### Updating ROA tables |
|
| 258 | - |
|
| 259 | -You can add cron entries to periodically update the tables: |
|
| 260 | - |
|
| 261 | -```conf |
|
| 262 | -*/15 * * * * curl -sfSLR {-o,-z}/var/lib/bird/bird6_roa_dn42.conf https://dn42.burble.com/roa/dn42_roa_bird1_6.conf && chronic birdc6 configure |
|
| 263 | -*/15 * * * * curl -sfSLR {-o,-z}/var/lib/bird/bird_roa_dn42.conf https://dn42.burble.com/roa/dn42_roa_bird1_4.conf && chronic birdc configure |
|
| 264 | -``` |
|
| 265 | - |
|
| 266 | -Debian version: |
|
| 267 | - |
|
| 268 | -```conf |
|
| 269 | -*/15 * * * * curl -sfSLR -o/var/lib/bird/bird6_roa_dn42.conf -z/var/lib/bird/bird6_roa_dn42.conf https://dn42.burble.com/roa/dn42_roa_bird1_6.conf && /usr/sbin/birdc6 configure |
|
| 270 | -*/15 * * * * curl -sfSLR -o/var/lib/bird/bird_roa_dn42.conf -z/var/lib/bird/bird_roa_dn42.conf https://dn42.burble.com/roa/dn42_roa_bird1_4.conf && /usr/sbin/birdc configure |
|
| 271 | -``` |
|
| 272 | - |
|
| 273 | -then create the directory to make sure curls can save the files: |
|
| 274 | - |
|
| 275 | -```sh |
|
| 276 | -mkdir -p /var/lib/bird/ |
|
| 277 | -``` |
|
| 278 | - |
|
| 279 | -Or use a systemd timer: (check the commands before copy-pasting) |
|
| 280 | - |
|
| 281 | -```conf |
|
| 282 | -# /etc/systemd/system/dn42-roa.service |
|
| 283 | -[Unit] |
|
| 284 | -Description=Update DN42 ROA |
|
| 285 | - |
|
| 286 | -[Service] |
|
| 287 | -Type=oneshot |
|
| 288 | -ExecStart=curl -sfSLR -o /etc/bird/roa_dn42.conf -z /etc/bird/roa_dn42.conf https://dn42.burble.com/roa/dn42_roa_bird2_4.conf |
|
| 289 | -ExecStart=curl -sfSLR -o /etc/bird/roa_dn42_v6.conf -z /etc/bird/roa_dn42_v6.conf https://dn42.burble.com/roa/dn42_roa_bird2_6.conf |
|
| 290 | -ExecStart=birdc configure |
|
| 291 | -``` |
|
| 292 | - |
|
| 293 | -```conf |
|
| 294 | -# /etc/systemd/system/dn42-roa.timer |
|
| 295 | -[Unit] |
|
| 296 | -Description=Update DN42 ROA periodically |
|
| 297 | - |
|
| 298 | -[Timer] |
|
| 299 | -OnBootSec=2m |
|
| 300 | -OnUnitActiveSec=15m |
|
| 301 | -AccuracySec=1m |
|
| 302 | - |
|
| 303 | -[Install] |
|
| 304 | -WantedBy=timers.target |
|
| 305 | -``` |
|
| 306 | - |
|
| 307 | -then enable and start the timer with `systemctl enable --now dn42-roa.timer`. |
|
| 308 | - |
|
| 309 | -More advanced script with error checking: |
|
| 310 | -```sh |
|
| 311 | -#!/bin/bash |
|
| 312 | -roa4URL="" |
|
| 313 | -roa6URL="" |
|
| 314 | - |
|
| 315 | -roa4FILE="/etc/bird/roa/roa_dn42.conf" |
|
| 316 | -roa6FILE="/etc/bird/roa/roa_dn42_v6.conf" |
|
| 317 | - |
|
| 318 | -cp "${roa4FILE}" "${roa4FILE}.old" |
|
| 319 | -cp "${roa6FILE}" "${roa6FILE}.old" |
|
| 320 | - |
|
| 321 | -if curl -f -o "${roa4FILE}.new" "${roa4URL};" ;then |
|
| 322 | - mv "${roa4FILE}.new" "${roa4FILE}" |
|
| 323 | -fi |
|
| 324 | - |
|
| 325 | -if curl -f -o "${roa6FILE}.new" "${roa6URL};" ;then |
|
| 326 | - mv "${roa6FILE}.new" "${roa6FILE}" |
|
| 327 | -fi |
|
| 328 | - |
|
| 329 | -if birdc configure ; then |
|
| 330 | - rm "${roa4FILE}.old" |
|
| 331 | - rm "${roa6FILE}.old" |
|
| 332 | -else |
|
| 333 | - mv "${roa4FILE}.old" "${roa4FILE}" |
|
| 334 | - mv "${roa6FILE}.old" "${roa6FILE}" |
|
| 335 | -fi |
|
| 336 | -``` |
|
| 337 | - |
|
| 338 | - |
|
| 339 | -### Use RPKI ROA in bird2 |
|
| 340 | - |
|
| 341 | -* Download gortr |
|
| 342 | - |
|
| 343 | -<https://github.com/cloudflare/gortr/releases> |
|
| 344 | - |
|
| 345 | -* Run gortr. |
|
| 346 | - |
|
| 347 | -```sh |
|
| 348 | -./gortr -verify=false -checktime=false -cache=https://dn42.burble.com/roa/dn42_roa_46.json |
|
| 349 | -``` |
|
| 350 | - |
|
| 351 | - |
|
| 352 | -* Run with docker |
|
| 353 | - |
|
| 354 | -```sh |
|
| 355 | -docker pull cloudflare/gortr |
|
| 356 | -``` |
|
| 357 | - |
|
| 358 | -```sh |
|
| 359 | -docker run --name dn42rpki -p 8282:8282 --restart=always -d cloudflare/gortr -verify=false -checktime=false -cache=https://dn42.burble.com/roa/dn42_roa_46.json |
|
| 360 | -``` |
|
| 361 | - |
|
| 362 | -* Add this to your bird configure file,other ROA protocol must removed. |
|
| 363 | - |
|
| 364 | -```conf |
|
| 365 | -protocol rpki rpki_dn42{ |
|
| 366 | - roa4 { table dn42_roa; }; |
|
| 367 | - roa6 { table dn42_roa_v6; }; |
|
| 368 | - |
|
| 369 | - remote "<your rpki server ip or domain>" port 8282; |
|
| 370 | - |
|
| 371 | - retry keep 90; |
|
| 372 | - refresh keep 900; |
|
| 373 | - expire keep 172800; |
|
| 374 | -} |
|
| 375 | -``` |
|
| 376 | - |
|
| 377 | -## Filter configuration |
|
| 378 | - |
|
| 379 | -In your import filter add the following to reject invalid routes: |
|
| 380 | - |
|
| 381 | -```conf |
|
| 382 | -if (roa_check(dn42_roa, net, bgp_path.last) != ROA_VALID) then { |
|
| 383 | - print "[dn42] ROA check failed for ", net, " ASN ", bgp_path.last; |
|
| 384 | - reject; |
|
| 385 | -} |
|
| 386 | -``` |
|
| 387 | - |
|
| 388 | -Also, define your ROA table with: |
|
| 389 | - |
|
| 390 | -```conf |
|
| 391 | -roa table dn42_roa { |
|
| 392 | - include "/var/lib/bird/bird_roa_dn42.conf"; |
|
| 393 | -}; |
|
| 394 | -``` |
|
| 395 | - |
|
| 396 | - |
|
| 397 | -**NOTE**: Make sure you setup ROA checks for both bird and bird6 (for IPv6). |
|
| 398 | - |
|
| 399 | -# Useful bird commmands |
|
| 400 | - |
|
| 401 | -bird can be remote controlled via the `birdc` command. Here is a list of useful bird commands: |
|
| 402 | - |
|
| 403 | -```sh |
|
| 404 | -$ birdc |
|
| 405 | -BIRD 1.4.5 ready. |
|
| 406 | -bird> configure # reload configuration |
|
| 407 | -Reading configuration from /etc/bird.conf |
|
| 408 | -Reconfigured |
|
| 409 | -bird> show ? # Completions work either by pressing tab or pressing '?' |
|
| 410 | -show bfd ... Show information about BFD protocol |
|
| 411 | -show interfaces Show network interfaces |
|
| 412 | -show memory Show memory usage |
|
| 413 | -show ospf ... Show information about OSPF protocol |
|
| 414 | -show protocols [<protocol> | "<pattern>"] Show routing protocols |
|
| 415 | -show roa ... Show ROA table |
|
| 416 | -show route ... Show routing table |
|
| 417 | -show static [<name>] Show details of static protocol |
|
| 418 | -show status Show router status |
|
| 419 | -show symbols ... Show all known symbolic names |
|
| 420 | -bird> show protocols # this command shows your peering status |
|
| 421 | -name proto table state since info |
|
| 422 | -device1 Device master up 07:20:25 |
|
| 423 | -kernel1 Kernel master up 07:20:25 |
|
| 424 | -chelnok BGP master up 07:20:29 Established |
|
| 425 | -hax404 BGP master up 07:20:26 Established |
|
| 426 | -static1 Static master up 07:20:25 |
|
| 427 | -bird> show protocols all chelnok # show verbose peering status for peering with chelnok |
|
| 428 | -bird> show route for 172.22.141.181 # show possible routes to internal.dn42 |
|
| 429 | -172.22.141.0/24 via 172.23.67.1 on tobee [tobee 07:20:30] * (100) [AS64737i] |
|
| 430 | - via 172.23.64.1 on chelnok [chelnok 07:20:29] (100) [AS64737i] |
|
| 431 | - via 172.23.136.65 on hax404 [hax404 07:20:26] (100) [AS64737i] |
|
| 432 | -bird> show route filtered # shows routed filtered out by rules |
|
| 433 | -172.23.245.1/32 via 172.23.64.1 on chelnok [chelnok 21:26:18] * (100) [AS76175i] |
|
| 434 | -172.22.247.128/32 via 172.23.64.1 on chelnok [chelnok 21:26:18] * (100) [AS76175i] |
|
| 435 | -172.22.227.1/32 via 172.23.64.1 on chelnok [chelnok 21:26:18] * (100) [AS76115i] |
|
| 436 | -172.23.196.75/32 via 172.23.64.1 on chelnok [chelnok 21:26:18] * (100) [AS76115i] |
|
| 437 | -172.22.41.241/32 via 172.23.64.1 on chelnok [chelnok 21:26:18] * (100) [AS76115i] |
|
| 438 | -172.22.249.4/30 via 172.23.64.1 on chelnok [chelnok 21:26:18] * (100) [AS4242420002i] |
|
| 439 | -172.22.255.133/32 via 172.23.64.1 on chelnok [chelnok 21:26:18] * (100) [AS64654i] |
|
| 440 | -bird> show route protocol <somepeer> # shows the route they export to you |
|
| 441 | -bird> show route export <somepeer> # shows the route you export to someone |
|
| 442 | -... |
|
| 443 | -``` |
|
| 444 | - |
|
| 445 | -# External Links |
|
| 446 | -* detailed bird configuration from Mic92: <https://github.com/Mic92/bird-dn42> |
|
| 447 | -* more bird commands: <https://bird.network.cz/?get_doc&v=20&f=bird-4.html> |
historical/Quagga.md
| ... | ... | @@ -1,151 +0,0 @@ |
| 1 | -# Quagga |
|
| 2 | - |
|
| 3 | -Quagga is probably one of the oldest software router around. It still works, of course, even though it has an unattractive configuration syntax (unfortunately inspired by [Cisco's IOS](/howto/IPsecWithPublicKeys/CiscoIOSExample)) and has some small issues with IPv6. But since it's so old, you will find a lot of configuration examples around. |
|
| 4 | - |
|
| 5 | -## Source address selection |
|
| 6 | - |
|
| 7 | -Use this in your `zebra.conf`: |
|
| 8 | - |
|
| 9 | -```conf |
|
| 10 | -route-map RM_SET_SRC permit 10 |
|
| 11 | - set src 172.22.XX.XX |
|
| 12 | -ip protocol bgp route-map RM_SET_SRC |
|
| 13 | -``` |
|
| 14 | - |
|
| 15 | -Unfortunately, this is not possible with IPv6... |
|
| 16 | - |
|
| 17 | -## Important bgp commands |
|
| 18 | -To connect to bgpd use: |
|
| 19 | - |
|
| 20 | -```sh |
|
| 21 | -$ vtysh |
|
| 22 | -``` |
|
| 23 | - |
|
| 24 | -Which provides an interactive interface. |
|
| 25 | -In this interface '?' can be used to list the available commands or subcommands. |
|
| 26 | - |
|
| 27 | -## Configure Quagga |
|
| 28 | -a minimal config would look like this: |
|
| 29 | - |
|
| 30 | -```sh |
|
| 31 | -vtysh> configure terminal |
|
| 32 | -vtysh(config)> router bgp <your-asn> |
|
| 33 | -vtysh(config-router)> neighbor <neighbor-ip> remote-as <neighbor-asn> |
|
| 34 | -vtysh(config-router)> neighbor <neighbor-ip> interface <interface> |
|
| 35 | -vtysh(config-router)> exit |
|
| 36 | -vtysh(config)> exit |
|
| 37 | -``` |
|
| 38 | - |
|
| 39 | -### IPv6 |
|
| 40 | -for IPv6 do something like |
|
| 41 | - |
|
| 42 | -```sh |
|
| 43 | -vtysh> configure terminal |
|
| 44 | -vtysh(config)> router bgp <your-asn> |
|
| 45 | -vtysh(config-router)> neighbor <neighbor-ip> remote-as <neighbor-asn> |
|
| 46 | -vtysh(config-router)> neighbor <neighbor-ip> interface <interface> |
|
| 47 | -vtysh(config-router)> no neighbor <neighbor-ip> activate |
|
| 48 | -vtysh(config-router)> address-family ipv6 |
|
| 49 | -vtysh(config-router-af)> neighbor <neighbor-ip> activate |
|
| 50 | -vtysh(config-router-af)> exit |
|
| 51 | -vtysh(config-router)> exit |
|
| 52 | -vtysh(config)> exit |
|
| 53 | -``` |
|
| 54 | - |
|
| 55 | -### peer groups, prefix lists and such |
|
| 56 | -If you want to use 'prefix-list' to filter some of the prefixes quagga is receiving, you can use a 'peer-group' instead of apply the prefix list to every neighbor. |
|
| 57 | - |
|
| 58 | -Define a peer group: |
|
| 59 | - |
|
| 60 | -```sh |
|
| 61 | -vtysh(config-router)> neighbor <peer-group-name> peer-group |
|
| 62 | -``` |
|
| 63 | - |
|
| 64 | -Apply to a neighbor: |
|
| 65 | - |
|
| 66 | -```sh |
|
| 67 | -vtysh(config-router)> neighbor <neighbor-ip> peer-group <name> |
|
| 68 | -``` |
|
| 69 | - |
|
| 70 | -Apply a prefix list for incoming prefixes to your peer group: |
|
| 71 | - |
|
| 72 | -```sh |
|
| 73 | -vtysh(config-router)> neighbor <peer-group-name> prefix-list <prefix-list-name> in |
|
| 74 | -``` |
|
| 75 | - |
|
| 76 | -#### Example filter list |
|
| 77 | - |
|
| 78 | -```sh |
|
| 79 | -ip prefix-list vpn-in description BGP IPv4 import filter |
|
| 80 | -!old network: |
|
| 81 | -ip prefix-list vpn-in seq 5 permit 172.22.0.0/15 ge 22 le 28 |
|
| 82 | -!new dn42 allocation: |
|
| 83 | -ip prefix-list vpn-in seq 10 permit 172.20.0.0/16 ge 22 le 28 |
|
| 84 | - |
|
| 85 | -! Anycast /32s for Whois and DNS: |
|
| 86 | -ip prefix-list vpn-in seq 11 permit 172.22.0.43/32 |
|
| 87 | -ip prefix-list vpn-in seq 12 permit 172.22.0.53/32 |
|
| 88 | - |
|
| 89 | -ip prefix-list vpn-in seq 18 permit 192.175.48.0/24 |
|
| 90 | -ip prefix-list vpn-in seq 20 deny 10.10.10.0/24 |
|
| 91 | -ip prefix-list vpn-in seq 21 permit 10.0.0.0/8 |
|
| 92 | -ip prefix-list vpn-in seq 30 permit 172.31.0.0/16 |
|
| 93 | -ip prefix-list vpn-in seq 39 permit 100.64.0.0/10 |
|
| 94 | -ip prefix-list vpn-in seq 40 permit 195.160.168.0/23 |
|
| 95 | -ip prefix-list vpn-in seq 41 permit 91.204.4.0/22 |
|
| 96 | -ip prefix-list vpn-in seq 43 permit 193.43.220.0/23 |
|
| 97 | -ip prefix-list vpn-in seq 46 permit 83.133.178.0/23 |
|
| 98 | -ip prefix-list vpn-in seq 47 permit 87.106.29.254/32 |
|
| 99 | -ip prefix-list vpn-in seq 50 permit 85.25.246.16/28 |
|
| 100 | -ip prefix-list vpn-in seq 51 permit 46.4.248.192/27 |
|
| 101 | -ip prefix-list vpn-in seq 60 permit 94.45.224.0/19 |
|
| 102 | -ip prefix-list vpn-in seq 70 permit 195.191.196.0/23 |
|
| 103 | -ip prefix-list vpn-in seq 80 permit 80.244.241.224/27 |
|
| 104 | -ip prefix-list vpn-in seq 90 permit 46.19.90.48/28 |
|
| 105 | -ip prefix-list vpn-in seq 91 permit 46.19.90.96/28 |
|
| 106 | -ip prefix-list vpn-in seq 110 permit 188.40.34.241/32 |
|
| 107 | -ip prefix-list vpn-in seq 130 permit 37.1.89.192/26 |
|
| 108 | -ip prefix-list vpn-in seq 140 permit 178.33.32.123/32 |
|
| 109 | -ip prefix-list vpn-in seq 150 permit 87.98.246.19/32 |
|
| 110 | -ip prefix-list vpn-in seq 1000 deny 0.0.0.0/0 |
|
| 111 | - |
|
| 112 | -ipv6 prefix-list vpn-in seq 10 permit fd00::/8 ge 9 |
|
| 113 | -ipv6 prefix-list vpn-in seq 15 deny any |
|
| 114 | -``` |
|
| 115 | - |
|
| 116 | -#### Example filter list script |
|
| 117 | -```sh |
|
| 118 | -#!/bin/bash |
|
| 119 | - |
|
| 120 | -vtysh -c 'conf t' -c "no ip prefix-list dn42"; #drop old prefix list |
|
| 121 | - |
|
| 122 | -while read pl |
|
| 123 | -do |
|
| 124 | - vtysh -c 'conf t' -c "$pl"; #insert prefix list row by row |
|
| 125 | -done < <(curl -s https://ca.dn42.us/reg/filter.txt | grep -e ^[0-9] | awk '{ print "ip prefix-list dn42 seq " $1 " " $2 " " $3 " ge " $4 " le " $5}' | sed "s_/\([0-9]\+\) ge \1_/\1_g;s_/\([0-9]\+\) le \1_/\1_g"); |
|
| 126 | -vtysh -c "wr" #write new prefix list |
|
| 127 | - |
|
| 128 | -``` |
|
| 129 | - |
|
| 130 | -## show bpg session status |
|
| 131 | - |
|
| 132 | -in this example: |
|
| 133 | -* an active bgp session exists with peer 64713. |
|
| 134 | -* no (vpn) connection at all exists with peer 64692 |
|
| 135 | -* a (vpn) connection with 4242421375 exists, but no bgp session |
|
| 136 | - |
|
| 137 | -``` |
|
| 138 | -vtysh> show ip bgp summary |
|
| 139 | -BGP router identifier 172.22.100.254, local AS number 64698 |
|
| 140 | -RIB entries 938, using 103 KiB of memory |
|
| 141 | -Peers 11, using 49 KiB of memory |
|
| 142 | -Peer groups 1, using 32 bytes of memory |
|
| 143 | - |
|
| 144 | -Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd |
|
| 145 | -172.22.92.247 4 64692 0 0 0 0 0 never Connect |
|
| 146 | -... |
|
| 147 | -172.22.113.2 4 64713 2206 865 0 0 0 01:23:11 322 |
|
| 148 | -.... |
|
| 149 | -172.23.64.1 4 4242421375 0 0 0 0 0 never Active |
|
| 150 | -fe80::deca:fbad 4 64699 902 694 0 0 0 01:23:57 486 |
|
| 151 | -``` |
internal/Internal-Services.md
| ... | ... | @@ -1,6 +1,7 @@ |
| 1 | 1 | # Internal services |
| 2 | 2 | |
| 3 | -You are asked to show some creativity in terms of network usage and content ([ideas](/internal/Ideas)). |
|
| 3 | +You are asked to show some creativity in terms of network usage and content. |
|
| 4 | +View a list of [service ideas](/internal/Ideas) and [historical services](/internal/Historical-Services). |
|
| 4 | 5 | |
| 5 | 6 | ## Search engines & Discovery |
| 6 | 7 |