[Question] support for same subnet #17

Closed
opened 2022-10-20 02:56:21 -04:00 by andy-vm · 4 comments
andy-vm commented 2022-10-20 02:56:21 -04:00 (Migrated from github.com)

Hi may I ask if the vpn supports VMs within same subnet but across different locations, as shown below:

can I only install the VPN on the 2 servers itself then route packet for all 4 VMs in the 2 servers?

image

[main]
port = 23456
broadcast = 192.168.2.255
netcidr = 24
recvThreads = 4
sendThreads = 4

[remote "prague"]
ExtIP = 10.0.0.2
LocIP = 192.168.2.2
route = 192.168.2.0/24

[remote "berlin"]
ExtIP = 10.0.0.3
LocIP = 192.168.2.1
route = 192.168.2.0/24

Hi may I ask if the vpn supports VMs within same subnet but across different locations, as shown below: can I only install the VPN on the 2 servers itself then route packet for all 4 VMs in the 2 servers? ![image](https://user-images.githubusercontent.com/108446482/196877008-81974c5d-ba32-4104-8098-29e9a69763c4.png) [main] port = 23456 broadcast = 192.168.2.255 netcidr = 24 recvThreads = 4 sendThreads = 4 [remote "prague"] ExtIP = 10.0.0.2 LocIP = 192.168.2.2 route = 192.168.2.0/24 [remote "berlin"] ExtIP = 10.0.0.3 LocIP = 192.168.2.1 route = 192.168.2.0/24
kanocz commented 2022-10-20 03:11:24 -04:00 (Migrated from github.com)

not in this case :(
lcvpn has ip-based routing, it doesn't have "link-layer" that allow you to use arp and then use something like "proxy arp" or "bridge"
the only option is to divide /24 for example in 2x /25 network
so first one will be 192.168.2.1 with route 192.168.2.0/25 (VMs on 192.168.2.3-127)
and the second 192.168.2.129 with route 192.168.2.128/25 (VMs 192.168.2.130-254)
but this not much different from using 2x /24 subnets

not in this case :( lcvpn has ip-based routing, it doesn't have "link-layer" that allow you to use arp and then use something like "proxy arp" or "bridge" the only option is to divide /24 for example in 2x /25 network so first one will be 192.168.2.1 with route 192.168.2.0/25 (VMs on 192.168.2.3-127) and the second 192.168.2.129 with route 192.168.2.128/25 (VMs 192.168.2.130-254) but this not much different from using 2x /24 subnets
andy-vm commented 2022-10-20 03:15:02 -04:00 (Migrated from github.com)

thanks for the prompt reply
does it work if I use vxlan to connect both servers?

thanks for the prompt reply does it work if I use vxlan to connect both servers?
kanocz commented 2022-10-20 03:41:28 -04:00 (Migrated from github.com)

vxlan uses ethernet-level packets, so it looks like possible solution

vxlan uses ethernet-level packets, so it looks like possible solution
l0k18 commented 2022-10-20 04:50:49 -04:00 (Migrated from github.com)

Not sure if this will help or no, but I wrote this to handle correctly avoiding listening on higher priority VPN ports and enabling LAN and loopback peering between instances of my servers: https://github.com/cybriq/p9/blob/main/pkg/util/routeable/routeable.go. It exploits the fact that VPN tunnels don't have multicast capability and uses routing table information to help filter them.

Not sure if this will help or no, but I wrote this to handle correctly avoiding listening on higher priority VPN ports and enabling LAN and loopback peering between instances of my servers: [https://github.com/cybriq/p9/blob/main/pkg/util/routeable/routeable.go](https://github.com/cybriq/p9/blob/main/pkg/util/routeable/routeable.go). It exploits the fact that VPN tunnels don't have multicast capability and uses routing table information to help filter them.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kanocz/lcvpn#17
No description provided.