cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
206
Views
0
Helpful
5
Replies
Beginner

Configuring a switch Using C++

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.

5 REPLIES 5
Collaborator

Re: Configuring a switch Using C++

 

 - No that is not possible ; I also haven't the faintest idea what a duplicate IP address device is ?
   M.

Beginner

Re: Configuring a switch Using C++

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.

Collaborator

Re: Configuring a switch Using C++

 

        >... 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.

 

Beginner

Re: Configuring a switch Using C++

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 

Collaborator

Re: Configuring a switch Using C++

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:

  • SSH
  • Telnet (no very secure)
  • SNMP

In your position I would use Python to connect via SSH using the Netmiko library.

https://pynet.twb-tech.com/blog/automation/netmiko.html

CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards