summaryrefslogtreecommitdiff
path: root/data/live-build-config/hooks/live/30-frr-configs.chroot
blob: a516cc120c96dda7c767a400b66ef49d45c88efa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python3

# For FRR to work in VyOS as expected we need a few fixups
#
# 1. Enable daemons we use in /etc/frr/daemons
# 2. Set the VRF backend of Zebra to netns (-n option) in /etc/frr/daemons.conf
#    Otherwise multiple routing tables for PBR won't work
# 3. Create empty configs for daemons with use
#    That is to make them possible to start on boot before config is loaded
#

import os

daemons = """
zebra=yes
bgpd=yes
ospfd=yes
ospf6d=yes
ripd=yes
ripngd=yes
isisd=yes
pimd=no
ldpd=yes
nhrpd=no
eigrpd=yes
babeld=no
sharpd=no
pbrd=no
bfdd=yes
staticd=yes

vtysh_enable=yes
zebra_options="-s 90000000 --daemon -A 127.0.0.1 -M snmp"
bgpd_options="--daemon -A 127.0.0.1 -M snmp -M rpki -M bmp"
ospfd_options="--daemon -A 127.0.0.1 -M snmp"
ospf6d_options="--daemon -A ::1 -M snmp"
ripd_options="--daemon -A 127.0.0.1 -M snmp"
ripngd_options="--daemon -A ::1"
isisd_options="--daemon -A 127.0.0.1 -M snmp"
pimd_options="--daemon -A 127.0.0.1"
ldpd_options="--daemon -A 127.0.0.1"
nhrpd_options="--daemon -A 127.0.0.1"
eigrpd_options="--daemon -A 127.0.0.1"
babeld_options="--daemon -A 127.0.0.1"
sharpd_options="--daemon -A 127.0.0.1"
pbrd_options="--daemon -A 127.0.0.1"
staticd_options="--daemon -A 127.0.0.1"
bfdd_options="--daemon -A 127.0.0.1"

watchfrr_enable=no
valgrind_enable=no
"""

frr_conf = """
log syslog
log facility local7
"""

frr_log = ''

with open("/etc/frr/daemons", "w") as f:
    f.write(daemons)

with open("/etc/frr/frr.conf", "w") as f:
    f.write(frr_conf)

# Prevent writing logs to /var/log/frr/frr.log. T2061
with open("/etc/rsyslog.d/45-frr.conf", "w") as f:
    f.write(frr_log)