#!/bin/bash

set -e

IP_KOMAZ=138.231.144.4
IP_OVH=138.231.144.8

INTERFACE=$1; shift;
TUN_MTU=$1;   shift;
UDP_MTU=$1;   shift;

ip link set ${INTERFACE} up
ip link set mtu ${TUN_MTU} dev ${INTERFACE}

ip addr add ${IP_KOMAZ}/32 dev ${INTERFACE}
ip route add ${IP_OVH} dev ${INTERFACE}
ip neigh add proxy ${IP_OVH} dev crans.2

exit 0
