I highly recommend you make sure you have the actions setup for both the new and old tunnels, and have the cron job setup.
Now I seem to have messed it all up.Had a brief server crash, and it obviously did some kind of reset (asked me to send a crash report).I was still doing setup and hadn't done the cron thing.I went back and added the original PIAWireguard.py file, with the relevant changes.However when I run PIAWireguard.py debug, I keep getting wireguardserver addKey request failed non 200 status code - Trying to add instance public key to server in exchnage for connection informationNot sure what that means, and I can't find other errors. The other gateways (US & UK) came up fine when I ran the scripts and readded the gateways etc.Any suggestions?
You're really on the ball - thanks for monitoring this thread so closely!A little more playing around and I currently have all gateways up and running again.One of the issues had been that I was editing the PIAWireguard.py file on my desktop, and had forgotten to copy it back across to OPNsense. Schoolboy error I'm afraid I'm now showing 3 different public IP addresses.Before going any further I'll see if I can get the Cron jobs set up, then I'll look a bit more closely at my firewall rules. Still trying to get the hang of those, but so far the UK streaming sites are not working for me.
Streaming can be a tricky one, you may need to use PIA DNS servers, as PIA do some DNS tricky to get streaming services working. But if you look in the regions list you'll see uk_2 which is described as a streaming optimised region, so you may need to use that region id in your setup, failing that PIA DNS maybe required.Cron Jobs should be pretty easy.Make sure your action file contains actions for all 3 setups, then reload the configd. Then the 3 actions will appear in the cron section of the webui.
Yes, I just confirmed that the actions file has all 3 setups contained within it.There are 3 distinct entries in Cron now as well. So I guess that's good.I have selected the uk_2 server for British streaming.I think you might be onto something with the DNS holding me back.Ideally I would like to capture the DNS and route appropriately for each tunnel, although it looks as though all tunnels utilise the same internal IP addresses for DNS.I am attempting to make sense of https://docs.opnsense.org/manual/how-tos/wireguard-selective-routing.html#dealing-with-dns-leaks in order to route the DNS appropriately. In fact I had started a separate thread about it a few days ago at https://forum.opnsense.org/index.php?topic=24416.0, but as yet don't have it working.
root@OPNsense:~ # /conf/PIAWireguard.py debugTraceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn conn = connection.create_connection( File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 96, in create_connection raise err File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 86, in create_connection sock.connect(sa)TimeoutError: [Errno 60] Operation timed outDuring handling of the above exception, another exception occurred:Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 382, in _make_request self._validate_conn(conn) File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn conn.connect() File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 353, in connect conn = self._new_conn() File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn raise NewConnectionError(urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0xcb2553f610>: Failed to establish a new connection: [Errno 60] Operation timed outDuring handling of the above exception, another exception occurred:Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen retries = retries.increment( File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 574, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause))urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='127.0.0.1', port=443): Max retries exceeded with url: /api/wireguard/server/searchServer/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0xcb2553f610>: Failed to establish a new connection: [Errno 60] Operation timed out'))During handling of the above exception, another exception occurred:Traceback (most recent call last): File "/conf/PIAWireguard.py", line 202, in <module> r = requests.get(f'{opnsenseURL}/api/wireguard/server/searchServer/', auth=(config['opnsenseKey'], config['opnsenseSecret']), verify=urlVerify) File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 76, in get return request('get', url, params=params, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request)requests.exceptions.ConnectionError: HTTPSConnectionPool(host='127.0.0.1', port=443): Max retries exceeded with url: /api/wireguard/server/searchServer/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0xcb2553f610>: Failed to establish a new connection: [Errno 60] Operation timed out'))root@OPNsense:~ #
Hmm...I've installed the latest version of the script, and it has stopped working for me. I've done something stupid, I'm sure, but I don't know what.Can anyone help?Code: [Select]root@OPNsense:~ # /conf/PIAWireguard.py debugTraceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn conn = connection.create_connection( File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 96, in create_connection raise err File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 86, in create_connection sock.connect(sa)TimeoutError: [Errno 60] Operation timed outDuring handling of the above exception, another exception occurred:Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 382, in _make_request self._validate_conn(conn) File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn conn.connect() File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 353, in connect conn = self._new_conn() File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn raise NewConnectionError(urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0xcb2553f610>: Failed to establish a new connection: [Errno 60] Operation timed outDuring handling of the above exception, another exception occurred:Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen retries = retries.increment( File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 574, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause))urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='127.0.0.1', port=443): Max retries exceeded with url: /api/wireguard/server/searchServer/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0xcb2553f610>: Failed to establish a new connection: [Errno 60] Operation timed out'))During handling of the above exception, another exception occurred:Traceback (most recent call last): File "/conf/PIAWireguard.py", line 202, in <module> r = requests.get(f'{opnsenseURL}/api/wireguard/server/searchServer/', auth=(config['opnsenseKey'], config['opnsenseSecret']), verify=urlVerify) File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 76, in get return request('get', url, params=params, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request)requests.exceptions.ConnectionError: HTTPSConnectionPool(host='127.0.0.1', port=443): Max retries exceeded with url: /api/wireguard/server/searchServer/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0xcb2553f610>: Failed to establish a new connection: [Errno 60] Operation timed out'))root@OPNsense:~ #
Error messages are saying they can't connect to the web interface.Have you changed its port?
wireguardserver addKey request failed non 200 status code - Trying to add instance public key to server in exchnage for connection information
WGInstanceUUID: WGPeerUUID: WGInstance: WGPeer: WGPeer is blank but this isn't an issuemetaServertoronto438178.249.214.97wgServertoronto438178.249.214.109Your PIA Token (Meta), DO NOT GIVE THIS TO ANYONE{ "status": "OK", "token": "redacted"}wireguardserver addKey request failed non 200 status code - Trying to add instance public key to server in exchnage for connection information