Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Add multiples routes options #95

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Add multiples routes options #95

wants to merge 16 commits into from

Conversation

agustim
Copy link

@agustim agustim commented Aug 24, 2022

Hi @alecbcs @dukzcry
This PR is based on #62 but you can set multiple routes. I've move route field to routes section where you define CIDR and node to route, like this:

interface:
  ...
peers:
  10.0.0.1:
    id: Qm1....
  10.0.0.3:
    id: Qm2...
  ...
routes:
  192.168.3.0/24:
    ip: 10.0.0.3
  0.0.0.0/0:
    ip: 10.0.0.1

@yinheli
Copy link

yinheli commented Jan 31, 2023

Sounds great, ping @alecbcs

@bmullan
Copy link

bmullan commented Jul 21, 2023

I have a question about this multiple routes capability.

The first comment's example says:

interface:
...
peers:
10.0.0.1:
id: Qm1....
10.0.0.3:
id: Qm2...
...
routes:
192.168.3.0/24:
ip: 10.0.0.3
0.0.0.0/0:
ip: 10.0.0.1

I have 2 Ubuntu 22.04 VMs (called vm1 & vm2)

In both VMs I've installed LXD.
in both VMs I've created an LXD container named (cn1).

When Logged into ether cn1 container I can ping anything on the Internet and I can ping "that" LXD Container's VM host.

On each VM I installed hyprspace.

On vm1 my yaml config file looks like:

interface:
name: vmhs
id: QmTB1pXv51fJXLyQF8JiwPQNFZCRj8vSVQAJrGPDBdpG5k
listen_port: 8001
address: 172.16.1.1/12
private_key: !!binary |
... key value

peers:
172.16.1.1:
id: QmTB1pXv51fJXLyQF8JiwPQNFZCRj8vSVQAJrGPDBdpG5k
172.16.1.2:
id: Qmaea2NerBfsCunQVnck34bF9mNLrrDYZdLV1LydcL9PKz
routes:
10.169.80.0/24:
ip: 172.16.1.1
0.0.0.0/0:
ip: 172.16.1.1

where:
On VM1 all LXD containers connect to their VM Host via an lxdbr0 bridge whose address is 10.169.80.1.
So I was assuming.. the above ROUTES section meant routing any traffic from the 10.169.80.0/24 network (ie the VM1 local LXD container's network) to the VM1 local Hyprspace VPN tunnel interface 172.16.1.1**

On VM2 I have the same setup and that Hyprspace config as on VM1 but the ROUTES config again is configured to Route VM2's local LXD container network (10.2.13.0/24) to VM2's own Hyprspace VPN Tunnel IP (172.16.1.2) where I was assuming it would get forwarded to VM1's VPN Tunnel interface (172.16.1.1) and on to the VM1 LXD network & the target LXD Container.

From VM1 I can PING VM2's Hyprspace VPN Tunnel interface (172.16.1.2)
I can not PING from VM1 to VM2's LXD bridge interface IP !

So hyprspace is not routing traffic from VM1's LXD container network to any of VM2's LXD containers.

Whether its LXD or Docker containers they run on their "Host" on a private (often a 10.x.x.x) network.

Isn't this use-case scenario what the hyperspace "multiple routes capability" is for or am I misunderstanding it's function?
For instance, I can not ping from VM1's CN1 container to VM2's CN1 container?

thanks
brian

@bmullan
Copy link

bmullan commented Aug 2, 2023

@alecbcs @dukzcry

My First Question is:

Did the Hyprspace Routing capability ever get implemented in a Release version?

If Yes... then my Second Question concerns interpretation of the "routes" section of the config:

If 2 Servers on 2 separate Cloud networks use Hyprspace to create a VPN tunnel to connect to each other, I thought the PEER list would look something like the following on one of the 2 Hyprspace Peer Nodes.
_

Peers:
172.16.1.1:
id: QmTB1pXv51fJXLyQF8JiwPQNFZCRj8vSVQAJrGPDBdpG5k
172.16.1.2:
id: Qmaea2NerBfsCunQVnck34bF9mNLrrDYZdLV1LydcL9PKz
routes:
10.169.80.0/24:
ip: 172.16.1.1
0.0.0.0/0:
ip: 172.16.1.1

_

If 10.169.80.0/24 is the IP for a local Docker -or- LXD Container Network on one of the Server Nodes with the above Peer Config... then is the above telling the Server's Hyprspace to:

  • Route traffic FROM the local Node's Container Network to/through the Node's_local_ Hyprspace VPN Tunnel End Point (TEP) IP 172.16.1.1

-or- does it mean...

  • Route Traffic TO the 10.169.80.0/24 Container Network on the "other" Peer whose Hyprspace local TEP IP is 172.16.1.1 ??

Thanks
Brian

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants