Cnm Client
This example shows how to configure CNM on a device.
CNM URL Reception Via DHCP
Description
Tests for DHCP propagation of CNM URL
Scenario
Step 1: Set the following configuration in DUT1 :
set interfaces ethernet eth0 address 192.168.100.100/24 set service dhcp-server shared-network test subnet 192.168.100.0/24 start 192.168.100.150 stop 192.168.100.155 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 2: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 10.215.168.100/24 set interfaces ethernet eth4 address dhcp set protocols static route 0.0.0.0/0 next-hop 10.215.168.1 set service cnm dhcp set service cnm role router set service cnm url 'https://test1.cnm3dev.networkcloudmanager.com' set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 3: Ping IP address 8.8.8.8 from DUT0:
admin@DUT0$ ping 8.8.8.8 count 1 size 56 timeout 1Show output
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=111 time=6.29 ms --- 8.8.8.8 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 6.285/6.285/6.285/0.000 ms
Step 4: Run command service cnm show at DUT0 and check if output contains the following tokens:
https://test1.cnm3dev.networkcloudmanager.comShow output
CNM Server URL: https://test1.cnm3dev.networkcloudmanager.com CNM State Machine State: Not connected. No SSL certificate available CNM Mode: ROUTER Last successful connection: Thu Dec 11 13:58:27 2025 Stats (Total | Fail): Load Configuration: 0 | 0 Purge Security: 0 | 0 Wait-Confirm messages: 0 | 0 Confirm Config: 0 | 0 CACert chain updates: 0 | 0 Errors: Requests to CNM Server failed: 0 Authentication errors: 0 Registering errors: 0 Devices (IP | Model): No devices registered
Step 5: Run command configure at DUT1 and expect this output:
Step 6: Run command set service dhcp-server shared-network test subnet 192.168.100.0/24 options vendor-options data ascii 'mngplat:url=https://test2.cnm3dev.networkcloudmanager.com/&other=other' at DUT1 and expect this output:
Step 7: Run command commit at DUT1 and expect this output:
Step 8: Run command service dhcp-client renew interface eth4 at DUT0 and expect this output:
Show output
Renewing DHCP lease on interface eth4...
Step 9: Run command service cnm show at DUT0 and check if output contains the following tokens:
https://test2.cnm3dev.networkcloudmanager.comShow output
CNM Server URL: https://test2.cnm3dev.networkcloudmanager.com/ CNM State Machine State: Not connected. No SSL certificate available CNM Mode: ROUTER Last successful connection: Thu Dec 11 13:58:27 2025 Stats (Total | Fail): Load Configuration: 0 | 0 Purge Security: 0 | 0 Wait-Confirm messages: 0 | 0 Confirm Config: 0 | 0 CACert chain updates: 0 | 0 Errors: Requests to CNM Server failed: 2 Authentication errors: 0 Registering errors: 0 Last error: Could not resolve host: test1.cnm3dev.networkcloudmanager.com (0:00:07 ago) Devices (IP | Model): No devices registered
CNM Connection to external server
Description
In this scenario, the DUT is connected to a CNM server.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 10.215.168.100/24 set protocols static route 0.0.0.0/0 next-hop 10.215.168.1 set service cnm poll-interval 8 set service cnm role router set service cnm url your-cnm-server.com set service dns resolver name-server 192.168.212.3 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 2: Modify the following configuration lines in DUT0 :
set service cnm url qa.networkcloudmanager.com
Warning
Use your CNM server URL instead of <your-cnm-server.com>
Step 3: Run command service cnm show | grep "CNM State Machine State" at DUT0 and check if output matches the following regular expressions:
CNM State Machine State:\s+CONNECTEDShow output
CNM State Machine State: CONNECTED