Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Set a fixed MAC address on a TAP interface (OpenVPN client) on Tomato Firmware 1.28.0000 MIPSR2-101 K26 USB AIO-64K and maybe on others

How to set a fixed MAC address on a TAP interface (OpenVPN client) on Tomato Firmware

Problem

Using the lladdr 00:11:22:33:44:55 option in the OpenVPN client custom configuration form doesn't change the MAC of the tap interface.

Solution

Paste this in the custom configuration box:

script-security 2
up "/bin/sh -c '/sbin/ifconfig ${dev} down; /usr/sbin/ip link set ${dev} address 00:11:22:33:44:55; /sbin/ifconfig ${dev} up;' "

The OpenVPN client sets dev as an environment variable.

Explanation

The lladdr option does not work because the interface is already up, so OpenVPN (2.2.2) cannot set a MAC address (Device busy).

@richieboymx

This comment has been minimized.

Copy link

@richieboymx richieboymx commented Jul 1, 2020

Hello,

Client connects to server, however the fixed Mac is not showing on the server client list; I'm getting the following message in the client log:

/bin/sh -c /sbin/ifconfig ${dev} down; /usr/sbin/ip link set ${dev} address 00:11:22:33:44:55; /sbin/ifconfig ${dev} up; tap11 1500 1584 192.168.1.
[: bad number

Am I missing something on my server settings? I have FreshTomato Version 2020.3. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment