#!/bin/bash # Function to change MAC address change_mac() { interface=$1 new_mac=$2 echo "Changing MAC address of $interface to $new_mac" # Disable the network interface sudo ifconfig $interface down # Change the MAC address sudo ifconfig $interface hw ether $new_mac # Enable the network interface sudo ifconfig $interface up } # Example usage interface_name= "eth0" # Replace with your actual network interface name new_mac_address= "00:11:22:33:44:55" # Replace with the desired MAC address change_mac $interface_name $new_mac_address