Multiple dhcpservers + VPN connections for different ip-rang

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
trnase2
DD-WRT Novice


Joined: 25 Nov 2022
Posts: 3

PostPosted: Mon Nov 28, 2022 7:02    Post subject: Multiple dhcpservers + VPN connections for different ip-rang Reply with quote
So i have been using ddwrt for a long time, using 2 routers at home as servers and connecting with them from 2 other routers from different countries when i'm there.
- Currently using openvpn
- local ip range: 192.168.1.0
- openvpn range: 192.168.2.0
- policy based routing open vpn set on the 192.168.2.0 range
- a bridge with dhcp server that gives the 192.168.2.0 range
- bridged it with a virutal wifi ssid.

So connecting with port or normal wifi gives me normal wan on 192.168.1.1
Connecting with v-ssid gives me the vpn connection on 192.168.2.1

Now i want to make a 'simple' change to move to wiregueard because it's faster on my older netgear 3700. Also this router doesn't have the best wifi as well. And I have my house decorated with the devco m4 wifi boosters in accesspoint.

So i want:

- Modem->bridge->DD-WRT(router)->Wifiboosters(accespoint)
- on DD-WRT have the normal dhcp for wan on 192.168.1.0
- on DD-WRT a second dhcp for my wireguard tunnel vpn on ip-range 192.168.2.0
*later i want to add other wireguard tunnels with different ip-range each*
- Then when i'm connected with wifi (or cable) and want to use the vpn, to manual change the ipv4 on laptop/phone to the 192.168.2.0 range to be routed over the vpn
- When this works I will make a second ssid to only have the manual override on.

+ already have the wireguard tunnel set up
+ using it now on the vap with bridge on 192.168.2.0

Any tips advices you can give me to set it up like this?
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12836
Location: Netherlands

PostPosted: Mon Nov 28, 2022 7:29    Post subject: Reply with quote
WireGuard documentation is a sticky in this forum:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327397

It works similar as OpenVPN so has the same Policy based routing options to make it possible to route only a specific subnet via the tunnel.

WireGuard should get you approx. 3 times the speed of OpenVPN.

P.S. to give the best support it helps if you state router model and build number

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
trnase2
DD-WRT Novice


Joined: 25 Nov 2022
Posts: 3

PostPosted: Mon Nov 28, 2022 8:27    Post subject: Reply with quote
my usual experience is that after days trying, then asking the question finally, i'll end up with the answer which i did already.

i will just keep the router on dhcp with range 192.168.1.0
have removed the extra tunnel for the vap
then in the first tunnel i've added policy based routing with:
192.168.1.200/30
192.168.1.204/29
192.168.1.208/28
192.168.1.224/27

So al 200 and up is going now trough the tunnel.

Want to also set up a second tunnel to a different server from 150-199 using
192.168.1.150/31
192.168.1.152/29
192.168.1.160/27
192.168.1.192/29

Also easier then having differnt ip-ranges, and it's exactly what i wanted Razz
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12836
Location: Netherlands

PostPosted: Mon Nov 28, 2022 10:56    Post subject: Reply with quote
You can certainly split your DHCP range but you can do it smarter than you are doing.

Use a CIDR calculator: https://www.ipaddressguide.com/cidr

I use my DHCP range on Setup page starting at .64 for 64 addresses
This is 192.168.0.64/26

I use 192.168.0.128/26 for a range of .128 - .191

If you use 192.168.0.192/27 you will get 32 addresses from .192 - .223

You get the idea Smile

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
trnase2
DD-WRT Novice


Joined: 25 Nov 2022
Posts: 3

PostPosted: Mon Nov 28, 2022 14:18    Post subject: Reply with quote
indeed, i did this with the calculator.
now 150-199 goes trough 1 tunnel
200-255 goed trough the second
all underneath will just run trough my wan, easy to remember where which one goes to Razz
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum