unifi-utilities / unifios-utilities

A collection of enhancements for UnifiOS based devices
GNU General Public License v3.0
3.95k stars 419 forks source link

Help Request: FRR on UDM SE - Cannot make changes due to missing `/usr/sbin/zebra` binary #578

Closed Routhinator closed 1 year ago

Routhinator commented 1 year ago

Hi folks,

I'm on a UDM SE which doesn't use containers.

I'm using this excellent repo as advised in this How To for BGP setup on the UDM SE:

https://0xem.ma/posts/MetalLB-UDM-SE/

BGP is working! That's all setup and I see my routes, and I can hit everything from inside the network:

root@gateway01:~# sudo vtysh -c 'show ip bgp'
BGP table version is 18, local router ID is 192.168.1.1, vrf id 0
Default local pref 100, local AS 65510
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

    Network          Next Hop            Metric LocPrf Weight Path
 *> 24.108.76.0/22   0.0.0.0                  0         32768 ?
 *> 192.168.1.0/24   0.0.0.0                  0         32768 ?
 *> 192.168.1.2/32   0.0.0.0                  0         32768 ?
 *> 192.168.2.0/32   192.168.1.220            0             0 65512 i

Displayed  4 routes and 4 total paths

However.. I now need to open up a port forward, and when I try to make a change to the UDM SE configuration I get this error:

We couldn't apply the gateway configuration changes. Contact Supporrt for further assistance.

..obviously support is not going to support this config.

Checking journalctl output at the time of the error, I see:

Oct 16 12:18:48 gateway01 ubios-udapi-server[1265]: service: vvv Apply new configuration
Oct 16 12:18:48 gateway01 ubios-udapi-server[1265]: service:  *                    [interfaces]: configuring
Oct 16 12:18:48 gateway01 ubios-udapi-server[1265]: service:  *                   [routes/ospf]: disabling
Oct 16 12:18:48 gateway01 ubios-udapi-server[2502167]: sh: 1: /usr/sbin/zebra: not found
Oct 16 12:18:48 gateway01 ubios-udapi-server[1265]: service: Failed to apply routes/ospf configuration: Failed to find FRR version: command /usr/sbin/zebra --version returned error code 127
Oct 16 12:18:48 gateway01 ubios-udapi-server[1265]: service: ^^^ Apply new configuration failed
Oct 16 12:18:48 gateway01 ubios-udapi-server[1265]: service: vvv Apply rollback configuration
Oct 16 12:18:48 gateway01 ubios-udapi-server[1265]: service:  *                    [interfaces]: configuring
Oct 16 12:18:48 gateway01 ubios-udapi-server[1265]: service: ^^^ Apply rollback configuration done
Oct 16 12:18:48 gateway01 ubios-udapi-server[1265]: service: Error in processing PUT /system/ubios/udm/configuration request: Failed to apply routes/ospf configuration: Failed to find FRR version: command /usr/sbin/zebra --version returned error code 127
Oct 16 12:18:48 gateway01 mcad[2323]: mcad[2323]: udapi-bridge-api.udapi_request(): HTTP PUT request to "localhost:1080/api/v1.0/system/ubios/udm/configuration" failed with "500 Internal Server Error"
Oct 16 12:18:48 gateway01 mcad[2323]: mcad[2323]: udapi-bridge-api.udapi_request(): Error message: Failed to apply routes/ospf configuration: Failed to find FRR version: command /usr/sbin/zebra --version returned error code 127

For some reason something is looking for the /usr/sbin/zebra binary for this config update and I'm not sure what. I'm guessing it's a byproduct of updates since the how to was written or it's an oversight as this configuration change wasn't tested. Unfortunately the original author's blog has no comment section.. so reaching out here in hopes someone can point me to where i need to look.

Any help would be greatly appreciated.

Current versions of things: UDM SE Firmware: UDM SE v3.1.16 Network Application: Network 7.5.176

Routhinator commented 1 year ago

Found a clue in the comments section on https://www.map59.com/ubiquiti-udm-running-bgp/ which the How To I found was based on...

Disqus ate my first comment, so I'll shorthand it: FRR appears preinstalled on UDM SE 3.1.15. Using the script deleted zebra, which the UDM software needs for some of its functions. However, disabling the script and restoring the root partition placed back FRR 8.1 and my existing BGP setup appears to be working fine with that.

That gets me somewhere... so I'll need to restart from scratch given that context and see if I am successful this time.

Would be good to get these directions into a markdown doc in a repo somewhere (maybe this one?) so that it can be contributed to and updated by the community - right now it's a matter of chasing breadcrumbs from multple outdated how tos, reddit posts and UI forum posts :)

Routhinator commented 1 year ago

OK, reflashed my firmware, and then reworked the bootscript with the fact that FRR is already installed in mind:

#!/bin/bash

# Check state
FRR_SERVICE_ENABLED=$(systemctl is-enabled frr)

# If FRR is not enabled, then enable and start it
if [ "${FRR_SERVICE_ENABLED}" != "enabled" ]; then 
    echo "FRR systemd unit was not enabled, enabling and starting..."
    systemctl enable frr
    systemctl start frr

    # Install other nice-to-haves for config editing
    apt-get -y install --reinstall nano
fi

Maybe we'll get this out of the box soon?