FRRouting / frr

The FRRouting Protocol Suite
https://frrouting.org/
Other
3.35k stars 1.26k forks source link

/etc/frr/frr.conf does not load on start on CentOS 7 #1758

Closed tynany closed 6 years ago

tynany commented 6 years ago

On CentOS 7, when a valid /etc/frr/frr.conf file exists, FRR will not load the configuration when it starts. A workaround is to start FRR followed by a reload. This behaviour is not present when you use individual configuration files (zerba.conf, bgpd.conf etc).

I have not been able to reproduce this behaviour on Ubuntu 16.04 kernel 4.4.0-87.

The below page suggests 'vtysh -b' needs to be run, but it's not 100% clear to me whether this is the case. If it is, it's quite problematic given you'd need to automate 'vtysh -b' after each reboot. https://frrouting.org/user-guide/Integrated-configuration-mode.html

OS: Centos 7 Kernel: Linux 3.10.0-693.17.1.el7.x86_64 FRR Version: 3.0.3 FRR packages: frr and frr-pythontools Install Method: Released RPM packages

How to reproduce:

  1. Fresh install of Centos 7 (Linux 3.10.0-693.17.1.el7.x86_64)

  2. yum install https://github.com/FRRouting/frr/releases/download/frr-3.0.3/frr-3.0.3-2018010901.el7.centos.x86_64.rpm -y

  3. sed -i 's/\(bgpd\|zebra\)=.*/\1=yes/g' /etc/frr/daemons

  4. systemctl start frr

  5. vtysh -c 'configure terminal' -c 'service integrated-vtysh-config' -c 'router bgp 64512'

  6. vtysh -c 'write memory'

    Note: this version of vtysh never writes vtysh.conf
    Building Configuration...
    Integrated configuration saved to /etc/frr/frr.conf
    [OK]
  7. (optional) echo 'service integrated-vtysh-config' > /etc/frr/vtysh.conf

  8. cat /etc/frr/frr.conf

    frr version 3.0.3
    frr defaults traditional
    hostname localhost.localdomain
    no ip forwarding
    no ipv6 forwarding
    !
    router bgp 64512
    !
    line vty
    !
  9. cat /etc/frr/vtysh.conf

    service integrated-vtysh-config
  10. systemctl restart frr or systemctl stop frr && systemctl start frr

  11. vtysh -c 'show running-config'. Notice router bgp 64512 is missing.

    
    Building configuration...

Current configuration: ! frr version 3.0.3 frr defaults traditional no ip forwarding no ipv6 forwarding ! line vty ! end


12. `systemctl reload frr`

11. `vtysh -c 'show running-config'`. `router bgp 64512` is now present.

Building configuration...

Current configuration: ! frr version 3.0.3 frr defaults traditional no ip forwarding no ipv6 forwarding hostname quagga-router username root nopassword ! service integrated-vtysh-config ! router bgp 64512 ! line vty ! end

donaldsharp commented 6 years ago

Add this line: vtysh_enable=yes

to the /etc/frr/daemons file

tynany commented 6 years ago

Yep, that does the trick. How can I help out by adding this to documentation?

qlyoung commented 6 years ago

At present the project lacks documentation on configuration file uses and locations, although this should be rectified in the near future. In the meantime if you wish to add a note, I would do it in this file: https://github.com/FRRouting/frr/blob/master/doc/vtysh.texi

tynany commented 6 years ago

Looks like the documentation has been updated in FRR4.0, so I'll close this issue:

/etc/frr/daemons:

#
# If the vtysh_enable is yes, then the unified config is read
# and applied if it exists.  If no unified frr.conf exists
# then the per-daemon <daemon>.conf files are used)
# If vtysh_enable is no or non-existant, the frr.conf is ignored.
# it is highly suggested to have this set to yes
vtysh_enable=yes
q2dg commented 5 years ago

I've seen in FRR 7.0 this explanation has changed and it's a lot less understandable:

"If this option is set the /etc/init.d/frr script automatically loads the config via "vtysh -b" when the servers are started. Check /etc/pam.d/frr if you intend to use "vtysh"!"

EricVS commented 5 years ago

Hi, I'm encountering the same issue in our cluster but adding vtysh_enable=yes does not solve it for me. We're running FRR 4.0, provided by Cumulus. Kind regards, Eric V.

Thermi commented 3 years ago

Same, but on Debian 10 with version 6.0.2 Config loads fine if it's just written using vtysh, but if I even change a single line using nano or anything, vtysh doesn't load it anymore and there are no errors or logs whatsoever telling me of a problem with it.

rubenrdp commented 2 years ago

Same problem here working on GNS3 with FRR7.3.1 & FRR7.5.1