Skip to content

Conversation

@packethog
Copy link
Contributor

Summary of Changes

This adds an example of a gRPC tunnel proxy for DZDs which enables the ability to subscribe to gNMI streaming telemetry samples without the requirement of dialing into devices. The tunnel proxy initiates a gRPC tunnel towards a collector, which then can be used to accept telemetry subscriptions over said tunnel. Subscription requests are then forwarded to the locally running gNMI server via a unix domain socket.

Testing Verification

Start collector instance with configuration to ask for the input pkt counter of Ethernet1 every 10s:

➜  cat config.yaml
insecure: true
username: admin
password: ""

subscriptions:
  sub1:
    stream-mode: SAMPLE
    paths:
      - /interfaces/interface[name=Ethernet1]/state/counters/in-pkts
    sample-interval: 10s

tunnel-server:
  address: :10000
  targets:
    - id: .*
      type: GNMI_GNOI
      config:
        subscriptions:
          - sub1
          - 
➜  gnmic --config ./config.yaml --use-tunnel-server subscribe
...

Start tunnel proxy on device which dials out to collector:

[root@e76554a34f51 app]# ./gnmi_tunnel -tunnel-server-addr 10.0.0.176:10000
time=2025-12-23T01:53:17.761Z level=INFO msg="tunnel client connected to" address=10.0.0.176:10000
time=2025-12-23T01:53:17.770Z level=INFO msg="tunnel client registered to" address=10.0.0.176:10000
time=2025-12-23T01:53:17.774Z level=INFO msg="new session established for target" target="{ID:dzd01 Type:GNMI_GNOI}"

Subscription responses begin to magically show up on the collector:

➜  gnmic --config ./config.yaml --use-tunnel-server subscribe
{
  "source": "dzd01",
  "subscription-name": "sub1",
  "timestamp": 1766454796083385625,
  "time": "2025-12-22T20:53:16.083385625-05:00",
  "updates": [
    {
      "Path": "interfaces/interface[name=Ethernet1]/state/counters/in-pkts",
      "values": {
        "interfaces/interface/state/counters/in-pkts": 9337
      }
    }
  ]
}
{
  "sync-response": true
}

@packethog packethog requested a review from snormore December 23, 2025 02:05
@packethog packethog self-assigned this Dec 23, 2025
@packethog packethog marked this pull request as ready for review December 23, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants