summaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2021-05-24 09:55:03 +0300
committerDonatas Abraitis <donatas.abraitis@gmail.com>2021-05-24 09:55:03 +0300
commit94d720ff40644d09d99829d6a1520075b9f8475a (patch)
tree4fc816ce7ad55a140e81aec21018e1bd38ce5d9a /cmd
parentcbdb752b10847163d9f942853b67cf173b6aa151 (diff)
Add FQDN capability
It's not kinda RFC (draft), but it's implemented and used in various other open-source software like FRRouting, Bird, ExaBGP. It's very handy when dealing with lots of peers. Exampe between GoBGP and FRRouting: ``` % ./cmd/gobgp/gobgp neighbor 192.168.10.123 | grep -A4 fqdn: fqdn: advertised and received Local: name: donatas-pc, domain: Remote: name: exit1-debian-9, domain: ``` ``` % vtysh -c 'show bgp neighbors 192.168.10.17 json' | jq .'"192.168.10.17".neighborCapabilities.hostName' { "advHostName": "exit1-debian-9", "advDomainName": "n/a", "rcvHostName": "donatas-pc", "rcvDomainName": "n/a" } ``` Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gobgp/neighbor.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/gobgp/neighbor.go b/cmd/gobgp/neighbor.go
index 8c80338b..8964cf9e 100644
--- a/cmd/gobgp/neighbor.go
+++ b/cmd/gobgp/neighbor.go
@@ -452,6 +452,16 @@ func showNeighbor(args []string) error {
fmt.Printf(" %s:\t%s\n", item.RouteFamily, item.Mode)
}
}
+ case bgp.BGP_CAP_FQDN:
+ fmt.Printf(" %s:\t%s\n", c.Code(), support)
+ if m := lookup(c, lcaps); m != nil {
+ fmt.Println(" Local:")
+ fmt.Printf(" name: %s, domain: %s\n", m.(*bgp.CapFQDN).HostName, m.(*bgp.CapFQDN).DomainName)
+ }
+ if m := lookup(c, rcaps); m != nil {
+ fmt.Println(" Remote:")
+ fmt.Printf(" name: %s, domain: %s\n", m.(*bgp.CapFQDN).HostName, m.(*bgp.CapFQDN).DomainName)
+ }
default:
fmt.Printf(" %s:\t%s\n", c.Code(), support)
}