Category Archives: En-Route

When I am on my way, I will post updates here and eventually sort them into better categories later…

Multi-Gateway change script for pfSense

Since pfSense is not actually rerouting router traffic itself (such as DNS, VPN, …) but only incoming traffic when a gateway goes down and another one is configured in the same gateway group, I have written the following script that you can use in a cron job. It will change the IPv4 default route for basically all traffic not specifically treated via FW rules – including the internal services.

  • MOBILE1 needs to be set to your second gateway, in my case a mobile LTE device
  • MOBILE2 and MOBILE3 need to be set to rarely used IPs – so the LTE traffic going there is not too much as
  • MOBILE2 and MOBILE3 need to be statically routed via LTE, always, to check their reachability
  • WAN1 needs to be set to your main gateway, in my case a FritzBox
  • WAN2 and WAN3 need to be set to pages you usually want to reach, but it is not so bad to be unreachable in case of a downtime of the WAN gateway as
  • WAN2 and WAN3 need to be statically routed via WAN, always, to check their reachability

The script will log changes and send mails to the email address configured in pfSense.

Sixxs Heartbeat Tunnel without Aiccu but Python (pfSense compatible)

For systems that do not provide Sixxs’ aiccu package to setup a GIF tunnel automatically, you can easily start the tunnel (not setup the routing 🙂 ) by executing the following script once per minute via cron:

This solution was first posted here:

UBNT – Sixxs Tunnel

Output JSON-Code in readable and sorted form so it’s diffable

This code will read in a JSON file and print it out again in readable form and keys in sorted order – making two files diffable!

Usage: jsonsort.py