Skip to content

Instantly share code, notes, and snippets.

@cojocar
Last active July 1, 2020 16:22
Show Gist options
  • Save cojocar/9c561dae2c20946e96d2 to your computer and use it in GitHub Desktop.
Save cojocar/9c561dae2c20946e96d2 to your computer and use it in GitHub Desktop.
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
Copy link

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