Force a static HWaddr to tinc interface
Ville Mattila
ville at mattila.fi
Thu Jul 11 06:26:03 CEST 2013
Hi,
I have been working with tinc network where one host will provide the IP
addresses over DHCP to each connected node. Tinc runs in switch mode.
It seems that the HWaddr of the tinc interface is regenerated every time
when tinc is (re)started. As a result, DHCP server will assign a new IP for
the host. Is there any configuration variable we could use to avoid HWaddr
changing?
Currently, I have added a short snippet into tinc-up script that persists
the (once given) HWaddr to a file and tries to reset it before starting
dhclient. This works, but I feel it a bit hacky solution...
-- tinc-up --
#!/bin/sh
set -e
MACFILE="/etc/tinc/mynet/mac"
if [ -e $MACFILE ]; then
MAC=`cat $MACFILE`
ifconfig $INTERFACE hw ether $MAC
fi
dhclient $INTERFACE &
MAC=`ip link show mynet | awk '/ether/ {print $2}'`
echo $MAC > $MACFILE
-- tinc-up ends --
Best regards,
Ville
-------------- seuraava osa --------------
HTML liite on siirretty...
URL: <http://www.tinc-vpn.org/pipermail/tinc/attachments/20130711/3e22a86c/attachment.html>
More information about the tinc
mailing list