Guest User!

You are not Sophos Staff.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Astaro StrongSWAN ipsec wrapper script

Uploaded in this post is a script file  vpn.sh.txt.
(.txt extension so uploader would let me upload.)

The file has instructions on even how to put it onto your Astaro device through the Terminal.

This script makes it a bit more human friendly to manage and monitor the IPSec VPN connections. But the BEST thing is this: I've had problems with 1 or 2 (out of 30) VPN connections that would go down and stay down until I manually reset them. So one thing this script can do is "monitor" a specific connection and automatically reset it if it detects that it is down.

Quite annoying and may or may not be related to Astaro.. threads seem to try to point fingers at certain types of Cisco routers.

Anyway, because the Astaro router is so brilliantly deployed on a Linux system, that allows Linux folks to fix things and make improvements without having to wait for or get denied by Support. 

In order to do this, you have to SSH into the router and then log into the 'root' account. Doing this will certainly not be supported by their support, however I have had very little that is actually supported from them so doing it by utilizing Linux itself is much more supportable on the Internet. I feel it is almost a crime to provide this router on Linux and start closing down those doors if they choose to do it. Instead of providing means for Linux experts to customize their Astaro functionality, they create roadblocks to prevent it.

So give this script a shot. I'm using it. I may post updates to any fixes if I find them.


This thread was automatically locked due to age.
Parents
  • I thought of that. It's the "list" command. It will show you all the active connection names. And if you run the script without any command it will show you what commands it has with explanations.

    There is another way to list the connections which is not easy to script at all:
    Run command: cc
    Then run command: ipsec      which actually is like a sub-command in the cc program.
    Then run command: connections@   yeah, you need the "@" symbol.
    You can then copy with mouse, and then type quit to exit this program.

    This will show you a proper list, but I don't know how to get that from a script. Further, if I use this cc program then the script becomes more Astaro than StrongSwan ipsec based. I'd prefer wherever practical to focus on the StrongSwan side, with Astaro specific logic to be added carefully or via another script.
    So the way my script works is that it scans the  'ipsec status' output and just filters for some of the lines and then uses other UNIX commands to sort and pretty up the output. These names are slightly different in that they have an extra "S_" at beginning but with or without that seems to work fine for the ipsec commands.

    So, let's say you save the script filename as just "vpn", I would do this:
    vpn list
    Then with mouse, double-click on the name I want which should highlight it (depending on terminal software and emulation you're using), and then right-click to copy it.
    Then I type:
    vpn status 
    and then I right-click to paste what was copied, to make it appear like:
    vpn status S_REF_whatever
Reply
  • I thought of that. It's the "list" command. It will show you all the active connection names. And if you run the script without any command it will show you what commands it has with explanations.

    There is another way to list the connections which is not easy to script at all:
    Run command: cc
    Then run command: ipsec      which actually is like a sub-command in the cc program.
    Then run command: connections@   yeah, you need the "@" symbol.
    You can then copy with mouse, and then type quit to exit this program.

    This will show you a proper list, but I don't know how to get that from a script. Further, if I use this cc program then the script becomes more Astaro than StrongSwan ipsec based. I'd prefer wherever practical to focus on the StrongSwan side, with Astaro specific logic to be added carefully or via another script.
    So the way my script works is that it scans the  'ipsec status' output and just filters for some of the lines and then uses other UNIX commands to sort and pretty up the output. These names are slightly different in that they have an extra "S_" at beginning but with or without that seems to work fine for the ipsec commands.

    So, let's say you save the script filename as just "vpn", I would do this:
    vpn list
    Then with mouse, double-click on the name I want which should highlight it (depending on terminal software and emulation you're using), and then right-click to copy it.
    Then I type:
    vpn status 
    and then I right-click to paste what was copied, to make it appear like:
    vpn status S_REF_whatever
Children
No Data