alobbs / macchanger

GNU MAC Changer
http://www.gnu.org/software/macchanger
GNU General Public License v3.0
601 stars 113 forks source link

Can't change MAC on EC2 instance with Amazon Linux #74

Open llamafilm opened 3 years ago

llamafilm commented 3 years ago

I'm trying to change the MAC address of an EC2 instance running Amazon Linux 2 but I get this error. I'm running as root.

# /usr/local/bin/macchanger -a eth0
Current MAC:   06:81:00:44:12:55 (unknown)
Permanent MAC: 06:81:00:44:12:55 (unknown)
[ERROR] Could not change MAC: interface up or insufficient permissions: Operation not supported

I tried a simple shell script like this, but this kills the internet connection and it never comes back.

ip link set eth0 down
macchanger -a eth0
ip link set eth0 up

Some details about the system:

# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 06:81:00:44:12:55 brd ff:ff:ff:ff:ff:ff

# uname -r
4.14.219-161.340.amzn2.x86_64

# lspci -v -s :00:05.0
00:05.0 Ethernet controller: Amazon.com, Inc. Elastic Network Adapter (ENA)
    Physical Slot: 5
    Flags: bus master, fast devsel, latency 0
    Memory at febf4000 (32-bit, non-prefetchable) [size=16K]
    Capabilities: [70] Express Endpoint, MSI 00
    Capabilities: [b0] MSI-X: Enable+ Count=9 Masked-
    Kernel driver in use: ena
    Kernel modules: ena
streamdp commented 3 years ago

May be it is not supported by the driver ENA?. Check out this issue # 141 you can reopen the issue and one of the authors can help you.

barickdebayan commented 2 years ago

How to enable this feature in ENI or ENA ? any specific aws cli command ?