Question

StrongSwan IKEv2 VPN config tutorial

Following this tutorial : => https://www.digitalocean.com/community/tutorials/how-to-set-up-an-ikev2-vpn-server-with-strongswan-on-ubuntu-20-04#prerequisites

step 6 has us do ip route show default

and sample output is : Output default via your_server_ip dev eth0 proto static

Then in editing the /etc/ufw/before.rules we need to insert

*nat -A POSTROUTING -s 10.10.10.0/24 -o eth0 -m policy --pol ipsec --dir out -j ACCEPT -A POSTROUTING -s 10.10.10.0/24 -o eth0 -j MASQUERADE COMMIT

The text states : “Near the top of the file (before the *filter line), add the following configuration block. Change each instance of eth0 in the above configuration to match the interface name you found with ip route.”

What is the ‘interface name’ referred to there ? If the author meant your_server_ip he would have stated that. In any case my ‘your_server_ip’ is not in the 10.10.10.0/24 range…

Anyway I don’t understand what this bit means.

Thanks for any assistance.


Submit an answer
Answer a question...

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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
December 4, 2022
Accepted Answer

Hi there,

You need to change the instance which in your case might not be eth0. You get the interface name by running the ip route show default command, and you will see the interface after the your_ip dev part.

You can also check that using the ip addr command.

The 10.10.10.0/24 range is, I believe, the one that you’ve defined in step 4 as rightsourceip=10.10.10.0/24. This option instructs the server to assign private IP addresses to clients from the specified 10.10.10.0/24 pool of IPs.

Hope that this helps!

Best,

Bobby

In your instance, “eth0” is the interface name. (Output default via your_server_ip dev **eth0 **proto static)

The interface doesn’t need to be modified from what’s in the tutorial’s example.