Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hostname and domainname for BGP peers #17119

Open
2 tasks done
SwimGeek opened this issue Oct 15, 2024 · 6 comments
Open
2 tasks done

hostname and domainname for BGP peers #17119

SwimGeek opened this issue Oct 15, 2024 · 6 comments
Labels
triage Needs further investigation

Comments

@SwimGeek
Copy link

Description

I'd like to configure the hostname and domainname sent to BGP peers.

Please see discussion: #16903

It seems that FRR needs to be able to use the output of: dnsdomainname

Version

FRR v10.1.1

How to reproduce

Try to configure domainname in FRR.

Expected behavior

FRR needs to inherit the value of the command dnsdomainname and be able to add it to frr.conf.

Actual behavior

I can't configure domainname in frr.

Additional context

No response

Checklist

  • I have searched the open issues for this bug.
  • I have not included sensitive information in this report.
@SwimGeek SwimGeek added the triage Needs further investigation label Oct 15, 2024
@ton31337
Copy link
Member

uname() returns nodename as FQDN (not a short version), thus it's tricky. We could treat the first occurrence (stripped by dot) as a short name, while the rest is the domain name, but this is not true again if multi-level domains are used...

@SwimGeek
Copy link
Author

Hi

This is from the dnssdomainname man page:

'The DNS domain name is the part after the first dot.'

...

   You cannot change the FQDN with hostname or dnsdomainname.

   The  recommended  method of setting the FQDN is to make the hostname be an alias
   for the fully qualified name using /etc/hosts, DNS, or NIS. For example, if  the
   hostname was "ursula", one might have a line in /etc/hosts which reads

          127.0.1.1    ursula.example.com ursula

   Technically:  The  FQDN is the name getaddrinfo(3) returns for the host name re‐
   turned by gethostname(2).  The DNS domain name is the part after the first dot.

@ton31337
Copy link
Member

If we just follow this, then this is the easy FIX. Would you like to test this branch?

@SwimGeek
Copy link
Author

Thanks. Will this allow me to set domainname in vtysh? and then save to frr.conf

Does it do any checking, must match host domainname?

@ton31337
Copy link
Member

Thanks. Will this allow me to set domainname in vtysh? and then save to frr.conf

Nope, it will just strip the first part before the dot and treat everything else as a domain name, that's it :)

@SwimGeek
Copy link
Author

SwimGeek commented Oct 16, 2024

Ok, example case:

If I wanted to configure a router to send 'localhost.localdomain' to BGP peer, I would add the following to frr.conf

hostname localhost.localdomain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs further investigation
Projects
None yet
Development

No branches or pull requests

2 participants