tabacha / prosafelinux Goto Github PK
View Code? Open in Web Editor NEWConfigure Netgear ProSafe Plus Switches on linux
License: Other
Configure Netgear ProSafe Plus Switches on linux
License: Other
Hi
looking into readme
./psl.py --help
where is the file psl.py?
thanks T
I have written a prosave-mqtt server to monitor the traffic.
The only problem is I can not reliable receive messages from two or more switches... The whole program gets confused...
------ 8< -------------
Also for those protocol aficionados
https://github.com/Tristan79/ProSafeLinux/blob/master/psl_class.py#L74
LAG/QoS/Loopdetection... everything I could find that is missing.
Still have to implement them :-)
By default the timeout of 0.005 is too short for my laptop to talk to the switch (GS105E) even when directly connected (i.e. with no other network device between the laptop and the switch):
% ./psl-cli.py discover
Searching for ProSafe Plus Switches ...
Traceback (most recent call last):
File "./psl-cli.py", line 191, in <module>
main()
File "./psl-cli.py", line 187, in main
cmd_funcs[args.operation](args, switch)
File "./psl-cli.py", line 16, in discover
data = switch.discover()
File "/home/laurence/Projects/ProSafeLinux/psl_class.py", line 383, in discover
self.mac_cache[message[self.CMD_MAC]] = message[self.CMD_IP]
TypeError: 'bool' object has no attribute '__getitem__'
Changing the timeout to 0.05 by default, in recv_all, fixes the problem:
% git diff
diff --git a/psl_class.py b/psl_class.py
index d041630..5157b6a 100644
--- a/psl_class.py
+++ b/psl_class.py
@@ -206,7 +206,7 @@ class ProSafeLinux:
print("recv=" + message_hex)
return (message, address)
- def recv_all(self, maxlen=8192, timeout=0.005):
+ def recv_all(self, maxlen=8192, timeout=0.05):
"receive all pending packets"
while True:
(message, address) = self.recv(maxlen, timeout)
and now:
% ./psl-cli.py discover
Searching for ProSafe Plus Switches ...
MAC: 28:c6:8e:fb:1d:a4
ip: 192.168.0.105
dhcp: on
name:
model: GS105E
Could you add an option to specify the timeout as a command line argument? e.g. '--timeout 0.05'?
Many thanks,
Laurence
Hi Sven,
I just recognized we independently started to work on the same stuff.
I think it might be a good Idea to merge our current work and work together on this one?
You can have a look at what I did so far:
https://github.com/Z3po/Netgearizer
What do you think?
Regards,
Sebastian
./psl.py --debug --interface eth1 set --mac e0:46:9a:25:35:9d --passwd password --vlan802_id 1 1,3 2 --vlan802_id 4 4 2 --vlan802_id 5 5 2 --vlan802_id 6 6 2 --vlan802_id 7 7 2 --vlan802_id 8 8 2
Changing Values..
send to ip 255.255.255.255 data = 010100000000000000163e19e1e1e0469a25359d0000042f4e534450000000000004000000060000ffff0000
recv=010200000000000000163e19e1e1e0469a25359d0000042f4e5344500000000000040006e0469a25359d00060004c0a80b74ffff0000
cmd= 4 len= 6 data= e0469a25359d
cmd= 6 len= 4 data= c0a80b74
cmd= 65535 len= 0 data=
Store MAC, IP: e0:46:9a:25:35:9d 192.168.11.116
send to ip 192.168.11.116 data = 010300000000000000163e19e1e1e0469a25359d000004304e53445000000000000a000870617373776f72642800000400080140ffff0000
recv=010400000000000000163e19e1e1e0469a25359d000004304e53445000000000ffff0000
cmd= 65535 len= 0 data=
{<psl_typ.PslTypEnd instance at 0x24967a0>: None,
'ctype': 260,
'flags': 0,
'mymac': '00163e19e1e1',
'seq': 1072,
'theirmac': 'e0469a25359d'}
success
Hi,
Using the current ProSafeLinux master branch, I could not set any options on my GS108Ev3 switch. Authentication always failed with the following string:
Changing Values..
using password hack on firmware: 20008
FAILED: Error with password
Digging into the code I found the problem was easily fixed: The incorrect variable “_password” is being used instead of “_plainpass” on line 363 of psl_class.py. This meant an empty password was being used to authenticate with the switch instead of the password passed as a parameter on the command line.
Can someone update the repo? Or provide me access so I can push the update?
Regards,
Stephan.
This tool doesn't work with firmware 1.6.0.3, at least not the discovery.
Hi,
maybe I am overseeing it, but is there a psl-cli.py somewhere an option where I can see all possible set commands I can use?
/psl-cli.py --interface enp1s0 query --mac 22:22:22:22:22:22 vlan_pvid
Query Values..
Vlan_pvid Port VLAN_ID
1 1
2 1
3 1
4 1
5 1
works so far so good, but I am very curious about all other configuration options, like IGMP and so on.
Thanks a lot
Cheers
4920441
./psl.py --debug --interface eth1 set --mac e0:46:9a:25:35:9d --passwd password --vlan802_id 15 7 2
Changing Values..
send to ip 255.255.255.255 data = 010100000000000000163e19e1e1e0469a25359d0000021f4e534450000000000004000000060000ffff0000
recv=010200000000000000163e19e1e1e0469a25359d0000021f4e5344500000000000040006e0469a25359d00060004c0a80b74ffff0000
cmd= 4 len= 6 data= e0469a25359d
cmd= 6 len= 4 data= c0a80b74
cmd= 65535 len= 0 data=
Store MAC, IP: e0:46:9a:25:35:9d 192.168.11.116
send to ip 192.168.11.116 data = 010300000000000000163e19e1e1e0469a25359d000002204e53445000000000000a000870617373776f726428000004000f0240ffff0000
recv=010400000000000000163e19e1e1e0469a25359d000002204e53445000000000ffff0000
cmd= 65535 len= 0 data=
{<psl_typ.PslTypEnd instance at 0xd84758>: None,
'ctype': 260,
'flags': 0,
'mymac': '00163e19e1e1',
'seq': 544,
'theirmac': 'e0469a25359d'}
success
sven@xen-sunray:~/ProSafeLinux$ ./psl.py --debug --interface eth1 query --mac e0:46:9a:25:35:9d --passwd password vlan802_id
Query Values..
send to ip 255.255.255.255 data = 010100000000000000163e19e1e1e0469a25359d0000024c4e534450000000000004000000060000ffff0000
recv=010200000000000000163e19e1e1e0469a25359d0000024c4e5344500000000000040006e0469a25359d00060004c0a80b74ffff0000
cmd= 4 len= 6 data= e0469a25359d
cmd= 6 len= 4 data= c0a80b74
cmd= 65535 len= 0 data=
Store MAC, IP: e0:46:9a:25:35:9d 192.168.11.116
send to ip 192.168.11.116 data = 010300000000000000163e19e1e1e0469a25359d0000024d4e53445000000000000a000870617373776f7264ffff0000
recv=010400000000000000163e19e1e1e0469a25359d0000024d4e53445000000000ffff0000
cmd= 65535 len= 0 data=
{<psl_typ.PslTypEnd instance at 0x108a758>: None,
'ctype': 260,
'flags': 0,
'mymac': '00163e19e1e1',
'seq': 589,
'theirmac': 'e0469a25359d'}
success
send to ip 192.168.11.116 data = 010100000000000000163e19e1e1e0469a25359d0000024e4e5344500000000028000000ffff0000
recv=010200000000000000163e19e1e1e0469a25359d0000024e4e53445000000000280000040001e000280000040009000028000004002a00002800000400080100280000040004100028000004000508002800000400060400280000040007020028000004000a00ff28000004000b00ff28000004000f00ffffff0000
cmd= 10240 len= 4 data= 0001e000
cmd= 10240 len= 4 data= 00090000
cmd= 10240 len= 4 data= 002a0000
cmd= 10240 len= 4 data= 00080100
cmd= 10240 len= 4 data= 00041000
cmd= 10240 len= 4 data= 00050800
cmd= 10240 len= 4 data= 00060400
cmd= 10240 len= 4 data= 00070200
cmd= 10240 len= 4 data= 000a00ff
cmd= 10240 len= 4 data= 000b00ff
cmd= 10240 len= 4 data= 000f00ff
cmd= 65535 len= 0 data=
{<psl_typ.PslTypVlan802Id instance at 0x108a1b8>: [{'taged_ports': [1, 2, 3],
'untaged_ports': [],
'vlan_id': 1},
{'taged_ports': [],
'untaged_ports': [],
'vlan_id': 9},
{'taged_ports': [],
'untaged_ports': [],
'vlan_id': 42},
{'taged_ports': [8],
'untaged_ports': [],
'vlan_id': 8},
{'taged_ports': [4],
'untaged_ports': [],
'vlan_id': 4},
{'taged_ports': [5],
'untaged_ports': [],
'vlan_id': 5},
{'taged_ports': [6],
'untaged_ports': [],
'vlan_id': 6},
{'taged_ports': [7],
'untaged_ports': [],
'vlan_id': 7},
{'taged_ports': [],
'untaged_ports': [1,
2,
3,
4,
5,
6,
7,
8],
'vlan_id': 10},
{'taged_ports': [],
'untaged_ports': [1,
2,
3,
4,
5,
6,
7,
8],
'vlan_id': 11},
{'taged_ports': [],
'untaged_ports': [1,
2,
3,
4,
5,
6,
7,
8],
'vlan_id': 15}],
<psl_typ.PslTypEnd instance at 0x108a758>: None,
'ctype': 258,
'flags': 0,
'mymac': '00163e19e1e1',
'seq': 590,
'theirmac': 'e0469a25359d'}
Flags: success
-seq 590
-mymac 00163e19e1e1
-ctype 258
-flags 0
Vlan802_id VLAN_ID Taged-Ports Untaged-Ports
1 1,2,3
9
42
8 8
4 4
5 5
6 6
7 7
10 1,2,3,4,5,6,7,8
11 1,2,3,4,5,6,7,8
15 1,2,3,4,5,6,7,8
-theirmac e0469a25359d
if I do a ./psl-cli.py discover
only one switch is discovered in a network with multiple GS108Ev2 switches.
The only way to understand cable_test is to programm a "virtual" switch and then send some random answers to the existing software
Running the discover command I got this error:
Searching for ProSafe Plus Switches ...
Traceback (most recent call last):
File "./psl-cli.py", line 191, in
main()
File "./psl-cli.py", line 187, in main
cmd_funcs[args.operation](args, switch)
File "./psl-cli.py", line 16, in discover
data = switch.discover()
File "/home/ianm/Downloads/ProSafeLinux-master/psl_class.py", line 383, in discover
self.mac_cache[message[self.CMD_MAC]] = message[self.CMD_IP]
TypeError: 'bool' object has no attribute 'getitem'
I'm using Python 2.7.3 and Fedora 18. This might be user error on my part.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.