hey there, Tinc will generate a new MAC address every time the daemon restarts. In my setup, in switch mode, I give IP addresses using DHCP to the different tinc vpn clients. Some of these boxes are 'pets' and request a particular ip address which is specified in their dhclient.conf. My trouble is that since the MAC is regenerated every time the daemon is restarted, I am forced to have a very low max lease time on my DHCP servers (< 2minutes), as every time I reboot the client the lease is already allocated to the previous MAC address. if there a way to control that tinc MAC behaviour ? ie. generate it once and re-used that same one every time ? thanks -azul -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.tinc-vpn.org/pipermail/tinc/attachments/20170116/4e644879/attachment.html>
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>
awesome! thanks a million On 16 January 2017 at 13:00, Guus Sliepen <guus at tinc-vpn.org> wrote:> 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> > > _______________________________________________ > tinc mailing list > tinc at tinc-vpn.org > https://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.tinc-vpn.org/pipermail/tinc/attachments/20170116/85543b4a/attachment.html>