Writing a short "C" script to change mac address
Posted: Sat Nov 16, 2013 1:12 pm
To connect my linux machine to the internet in my accommodation I have to change its mac address. Which means using roughly the following:
[-> sudo -s]
system("ifconfig eth0 down")
system("ifconfig eth0 hw ether XX:XX:XX:XX:XX:XX")
system("ifconfig eth0 up")
Which only seems to work if I run each one via a separate program Otherwise it registers the mac as changing but still no connection. So, I have to root via sudo -s and then run 3 programs after logging in which I call via:
./down
./ether
./up
Can this all be done via one program and/or could this all be automated to run at start up?
[-> sudo -s]
system("ifconfig eth0 down")
system("ifconfig eth0 hw ether XX:XX:XX:XX:XX:XX")
system("ifconfig eth0 up")
Which only seems to work if I run each one via a separate program Otherwise it registers the mac as changing but still no connection. So, I have to root via sudo -s and then run 3 programs after logging in which I call via:
./down
./ether
./up
Can this all be done via one program and/or could this all be automated to run at start up?