1/2 IPSec over GRE with MikroTik's RouterOS and Linux


I just ordered a jiffybox from domainfactory (link goes to domainfactory) to enhance the jumpnet with a second VPN hub.

After trying to re-create our OpenVPN setup on a linux host, I noticed, that the OpenVPN interfaces do not behave like I expected them to do. Because I was planning to use OSPF over the VPN links and I was unable to get bird (a OSPF daemon) running on the OpenVPN links, I could not use OpenVPN.

Next plan was to create GRE tunnels which worked fine but do not provide encryption and authentication. So, additionally I need IPSec to encrypt and authenticate the traffic.

Let's start with the GRE tunnels:

GRE tunnels on linux

To create a GRE tunnel, we use the ip command:

ip tunnel add gre-tun0 local <LOCAL IP> remote <REMOTE IP>
ip tunnel change gre-tun0 ttl 64
ip link set gre-tun0 up

Now, you can assign a IP. As the GRE tunnel is a point to point link, you should assig an /30 net:

ip address add dev gre-tun0

That's it on the linux host. Next we'll create a GRE tunnel on the router board.

GRE tunnels in RouterOS

Just navigate to interfaces and create a GRE interface. Then, enter local and remote IP (keep in mind that you need to swap the IP adresses from above: local is remote and vice versa).

Klick on OK, the interface should be up an running.

Configure on this GRE interface. Now you should be able to ping to over the GRE tunnel.


In the next post, I'll explain IPSec, how to set it up on MikroTik and Linux and how to interconnect the systems.

Stay tuned!

Go back

My Wishlist

If the information I provided was helpful to you, I would really appreciate if you have a look on my Amazon wishlist.

I'm not begging for anything and I will continue to share my knowledge but of course I would be really happy to see some packages arriving ;-)