0

I'm connecting to a server using vpn connection. So, every time that I connect using this VPN, my PC (Ubuntu 16.04) always create a virtual netboard and gives to me a new MAC address. But for what I need for, I have to get always the same MAC address.

So, there's some way to setup the MAC address of VPN (on the client side) to be static, I mean, to every time that I connect, I will receive the same MAC address?

Remembering that I need to do this from client-side. I don't have access to the server

Val
  • 7
  • 1
Yuri
  • 1
  • 1
  • 1

1 Answers1

1

Hello an welcome to Server Fault!

Looks like you can force a specific MAC address if using a tap device.

**This was distribution specific* **

I've found this script which should do what you're asking:

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;' "

This script goes to the "custom configuration" box and obviously you should change 00:11:22:33:44:55 to the MAC address you want.

** More generic solution **

You can pass --lladdr 00:11:22:33:44:55 to the command line, for example (taken from OpenVPN site):

openvpn --remote alice.example.com --dev tap1 --ifconfig 10.4.0.1 10.4.0.2 --lladdr 00:11:22:33:44:55 --tls-client --ca ca.crt --cert client.crt --key client.key --reneg-sec 60 --verb 5
Daniele Santi
  • 2,529
  • 1
  • 25
  • 22
  • Heym thanks. I'm sorry, I don't understand to much about this kind of stuff. But what is this ${dev} ? And where I find this custom configuration box? – Yuri Sep 12 '18 at 13:13
  • @Yuri oops, looks like the script I found was specific for a certain distribution. I'll update my answer for a more generic solution. – Daniele Santi Sep 12 '18 at 13:32