Closed ondrejmirtes closed 8 years ago
@ondrejmirtes The VPN clients are assigned IPs starting from 192.168.42.10 within the VPN. The default setup already enables VPN clients to connect to each other. The VPN server will forward traffic among them.
For example, if your home server is assigned 192.168.42.10, other VPN clients can use this IP to connect to it. If unable to connect, check the firewall on your home server. It must allow access from 192.168.42.0/24.
Thanks a lot. I can definitely ping between my other devices through the VPN so the issue will be the firewall on my homeserver. I will let you know after I fixed it.
One more issue I'm facing (I realize I'm asking general VPN questions, but you have expertise with the stack I'm using so I'd be glad if you helped me): The client on the homeserver disconnects from the VPN after minutes of inactivity. How can I fix it to be persistent connection? Should I just reconnect after each disconnect or are there any config values I can tune? Is dpdtimeout
/dpdaction
related to that? Thank you!
@ondrejmirtes You're welcome. Please check and remove any "idle" options in /etc/ppp/options.xl2tpd.
To auto reconnect, try dpdaction=restart in ipsec.conf [1]. In addition, here's a working configuration for Linux clients using Strongswan [2]. For Strongswan, also see [3] for how to auto restart the connection.
[1] https://libreswan.org/man/ipsec.conf.5.html [2] https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients.md#linux [3] https://wiki.strongswan.org/issues/825
@hwdsl2 Thank you! One more thing: is there an elegant way how to connect to the VPN after boot? AFAIK he first part of the connection is already done (sudo ipsec up XXXX), but the second part (authenticating by echoing to /var/run/... my credentials) is not, but I'm not sure when can I do it so the connection is already initialized.
@ondrejmirtes The "echoing to /var/run ..." step can be run a few seconds after the "sudo ipsec up" step. Try using the "sleep" command with e.g. a 10-second delay. Adjust this delay as necessary. You can put those commands in /etc/rc.local
.
Hi, I used your script and tutorial to install VPN server on my public VPS. I'd like to use it to connect to my homeserver (where I installed VPN client also according to your tutorial) from other clients.
The issue is that each client creates a separate pppX interface on the server with 255.255.255.255 netmask so server can ping them and they can ping the server, but the clients cannot see each other.
Is there anything I can do to fix this issue, is there a different mode supported by IPSec used to connect the clients to each other?