tinc MAC address

Guus Sliepen guus at tinc-vpn.org
Mon Jan 16 14:00:47 CET 2017


On Mon, Jan 16, 2017 at 11:31:18AM +0000, Azul wrote:

> Tinc will generate a new MAC address every time the daemon restarts.

It is actually the kernel that generates a new MAC address for the
tun/tap interface.

> if there a way to control that tinc MAC behaviour ? ie. generate it once
> and re-used that same one every time ?

You can set the MAC address yourself in the tinc-up script. On Linux for
example:

#!/bin/sh
ip link set $IFACE address 12:34:56:78:9a:bc
# other commands here

If you want to automate it so it automatically stores the
kernel-generated address the first time and reuses it later, you can do
something like this:

#!/bin/sh
macfile=/etc/tinc/$NETNAME/address
if [ -f $macfile ]; then
	ip link set $IFACE address `cat $macfile`
else
	cat /sys/class/net/$IFACE/address >$macfile
fi
# other commands here

-- 
Met vriendelijke groet / with kind regards,
     Guus Sliepen <guus at tinc-vpn.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://www.tinc-vpn.org/pipermail/tinc/attachments/20170116/e44160b8/attachment.sig>


More information about the tinc mailing list