As the network scale increases, carriers need to optimize networks and rectify faults based on device information. For example, if a user wants to monitor an interface for a period of time, configure dynamic telemetry subscription. To stop monitoring, tear down the connection. The subscription is automatically canceled and cannot be restored. This avoids the long-term load on devices and simplifies the interaction between users and devices.
As shown in Figure 1, DeviceA supports telemetry and establishes a gRPC connection with the collector. Interface1 of DeviceA needs to be monitored, and data needs to be sent to the collector as required.
The configuration roadmap is as follows:
Set the source IP address to be listened for during dynamic telemetry subscription.
Configure the number of the port to be listened during dynamic telemetry subscription.
Enable the gRPC service.
To complete the configuration, you need the following data:
IP address of Interface1: 192.168.1.1 (Interface1 on DeviceA and the collector must be routable.)
Number of the port to be listened for: 20000
<HUAWEI> system-view [~HUAWEI] sysname DeviceA [*HUAWEI] commit [~DeviceA] aaa [~DeviceA-aaa] local-user hhww123 password irreversible-cipher Hello-13579 [*DeviceA-aaa] local-user hhww123 service-type http [*DeviceA-aaa] local-user hhww123 user-group manage-ug [~DeviceA-aaa] commit [~DeviceA-aaa] quit
[~DeviceA] interface GigabitEthernet0/1/1 [~DeviceA-GigabitEthernet0/1/1] ip address 192.168.1.1 24 [*DeviceA-GigabitEthernet0/1/1] quit [*DeviceA] grpc [*DeviceA-grpc] grpc server [*DeviceA-grpc-server] source-ip 192.168.1.1
[*DeviceA-grpc-server] server-port 20000
[*DeviceA-grpc-server] server enable [*DeviceA-grpc-server] commit
Device A configuration file
# sysname DeviceA # aaa local-user hhww123 password irreversible-cipher $1c$%L%X:Jn3hY$5^%T5I\4HG>j|i~s,{.@FpH*2XGM\R;7#$"\i!L0$ local-user hhww123 service-type http local-user hhww123 user-group manage-ug # interface GigabitEthernet0/1/1 undo shutdown ip address 192.168.1.1 255.255.255.0 # grpc # grpc server source-ip 192.168.1.1 server-port 20000 server enable # return