Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I tried to use vpn, still one thing i don't understand #8

Open
momiji opened this issue Dec 6, 2019 · 1 comment
Open

I tried to use vpn, still one thing i don't understand #8

momiji opened this issue Dec 6, 2019 · 1 comment

Comments

@momiji
Copy link

momiji commented Dec 6, 2019

Hello, I have 2 networks I want to connect together:
server A - public ip A, private ip 11.0.0.1, other servers with ips 11.0.0.2, ...
server B - public ip B, private ip 12.0.0.1, other servers with ips 12.0.0.2, ...

I started ctunnel like this:
server A: ctunnel -V -t 8 -i 1.0.0 -n -s -l 0.0.0.0:5001 -C aes-128-cfb -r 11.0.0.0/25
server B: ctunnel -V -t 8 -i 1.0.0 -n -c -f ip_A:5001 -C aes-128-cfb -r 12.0.0.0/25

I can ping 12.0.0.1 from A and 11.0.0.1 from B with no issue, however I can't figure why pinging other servers does not work.
from A: ping 12.0.0.2 returns Destination Host Prohibited
from B: ping 11.0.0.1 returns the same

Do you have any idea ? Is it something related to iptables, where I should do something, but really don't know what :)
I looked at the example, but couldn't understand what it was for.

By the way, great work :)

@alienrobotarmy
Copy link
Owner

Please make sure that ip forwarding on both machines is enabled.

cat /proc/sys/net/ipv4/ip_forward
1

0 = IP Forwarding is disabled.
1 = IP Forwarding is enabled.

To enabled IP Forwarding:

echo 1 > /proc/sys/net/ipv4/ip_forward

Routing

Hosts on either side of your VPN need to know how to get to their respective destination networks. This requires setting up routing tables either per-host, or on each network's default gw.

For instance: Machines behind 'server B', no nothing about the 11.0.0.0/24 network.
Packets on the 'server B' network will traverse the default gateway, so machines on your network need to know that packets destined for 11.0.0.0/24 are handled by the ctunnel VPN

On server A's network, you need a static route that points to server B's network with a gateway of 11.0.0.1
On server B's network, you need a static route that points to server A's network with a gateway of 12.0.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants