abrasive / nxBender

Open source client for netExtender SSL VPNs
BSD 3-Clause "New" or "Revised" License
41 stars 20 forks source link

pyroute2 error #2

Closed mawxcarroll closed 5 years ago

mawxcarroll commented 6 years ago

Hi!

I've been frustrated with netExtender on Linux for years now (flaky performance, weird issues, etc). This project would be a wonderful solution. I'm willing to help however I can -- probably mostly debugging right now, but I'll try to learn on the fly and see if I can contribute anything.

I'm trying right now to get this working on a Manjaro installation. I get the following output:

sudo ./nxBender --server ### -u ### -p ### -d ### --fingerprint ### INFO: Logging in... INFO: Starting session... INFO: Duplicated srv_options value dnsSuffixes = xxx.edu INFO: Dialing up tunnel... INFO: Shutting down... Traceback (most recent call last): File "./nxBender", line 12, in nxbender.main() File "/home/tcarroll/nxBender-master/nxbender/init.py", line 39, in main sess.run() File "/home/tcarroll/nxBender-master/nxbender/nx.py", line 50, in run self.tunnel() File "/home/tcarroll/nxBender-master/nxbender/nx.py", line 126, in tunnel pppd.run() File "/home/tcarroll/nxBender-master/nxbender/ppp.py", line 70, in run stop = self._pump() File "/home/tcarroll/nxBender-master/nxbender/ppp.py", line 123, in _pump self.routecallback(remote_ip) File "/home/tcarroll/nxBender-master/nxbender/nx.py", line 134, in setup_routes ip.route("add", dst=dst, gateway=gateway) File "/usr/lib/python2.7/site-packages/pyroute2/iproute.py", line 1750, in route callback=callback) File "/usr/lib/python2.7/site-packages/pyroute2/netlink/nlsocket.py", line 804, in nlm_request return do_try() File "/usr/lib/python2.7/site-packages/pyroute2/netlink/nlsocket.py", line 783, in do_try callback=callback) File "/usr/lib/python2.7/site-packages/pyroute2/netlink/nlsocket.py", line 648, in get raise msg['header']['error'] pyroute2.netlink.exceptions.NetlinkError: (17, 'File exists')

I noticed the "Duplicated srv_options value dnsSuffixes" error. The server response included two values for that parameter: xxx.local and xxx.edu. I modified the code a bit to skip the first one and keep the second one. That got rid of the "Duplicated..." error but nothing else changed.

I also tried installing the latest version of pyroute2 from github but that didn't seem to work. (Not convinced I did that correctly; I'm not super familiar with the python environment.)

It looks like the error is not originating in your code... but any suggestions on how to proceed would be great.

Thanks for creating a project like this!

Cheers, tom

mawxcarroll commented 6 years ago

Okay, I made some progress on this. It looks like the server was responding with at least one route duplicated. I modified the code in nx.py to check if the route was already in the list before adding it. That got me past the above error and to a reported successful connection ("Remote routing configured, VPN is up").

I'm trying to ssh into a server on the vpn, but I get the following errors:

pppd: sent [LCP EchoReq id=0x1 magic=0x26245c29] pppd: sent [LCP EchoReq id=0x2 magic=0x26245c29] pppd: No response to 2 echo-requests pppd: Serial link appears to be disconnected. pppd: Connect time 0.5 minutes. pppd: Sent 19474 bytes, received 0 bytes. pppd: Script /etc/ppp/ip-down started (pid 12273) pppd: sent [LCP TermReq id=0x3 "Peer not responding"] pppd: Script /etc/ppp/ip-down finished (pid 12273), status = 0x0 pppd: sent [LCP TermReq id=0x4 "Peer not responding"] pppd: Connection terminated. pppd: Modem hangup INFO: pppd exited with code 16

Strangely, this might be the same behavior I see from netExtender. For certain local ip addresses I get a "successful" connection but I can't actually access any resources. For example, if I am assigned 10.10.12.22 I cannot access anything on the vpn, but if I am assigned 10.10.12.26, everything works fine. Since I have no control over what ip I am assigned, netExtender is functionally broken.

My hope here is that I have access to lots more diagnostic info and maybe I can figure out what the issue is.