StrongSwan IKEv2 VPN config tutorial

Following this tutorial : =>

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 -o eth0 -m policy --pol ipsec --dir out -j ACCEPT -A POSTROUTING -s -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 range…

Anyway I don’t understand what this bit means.

Thanks for any assistance.

Submit an answer

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 range is, I believe, the one that you’ve defined in step 4 as rightsourceip= This option instructs the server to assign private IP addresses to clients from the specified pool of IPs.

Hope that this helps!



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.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel