Page MenuHomeVyOS Platform

frr 'hostname' missing or incorrect, and domain-name missing totally
Open, Requires assessmentPublicBUG

Description

Doing a show running-config inside vtysh after a reboot can either have just has a single (incorrect) hostname line of 'debian', or TWO hostname lines of 'debian' and then the correct hostname.

The domainname inside frr very rarely set. I suspect this is because dns-domain-name is set at priority 400, but the bootstrap of frr is at priority 150

https://github.com/vyos/vyos-1x/blob/current/interface-definitions/dns-domain-name.xml.in
https://github.com/vyos/vyos-1x/blob/current/interface-definitions/system-frr.xml.in

This leads to a non-deterministic startup where sometimes the hostname is set, and imported into frr correctly, and some times it's not.

This is most visible on a single CPU VM, which makes issues like this stand out, as two things can't happen at the same time.

I suspect a simple fix for this would be to set the system hostname and domainname earlier than priority 150.

Details

Difficulty level
Easy (less than an hour)
Version
1.4-2023-05-23
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

I have the correct host-name after reboot

[email protected]:~$ 
[email protected]:~$ vtysh -c "show run" | match host
hostname r14
[email protected]:~$ 
[email protected]:~$ 
[email protected]:~$ show ver
Version:          VyOS 1.4-rolling-202305260317
Release train:    current

I checked 6 routers, 2 showed the issue. No idea what the impact is. All of them running 1.3.2.

[email protected]:~$ vtysh -c "show run" | match host
hostname debian
hostname VYFriv

[email protected]:~$ vtysh -c "show run" | match host
hostname debian
hostname b2

[email protected]:~$ vtysh -c "show run" | match host
hostname myv

[email protected]:~$ vtysh -c "show run" | match host
hostname c2

[email protected]:~$ vtysh -c "show run" | match host
hostname c1

[email protected]:~$ vtysh -c "show run" | match host
hostname b1

It's actually an old issue.

My idea that just popped to my head is to use https://github.com/vyos/vyatta-cfg/blob/current/scripts/init/vyos-router to set the hostname prior to launching FRR