10 lines
228 B
Bash
Executable File
10 lines
228 B
Bash
Executable File
#!/bin/sh
|
|
mac="${1:?Provide mac address as first argument}"
|
|
name="${2:-macvlan9000}"
|
|
enp="$(basename /sys/class/net/enp*)"
|
|
|
|
sudo ip link add link "$enp" address "$mac" name "$name" type macvlan
|
|
/bin/sh
|
|
sudo ip link del "$name"
|
|
|