Benutzer-Werkzeuge

Webseiten-Werkzeuge


notiz:bird2-debian-buster-installieren

bird 2 auf Debian Buster installieren

Abhängigkeiten installieren

apt install build-essential autotools-dev autoconf flex bison libncurses-dev libreadline-dev

bird2 bauen und installieren

wget https://bird.network.cz/download/bird-2.0.7.tar.gz
tar -xf bird-2.0.7.tar.gz 
cd bird-2.0.7/
./configure 
make -j 2
sudo make install

bird2 einrichten

adduser --system --group --no-create-home bird
/etc/systemd/system/bird.service
[Unit]
Description=BIRD Internet Routing Daemon
After=network.target

[Service]
ExecStartPre=/usr/local/sbin/bird -p
ExecReload=/usr/local/sbin/birdc configure
ExecStart=/usr/local/sbin/bird -f -u bird -g bird
Restart=on-abort

[Install]
WantedBy=multi-user.target
systemctl enable --now bird

bird2 konfigurieren

/usr/local/etc/bird.conf
router id 192.168.10.26;

ipv6 table ospf6;
ipv6 table bgp6;

protocol direct {
        interface "ens20";
        ipv6 {
                table ospf6;
        };
}

protocol static {
        ipv6 {
                table bgp6;
        };
        route fd56:4902:eca0::/48 via "lo";
        route fd56:4902:eca0::/52 via "lo";
}

protocol kernel {
        ipv6 {
                table ospf6;
                export filter {
                        krt_prefsrc=fd56:4902:eca0:6::1;
                        accept;
                };
                import none;
        };
        kernel table 1337;
}

protocol kernel {
        ipv6 {
                table bgp6;
                export filter {
                        krt_prefsrc=fd56:4902:eca0:6::1;
                        accept;
                };
                import none;
        };
        kernel table 2342;
}

protocol ospf v3 {
        ipv6 {
                table ospf6;
                import all;
                export all;
        };
        area 0 {
                interface "ens19" {
                        cost 80;
                };
        };
}

protocol bgp gw5 {
        local as 4242422574;
        graceful restart on;
        neighbor fd56:4902:eca0:5::1 as 4242422574;
        source address fd56:4902:eca0:6::1;
        ipv6 {
                table bgp6;
                igp table ospf6;
                next hop self;
                import keep filtered;
                import all;
                export all;
        };
}


protocol bgp peer_nex {
        local as 4242422574;
        graceful restart on;
        neighbor fd9b:37f7:faf7:3001::2 as 4242423012;
        source address fd9b:37f7:faf7:3001::6;
        ipv6 {
                table bgp6;
                igp table ospf6;
                next hop self;
                import keep filtered;
                import filter {
                        if net ~ [fd00::/8{8,64}] then accept;
                        reject;
                };
                export filter {
                        #if net ~ [fd9b:37f7:faf7:3001::/64] then reject;
                        if net ~ [fd00::/8{8,64}] then accept;
                        reject;
                };
        };
}

protocol device {
        scan time 10;
}

forwarding aktivieren

net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1
systemctl restart systemd-sysctl

policy based Routing einrichten

/etc/network/if-up.d/bird
#!/bin/bash

ip -6 rule flush
ip -6 rule add lookup main prio 32000
ip -6 rule add from all to fd56:4902:eca0::/48 lookup 1337 prio 10000
#ip -6 rule add from fd56:4902:eca0::/48 to all lookup 2342 prio 10000
ip -6 rule add from all to all lookup 2342 prio 10000
ip -6 rule add from all to fd56:4902:eca0::/48 unreachable prio 20000
ip -6 rule add from fd56:4902:eca0::/48 to all unreachable prio 20000
chmod +x /etc/network/if-up.d/bird
/etc/network/if-up.d/bird
notiz/bird2-debian-buster-installieren.txt · Zuletzt geändert: 2020/11/18 22:18 von clerie

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki