aryeduino
Posts: 2
Joined: Wed Oct 16, 2019 9:39 pm

Setup PiVPN to bridge with my Home router

Wed Oct 16, 2019 9:52 pm

Hi All,

I have set up my PiVPN and I want it to be a bridge with my Home Router that it will give addresses to VPN connection from the same scope as my Router and preventing IP Conflicts.

I have Network of Class C
192.168.1.0/24
and I would be happy if the PiVPN provides IP addresses from that scope as well.

I have used the Server configuration for Class A 10.0.10.0 and it works - that means (as far as I see it) that the PiVPN works OK and provide IP for VPN connection.
As I have mentioned above I want it to bind with my Router Clients list and Provide only FREE IP addresses to the VPN Connections.

Please assist me on how to do that.
I have been trying hard with configurations and not being able to figure out what is the CORRECT configuration I need.

Thanks

User avatar
default_user8
Posts: 678
Joined: Mon Nov 18, 2013 3:11 am

Re: Setup PiVPN to bridge with my Home router

Thu Oct 17, 2019 10:40 pm

I understand what you are asking, I just can't figure out why you are asking. I used the pivpn setup script and I am able to use any resource on my network when i'm connect to my pivpn(Nextcloud, Plexmediaserver, network printer). Are you having an issue with a resource that you need to access and hence think you need your vpn connections in the same ip range? It may be possible to do what you want, but you'd need something besides your router to be a DHCP server, and you'd need to set your router up as a DHCP forwarder(see pihole documentation for more information). You may need to provide more information on what it is you are trying to accomplish.
Two heads are better than one, unless one's a goat head.

aryeduino
Posts: 2
Joined: Wed Oct 16, 2019 9:39 pm

Re: Setup PiVPN to bridge with my Home router

Sat Oct 19, 2019 11:00 pm

Thanks for your reply.
I am not sure I understand what you are trying to explain since it do not think I have reached that step already.
I have a Brand new installation of PiVPN and I want to be alre to use it (using duckdns) from out side the network and to get 192.168.1.xxx IP.
I have not been able to set it correctly at all.
I have added server 10.0.10.xx to the configuration and I was able to connect from OUTSIDE and I got IP 10.0.10.2 (i.e) - can I connect using that IP to my LAN using the 192.168.1.0/24 network?
Please assist. thank you

User avatar
default_user8
Posts: 678
Joined: Mon Nov 18, 2013 3:11 am

Re: Setup PiVPN to bridge with my Home router

Sun Oct 20, 2019 3:47 am

This is my server.conf file:
dev tun
proto udp
port "redacted"
ca /etc/openvpn/easy-rsa/pki/ca.crt
cert /etc/openvpn/easy-rsa/pki/issued/server_"redacted".crt
key /etc/openvpn/easy-rsa/pki/private/server_"redacted".key
dh none
topology subnet
server 10.8.0.0 255.255.255.0
# Set your primary domain name server address for clients
push "dhcp-option DNS 10.33.64.165"
push "block-outside-dns"
# Override the Client default gateway by using 0.0.0.0/1 and
# 128.0.0.0/1 rather than 0.0.0.0/0. This has the benefit of
# overriding but not wiping out the original default gateway.
push "redirect-gateway def1"
client-to-client
keepalive 1800 3600
remote-cert-tls client
tls-version-min 1.2
tls-crypt /etc/openvpn/easy-rsa/pki/ta.key
cipher AES-256-CBC
auth SHA256
user nobody
group nogroup
persist-key
persist-tun
crl-verify /etc/openvpn/crl.pem
status /var/log/openvpn-status.log 20
status-version 3
syslog
verb 3
#DuplicateCNs allow access control on a less-granular, per user basis.
#Remove # if you will manage access by user instead of device.
#duplicate-cn
# Generated for use by PiVPN.io

When i start my connection from my phone or tablet outside my home network it's like I'm connected to my home wifi. So to answer your question, even though my virtual op is 10.8.0.2, i can type in any local ip and access local resources.

This is what my pivpn -c looks like while connected.
::: Client Status List :::
Bytes Bytes
Name Remote IP Virtual IP Received Sent Connected Since
HTC "redacted" 10.8.0.2 12KiB 16KiB Oct 19 2019 - 22:48:50

Hope this helps.
Two heads are better than one, unless one's a goat head.

maverik0106
Posts: 6
Joined: Fri Jul 26, 2019 7:45 pm

Re: Setup PiVPN to bridge with my Home router

Wed Nov 06, 2019 4:36 am

I'm going to go on a limb here and say that maybe there's some specific uses where certain resource at home/office requires the local IP range... in his case it could be a specific resource needs to see his computer as a 192.168.0.xxx whereas as you're pointing it out you could technically just access any info from the one client.

dorian-ny
Posts: 50
Joined: Fri Nov 01, 2019 11:29 pm

Re: Setup PiVPN to bridge with my Home router

Thu Nov 07, 2019 11:01 pm

Any particualar reason you want to give them all ip's on both networks instead of just masquarading traffic from your private network to the vpn.
It is not like they are giving you routable ip's, it is just their private network adresses

Return to “Networking and servers”