[Solved] Class B subnet for VPN

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Locked
ueo
OpenVpn Newbie
Posts: 4
Joined: Mon Mar 20, 2017 7:32 am

[Solved] Class B subnet for VPN

Post by ueo » Mon Mar 20, 2017 10:48 am

Dear all,
I do not understand exactly how I can create a VPN with two subnet:
My Openopen vpn server actually is working correctly using ony the subnet 10.8.0.x and now I would like to extend it using other client subnet (10.8.1.x):
I'm using a routed vpn consequently I've modified the server conf in this way :
server.conf
  • topology subnet
    server 10.8.0.0 255.255.252.0
    route 10.8.0.0 255.255.252.0
    route 10.8.1.0 255.255.252.0
    client-to-client
    client-config-dir ccd
then in the folder ccd I've add
client1 with the following line.
  • ifconfig-push 10.8.1.3 255.255.255.0
Can someone explain what I'm wrong?

Best regards
Matteo

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Dual subnet

Post by TinCanTech » Mon Mar 20, 2017 1:38 pm


ueo
OpenVpn Newbie
Posts: 4
Joined: Mon Mar 20, 2017 7:32 am

Re: Dual subnet

Post by ueo » Mon Mar 20, 2017 2:54 pm

Thanks lot, but I've already read this link. But I don't need to connect the LAN beside my client. I'd like to split the client IP in two different subnet, may be I don't understand correctly.
Client1 10.8.0.3 (this lan has only this PC)
Client2 10.8.1.5 (this lan has only this PC)

Now I configure the client2 whit the correct ip number , but client 2 cannot reach the server 10.8.0.1. Seems I'm wrong something in the pushed routing table.

Best regads

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Dual subnet

Post by TinCanTech » Mon Mar 20, 2017 3:05 pm

I have no idea what you are trying to do ..

This:
ueo wrote:server.conf
  • topology subnet
    server 10.8.0.0 255.255.252.0
    client-config-dir ccd
then in the folder ccd I've add client1 with the following line.
  • ifconfig-push 10.8.1.3 255.255.255.0
will not work ..

ueo
OpenVpn Newbie
Posts: 4
Joined: Mon Mar 20, 2017 7:32 am

Re: Dual subnet

Post by ueo » Thu Mar 23, 2017 3:12 pm

Hi TinCanTec my simple question is:
How can I use more then 256 Ip number in my VPN? this is what is not clear to me.
Actually I've a VPN lan from 10.8.0.0 to 10.8.0.254, how can increase the number of IP adding also the subnet 10.8.1.0 to 10.8.1.254? In my setup i need to connect directly any single PC to the server. Consequently I'de like to have
client1 -> 10.8.0.3
client2 -> 10.8.0.4
[...]
client(n) -> 10.8.0.254
client(n+1) -> 10.8.1.1

Should I must use another OpenVpn instance?

In theory should be enought using the netmask 255.255.0.0, isn't ?
Thank's you for your patience.

Best regards
Matteo

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Dual subnet

Post by TinCanTech » Thu Mar 23, 2017 3:41 pm

ueo wrote:In theory should be enought using the netmask 255.255.0.0
Yes .. provided you do it right !

May be you need to learn how subnet masks work.

ueo
OpenVpn Newbie
Posts: 4
Joined: Mon Mar 20, 2017 7:32 am

Re:[SOLVED] Dual subnet

Post by ueo » Thu Mar 23, 2017 3:43 pm

I found in my configuration one lost route command
route 10.8.0.0 255.255.255.0 that probably broke my routing table i suppose I've previously removed :)
so my configuration now is:

server 10.8.0.0 255.255.0.0
in the server.conf the is no routing command

and the ccd folder

client1 contain
ifconfig-push 10.8.1.2 255.255.0.0

Thanks you!

Locked