#!/bin/sh SHORT_NAME="pwwire" DESC_NAME="privacyweek WIRE" INTERFACE="{{ ws_minet_wired_interface_name }}" MODULE_NAME="{{ ws_minet_wired_interface_module }}" . /usr/local/lib/minet/minet_helpers.sh case "$1" in start|"") echo "Connecting with $DESC_NAME" activate_interface $INTERFACE $MODULE_NAME for VLAN in 42; do ip link add link $INTERFACE name $INTERFACE.$VLAN type vlan id $VLAN ip addr add dev $INTERFACE.$VLAN 192.168.$VLAN.1/24 ip link set up dev $INTERFACE.$VLAN done ip link add link $INTERFACE name $INTERFACE.18 type vlan id 18 ip addr add dev $INTERFACE.18 192.168.0.11/24 ip link set up dev $INTERFACE.18 ip route add default via 192.168.0.1 echo "nameserver 192.168.0.1" >> /tmp/minet-$SHORT_NAME.resolv resolvconf -a $INTERFACE < /tmp/minet-$SHORT_NAME.resolv rm -f /tmp/minet-$SHORT_NAME.resolv ;; stop) echo "Disconnecting from $DESC_NAME" resolvconf -d $INTERFACE deactivate_interface $INTERFACE $MODULE_NAME ;; *) exit 1 ;; esac