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

Configuring a switch Using C++

japinder
Level 1
Level 1

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

marce1000
VIP
VIP

 

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



-- ' 'Good body every evening' ' this sentence was once spotted on a logo at the entrance of a Weight Watchers Club !

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.

 M.

 



-- ' 'Good body every evening' ' this sentence was once spotted on a logo at the entrance of a Weight Watchers Club !

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 

James Hawkins
Level 8
Level 8

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

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: