1
Virtual private networks / Accessing IP camera on wireguard client site
« on: April 06, 2024, 10:22:03 pm »
I have a remote client connected via wireguard to my OPNsense router that serves for off-site backups. Now I added a camera on that location that I would like to access from my main network as well.
My main network is on 192.168.50.1/24, the remote network is 192.168.8.1/24 with the WG client sitting on 192.168.8.10 and the camera on 192.168.8.89. The WG network is 10.0.9.0/24
From what I read up i understood that i need to add the ip of the camera under alllowed networks of WG client config under Peer. Also I have added the camera IP to the Allowed IPs of the peer in OPNSense
Now i understand i need to create a static route in Opnsense so i can access the device, but I am not sure what to put in there. I did the following:
- created a new gateway on the wireguard interface with the ip address 10.0.9.80 (WG IP address of the remote client with the local address 192.168.8.10)
- a route between the newly created WG gateway and the local address of the WG client (192.168.8.10/24)
I tried here different IP addresses, but none of them worked.
Any idea how to proceed with this?
Thanks a lot
My main network is on 192.168.50.1/24, the remote network is 192.168.8.1/24 with the WG client sitting on 192.168.8.10 and the camera on 192.168.8.89. The WG network is 10.0.9.0/24
From what I read up i understood that i need to add the ip of the camera under alllowed networks of WG client config under Peer. Also I have added the camera IP to the Allowed IPs of the peer in OPNSense
Code: [Select]
[Interface]
PrivateKey = xxxxxxxxxxxxxxxxxx
Address = 10.0.9.80/32
DNS = 192.168.50.1
MTU = 1400
[Peer]
Endpoint = mydomain.com:51820
PublicKey = xxxxxxxxxxxxxxxxxxxxxxx
AllowedIPs = 192.168.50.1/24, 192.168.8.89/32
PersistentKeepalive = 25
Now i understand i need to create a static route in Opnsense so i can access the device, but I am not sure what to put in there. I did the following:
- created a new gateway on the wireguard interface with the ip address 10.0.9.80 (WG IP address of the remote client with the local address 192.168.8.10)
- a route between the newly created WG gateway and the local address of the WG client (192.168.8.10/24)
I tried here different IP addresses, but none of them worked.
Any idea how to proceed with this?
Thanks a lot