diff options
author | Kim <kim.sidney@gmail.com> | 2018-11-12 10:10:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-12 10:10:43 +0100 |
commit | e33f57928d6e8a3206ddafa827ac8d3b9b07974e (patch) | |
tree | 3229cfed4504037f0d141ec9a6625cdb8708880c /data/live-build-config/hooks/live/30-frr-configs.chroot | |
parent | a48a22a8113c0e98ed019c60b1f4c182550d3979 (diff) | |
parent | 8dcda0e05b0109e12280c446070b1fa94d0a6b4b (diff) | |
download | vyos-build-e33f57928d6e8a3206ddafa827ac8d3b9b07974e.tar.gz vyos-build-e33f57928d6e8a3206ddafa827ac8d3b9b07974e.zip |
Merge pull request #29 from UnicronNL/current
Add uefi to vyos-build
Diffstat (limited to 'data/live-build-config/hooks/live/30-frr-configs.chroot')
-rwxr-xr-x | data/live-build-config/hooks/live/30-frr-configs.chroot | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/data/live-build-config/hooks/live/30-frr-configs.chroot b/data/live-build-config/hooks/live/30-frr-configs.chroot new file mode 100755 index 00000000..cc169fb5 --- /dev/null +++ b/data/live-build-config/hooks/live/30-frr-configs.chroot @@ -0,0 +1,66 @@ +#!/usr/bin/env python + +# 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=no +pimd=no +ldpd=no +nhrpd=no +eigrpd=no +babeld=no +sharpd=no +pbrd=no +bfdd=no +""" + +daemons_conf = """ +vtysh_enable=yes +zebra_options=" -s 90000000 --daemon -A 127.0.0.1 -M snmp -n" +bgpd_options=" --daemon -A 127.0.0.1 -M snmp" +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" +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 +watchfrr_options=(-d -r /usr/sbin/servicebBfrrbBrestartbB%s -s /usr/sbin/servicebBfrrbBstartbB%s -k /usr/sbin/servicebBfrrbBstopbB%s -b bB) + +valgrind_enable=no +valgrind=/usr/bin/valgrind +""" + +with open("/etc/frr/daemons", "w") as f: + f.write(daemons) + +with open("/etc/frr/daemons.conf", "w") as f: + f.write(daemons_conf) + +# Create empty daemon configs so that they start properly +for name in ["zebra.conf", "bgpd.conf", "ospfd.conf", "ospf6d.conf", "ripd.conf", "ripngd.conf"]: + open(os.path.join("/etc/frr", name), 'a').close() |