By tachraweb
As i was following this tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-an-ikev2-vpn-server-with-strongswan-on-ubuntu-18-04-2 and i did every step exactly as described in tutorial, i can connect to StrongSwan (Tested on Android) but there is no INTERNET!!!
There is no log, no nothing and firewall/nat are exactly the same as tutorial Any idea?!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya @tachraweb,
If you’ve set up a StrongSwan VPN server as per the DigitalOcean tutorial and you can connect to it but don’t have internet access, there might be a few areas to check and troubleshoot. The issue could be related to IP forwarding, firewall rules, or DNS configuration. Here are some steps you can take to diagnose and fix the problem:
sysctl net.ipv4.ip_forward
It should return net.ipv4.ip_forward = 1. If not, enable it by editing /etc/sysctl.conf and adding or uncommenting:
net.ipv4.ip_forward=1
and apply the changes
sysctl -p
sudo iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -o eth0 -j MASQUERADE
Ensure that the subnet (10.10.10.0/24) matches your VPN’s subnet and eth0 is your server’s external network interface. Adjust them if necessary.
To persist iptables rules across reboots, you might need to save them. This can be done with:
sudo netfilter-persistent save
DNS Configuration: Sometimes the issue is related to DNS. Make sure your VPN configuration is providing a valid DNS server to the clients.
ipsec.conf or similar). Look for a line that sets DNS servers and make sure it’s a valid DNS provider.Check VPN Logs: If the issue persists, checking logs can provide more insight.
sudo tail -f /var/log/syslog | grep charon
ufw), make sure it’s not blocking the necessary VPN and internet traffic.sudo ufw status
eth0) is indeed the correct external interface. Use ip addr to check your interfaces.After making any changes, it’s important to restart the StrongSwan service and possibly your server to ensure all settings are correctly applied. If the problem persists after these checks, you might need to dig deeper into the specific configuration and logs to identify the issue.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.