<div dir="ltr"><div>Hi,<br><br></div><div>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.<br><br>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?<br>
<br></div><div>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...<br>
<br></div><div>-- tinc-up --<br></div><div><br>#!/bin/sh<br>set -e<br><br>MACFILE="/etc/tinc/mynet/mac"<br>if [ -e $MACFILE ]; then<br>  MAC=`cat $MACFILE`<br>  ifconfig $INTERFACE hw ether $MAC<br>fi<br><br>dhclient $INTERFACE &<br>
MAC=`ip link show mynet | awk '/ether/ {print $2}'`<br>echo $MAC > $MACFILE<br><br>-- tinc-up ends --<br></div><div><br></div><div>Best regards,<br>Ville<br></div></div>