Integrating the NetworkManager with aiccu

I am using the service of SixXS to connect my laptop with the IPv6 internet. They provide an utility called aiccu to setup the tunnel. Getting it to work is really painless. Just do an “apt-get install aiccu”, configure your SixXS username and password and your done.

The aiccu package provides a traditional startup script which is placed in /etc/init.d and is added to the different run levels. Files on the different levels are executed in alphabetical order. The name of the aiccu script ensures that it is run after the network has been brought up. So as long as the networking on your system is statically configured through /etc/network/interfaces everything is fine.

Unfortunately i am (as most probably other desktop users also) using the NetworkManager to handle my network connections. This means that at the time that the aiccu startup script is run there is no network available which will make the tunnel setup fail.

What i would like to do is to run the aiccu script every time the NetworkManager has established a connection so that the tunnel is re-established. Fortunately NetworkManager provides a way to do this. It will run (in alphabetical order) all the scripts placed in /etc/NetworkManager/dispatcher.d/. The scripts are passed two variables, the interface name and if it is going up or down. The scripts are run as root.

Copy this script to /etc/NetworkManager/dispatcher.d/99aiccu to integrate aiccu with the NetworkManager. It should work with KDE and Gnome.


#!/bin/bash

IF=$1
ACTION=$2

if [ "$ACTION" == "up" ]; then
/etc/init.d/aiccu restart
fi

if [ "$ACTION" == "down" ]; then
/etc/init.d/aiccu stop
fi

This entry was posted in IPv6, Linux. Bookmark the permalink.

3 Responses to Integrating the NetworkManager with aiccu

  1. Joe says:

    Hey Frank,

    hast du mal mit IPSEC über IPv6 rumgespielt?

    gruß Joe

  2. frank says:

    Hi Joe,

    nein habe ich noch nicht.

    Grüße,
    Frank

  3. Geert Jan says:

    I want aiccu when I’m using 3G mobile, but not when I have ethernet
    or wifi since they are supposed to have native ipv6.

    The fix is trivial:

    case “$IF” in
    hso*)
    ;;
    *)
    exit 0
    ;;
    esac

    Thanks for investigating how to hook into network manager. Try that on a mac….

    Geert Jan

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>