For one of my project i want to configure a switch using C++ . is it possible ?
My configuration requirement is to switch on and switch off one by one for each port :- Using command switchport On and then switchPort off ( at a time i want to on only 1 port ).
We need to do these because we have duplicate IP address devices Connected to each port. So to avoid Ip address Conflict We want to go with this approach.
Thanks for the reply,
By duplicate IP address devices . I mean , i have to implement a solution for a company which manufacture sensors . all the sensors have same IP address before packaging.
before the sensor get packed it need to be tested with the version number and some otehr info. so that when customer recieve the sensor they would have a default ip address and other default info.
now to automate the testing we need a way to communicate for the testing one at a time but multiple connected to a managed switch. i though if we disable the port of the switch it may not lead to IP clash but i am not sure. i hope it clears duplicate IP address . also let me know how this can be achieved.
>... all the sensors have same IP address before packaging.
That should be considered as a manufacturing fault. The sensors should be made to obtain an address by using DHCP instead.
No its not manufacturing fault.
Consider buying an off the shelf module example a wago controller . They are preloaded with a defaukt ip . And There manual always come with a default IP in the manual and steps to change it .
Also this is a customer requirement so we need to consider whatever they want
I am sure it is possible but why use C++? - most network automation programming is done using a higher level language such as Python.
Really you need to look at what interfaces the switch offers you and then research how to drive those using your language of choice. Typically on a Cisco switch you could use:
In your position I would use Python to connect via SSH using the Netmiko library.