10-20-2019 09:01 PM - edited 10-20-2019 10:09 PM
Hi ,
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.
10-20-2019 11:57 PM
- No that is not possible ; I also haven't the faintest idea what a duplicate IP address device is ?
M.
10-21-2019 07:26 PM
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.
10-21-2019 10:45 PM
>... 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.
M.
10-23-2019 09:07 AM
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
10-24-2019 01:47 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide