#!/bin/bash

if [ "$IFACE" != "ip6tnl0" ]; then
    exit 0
fi

localaddr=$(grep aws /etc/hosts | awk '{print $1'})
ip -6 tunnel add CogentTUN mode ipip6 remote 2a02:6b8:0:3400::bbba local "$localaddr"
ip link set up dev CogentTUN
ip route add default dev CogentTUN table 0xffff mtu 1400 advmss 1360
ip rule add from 5.45.202.0/24 table 0xffff
sysctl -w net.ipv4.conf.all.rp_filter=0
