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

changed holod to listen to [::] instead of [::1] #18

Merged

Conversation

frederic-loui
Copy link
Member

holod grpc server/gnmi now listen to all interfaces instead of IPv6 [::1] localhost.
This was needed to test access to holod from different a host with:

holo-cli --address "http://<ipv4/ipv6>:<port>"

with that change holo container can also be accessed from any containerlab out of band IP address.

+---+----------------+--------------+--------------------------------------------------+-------+---------+----------------+----------------------+
| # |      Name      | Container ID |                      Image                       | Kind  |  State  |  IPv4 Address  |     IPv6 Address     |
+---+----------------+--------------+--------------------------------------------------+-------+---------+----------------+----------------------+
| 1 | clab-ripv2-rt1 | 5579bc41ccf6 | holo:floui                                       | linux | running | 172.20.20.4/24 | 2001:172:20:20::4/64 |
| 2 | clab-ripv2-rt2 | 31e314d319e0 | holo:floui                                       | linux | running | 172.20.20.2/24 | 2001:172:20:20::2/64 |
| 3 | clab-ripv2-rt3 | fdbc1114e452 | holo:floui                                       | linux | running | 172.20.20.6/24 | 2001:172:20:20::6/64 |
| 4 | clab-ripv2-rt4 | d8de473f9700 | holo:floui                                       | linux | running | 172.20.20.7/24 | 2001:172:20:20::7/64 |
| 5 | clab-ripv2-rt5 | 7d4b0f125fb7 | holo:floui                                       | linux | running | 172.20.20.3/24 | 2001:172:20:20::3/64 |
| 6 | clab-ripv2-rt6 | df5d2b0b696f | holo:floui                                       | linux | running | 172.20.20.8/24 | 2001:172:20:20::8/64 |
| 7 | clab-ripv2-rt7 | 23e5005fb00e | ghcr.io/rare-freertr/freertr-containerlab:latest | rare  | running | 172.20.20.5/24 | 2001:172:20:20::5/64 |
+---+----------------+--------------+--------------------------------------------------+-------+---------+----------------+----------------------+
  • from containerlab host os:
❯ target/debug/holo-cli --address http://172.20.20.4:50051
holo# show running
!
interfaces interface lo
 type iana-if-type:ethernetCsmacd
 ipv4
!
interfaces interface eth1
 type iana-if-type:ethernetCsmacd
 ipv4
!
routing control-plane-protocols control-plane-protocol ietf-rip:ripv2 main
 !
 rip interfaces interface lo
 !
 rip interfaces interface eth1
!
holo#
  • holo-cli can now be used to access any router in containerlab lab:
❯ target/debug/holo-cli --address http://172.20.20.4:50051
holo# show running
!
interfaces interface lo
 type iana-if-type:ethernetCsmacd
 ipv4
!
interfaces interface eth1
 type iana-if-type:ethernetCsmacd
 ipv4
!
routing control-plane-protocols control-plane-protocol ietf-rip:ripv2 main
 !
 rip interfaces interface lo
 !
 rip interfaces interface eth1
!
holo# exit
❯ target/debug/holo-cli --address http://172.20.20.6:50051
holo#
holo#
holo# show running
!
interfaces interface lo
 type iana-if-type:ethernetCsmacd
 ipv4
!
interfaces interface eth1
 type iana-if-type:ethernetCsmacd
 ipv4
!
interfaces interface eth2
 type iana-if-type:ethernetCsmacd
 ipv4
!
interfaces interface eth3
 type iana-if-type:ethernetCsmacd
 ipv4
!
routing control-plane-protocols control-plane-protocol ietf-rip:ripv2 main
 !
 rip interfaces interface lo
 !
 rip interfaces interface eth1
 !
 rip interfaces interface eth2
 !
 rip interfaces interface eth3
!
holo#
  • In case of space/storage constraint holo-cli can be unbundled from holo (i.e similar to holo` container)

Copy link

codecov bot commented Apr 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.42%. Comparing base (8d360eb) to head (0f211fc).
Report is 6 commits behind head on master.

❗ Current head 0f211fc differs from pull request most recent head c013e3c. Consider uploading reports for the commit c013e3c to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #18   +/-   ##
=======================================
  Coverage   60.42%   60.42%           
=======================================
  Files         179      179           
  Lines       31812    31812           
=======================================
  Hits        19222    19222           
  Misses      12590    12590           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@rwestphal rwestphal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frederic-loui Looks good to me. But please update holo-daemon/src/config.rs as well, since it contains the default values when /etc/holod.toml isn't present. That file and holo-daemon/holod.toml (the sample configuration file) should always be in sync.

From a security perspective, restricting access to the loopback address is better as gRPC/gNMI TLS authentication is disabled by default. But in practice anyone using Holo in production will need to set up TLS anyway.

Signed-off-by: Fréderic LOUI <frederic.loui@renater.fr>
Copy link
Member

@rwestphal rwestphal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @frederic-loui! Merging...

@rwestphal rwestphal merged commit 8ad0dd1 into holo-routing:master Apr 10, 2024
4 checks passed
@frederic-loui frederic-loui deleted the holod-listen-to-all-intf branch May 8, 2024 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants