Networking Forums

Networking Forums > Computer Networking > Linux Networking > Control Ethernet switch from script using SSH

Reply
Thread Tools Display Modes

Control Ethernet switch from script using SSH

 
 
Alexey Kulentsov
Guest
Posts: n/a

 
      07-15-2007, 09:10 AM
Hi All!

We have Ethernet switch with SSH and web interface. We want control it
and want to do this from script (we have database with allowed MACs and
want to sync switch list according to database). We tried to do this
directly from PHP using ssh2 extension but with no luck (ssh2_shell and
ssh2_exec fails). We don't want to use web interface because of security
problems, speed and complexity. So for current moment we try to find any
way to program switch. Is here any possibility to do this using Linux
utilites? (Yes, I know about security flaw with switch password if it
will be written in script).

P.S. If I select wrong group to ask please point me right direction.
 
Reply With Quote
 
 
 
 
Stephane CHAZELAS
Guest
Posts: n/a

 
      07-15-2007, 10:26 AM
2007-07-15, 12:10(+03), Alexey Kulentsov:
[...]
> We have Ethernet switch with SSH and web interface. We want control it
> and want to do this from script (we have database with allowed MACs and
> want to sync switch list according to database). We tried to do this
> directly from PHP using ssh2 extension but with no luck (ssh2_shell and
> ssh2_exec fails). We don't want to use web interface because of security
> problems, speed and complexity. So for current moment we try to find any
> way to program switch. Is here any possibility to do this using Linux
> utilites? (Yes, I know about security flaw with switch password if it
> will be written in script).

[...]

You can always use expect or perl's Expect module. But if your
switch offers an ssh interface, I'd be surprised if doesn't
provide with an interface to do things more automatically. SNMP
perhaps?

--
Stéphane
 
Reply With Quote
 
Bernie
Guest
Posts: n/a

 
      07-15-2007, 02:21 PM

"Stephane CHAZELAS" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) lid...
> 2007-07-15, 12:10(+03), Alexey Kulentsov:
> [...]
>> We have Ethernet switch with SSH and web interface. We want control it
>> and want to do this from script (we have database with allowed MACs and
>> want to sync switch list according to database). We tried to do this
>> directly from PHP using ssh2 extension but with no luck (ssh2_shell and
>> ssh2_exec fails). We don't want to use web interface because of security
>> problems, speed and complexity. So for current moment we try to find any
>> way to program switch. Is here any possibility to do this using Linux
>> utilites? (Yes, I know about security flaw with switch password if it
>> will be written in script).

> [...]
>
> You can always use expect or perl's Expect module. But if your
> switch offers an ssh interface, I'd be surprised if doesn't
> provide with an interface to do things more automatically. SNMP
> perhaps?
>
> --
> Stéphane


Similarly there's an expect module for Python -
http://pexpect.sourceforge.net/


 
Reply With Quote
 
Alexey Kulentsov
Guest
Posts: n/a

 
      07-15-2007, 05:48 PM
Bernie wrote:

>> [...]
>>
>> You can always use expect or perl's Expect module. But if your
>> switch offers an ssh interface, I'd be surprised if doesn't
>> provide with an interface to do things more automatically. SNMP
>> perhaps?
>>
>> --
>> Stéphane

>
> Similarly there's an expect module for Python -
> http://pexpect.sourceforge.net/
>


Thanks all! Expect is not that I expect but this is the way, we will
test it. It's like DOS times when I fill keyboard buffer and call
Turbo-Basic in my batch compile utility.
About SMNP: we don't sure about SNMP security so don't want to use it.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ethernet Switch RG Windows Networking 4 02-12-2010 04:29 AM
about Logical Link Control and adaptation between Ethernet and Wifi InuY4sha Wireless Internet 0 12-01-2008 01:49 PM
Using an Ethernet switch under XP Aussie-Reg Wireless Networks 1 06-24-2007 03:37 PM
Gigabit Ethernet and Flow Control ChrisW Windows Networking 0 06-22-2006 03:02 PM
Question about flow control over ethernet with TCP C. J. Clegg Linux Networking 3 05-06-2006 10:30 PM



1 2 3 4 5 6 7 8 9 10 11