Appletini Posted October 30, 2010 Posted October 30, 2010 I need to change the MAC address of all the wifi interfaces to avoid Rouge AP detection. I changed ath0 fine but wifi0 has a really strange HWaddr with 10 extra sets of 00’s after the mac. The mac is also devided up with ‘ - ‘s and not ‘ : ‘s. So I are confused This is what I am getting when I try and change the MAC wifi0 Link encap:UNSPEC HWaddr 00-12-CF-A4-47-15-00-00-00-00-00-00-00-00-00-00 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:15237 errors:0 dropped:0 overruns:0 frame:1092 TX packets:3150 errors:647 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:195 RX bytes:1073662 (1.0 MiB) TX bytes:369097 (360.4 KiB) Interrupt:3 Memory:b0000000-b00ffffc root@OpenWrt:/# ifconfig wifi0 down root@OpenWrt:/# ifconfig wifi0 hw ether 00-23-EB-2C-FC-E6-00-00-00-00-00-00-00-00-00-00 ifconfig: invalid hw-addr 00-23-EB-2C-FC-E6-00-00-00-00-00-00-00-00-00-00 root@OpenWrt:/# ifconfig wifi0 hw ether 00-23-EB-2C-FC-E6 ifconfig: invalid hw-addr 00-23-EB-2C-FC-E6 root@OpenWrt:/# ifconfig wifi0 hw ether 00:23:EB:2C:FC:E6 ifconfig: SIOCSIFHWADDR: Invalid argument root@OpenWrt:/# ifconfig wifi0 hw ether 00:23:EB:2C:FC:E6:00:00:00:00:00:00:00:00:00:00 ifconfig: invalid hw-addr 00:23:EB:2C:FC:E6:00:00:00:00:00:00:00:00:00:00 thanks for the help Quote
Netshroud Posted October 30, 2010 Posted October 30, 2010 In my experience, "Invalid argument" means the driver doesn't support it. Quote
Mr-Protocol Posted October 30, 2010 Posted October 30, 2010 try using macchanger. ifconfig wifi0 down macchanger -r wifi0 ifconfig wifi0 up Quote
Appletini Posted October 30, 2010 Author Posted October 30, 2010 OK heres what i think is happening as i do a little bit more testing... After startup i have to connect to the router and click "Create and setup interface" this makes ath0 (the interface that i was able to change its mac before) When this interface is made its generating garbing the MAC of the other NIC's and using it. or something. Once ath0 is up wifi0 comes up along with it... So i tryed doing macchanger but that was not installed so i have to get that .. for now tho i did ifconfig ath0 hw ether 00:23:EB:2C:FC:E6 before i went into Jasager to "Create the setup interface" and got ifconfig: SIOCSIFHWADDR: No such device After i did "Create ...." I could change the mac address but then Wifi0 was already made with the wrong mac. Is there any thing i can do . to change what Jasager sets as the mac when it makes the interface.... i am going to try changing the MAC of all my nics next Quote
Appletini Posted October 30, 2010 Author Posted October 30, 2010 Ok so i had to flash the router after i tryed changing the mac in /etc/config/network but after i flashed it again i tryed setting the mac for the lan interface I did this in X-WRT interface, Network > Lanconfiguration, MAC Address: This then set /etc/config/network option 'macaddr' '00:23:EB:2C:FC:E6' This had no result. idk if anyone else can give me any idea's but next i think i am going to try using startup scripts to change the base lan MAC. Quote
swatspyder Posted December 15, 2010 Posted December 15, 2010 (edited) Ok so i had to flash the router after i tryed changing the mac in /etc/config/network but after i flashed it again i tryed setting the mac for the lan interface I did this in X-WRT interface, Network > Lanconfiguration, MAC Address: This then set /etc/config/network option 'macaddr' '00:23:EB:2C:FC:E6' This had no result. idk if anyone else can give me any idea's but next i think i am going to try using startup scripts to change the base lan MAC. This is from my blog. You can find the original article below. :D Jasager (Fonera) Router – Changing the Wireless MAC Address and More http://www.andrewdefilippis.com/2010/11/22/jasager-fonera-router-changing-the-wireless-mac-address-and-more/ 1. Reboot your router (disconnect and reconnect power) 2. Connect an ethernet cable from your computer to the Fonera 3. Open a Secure Shell into your router (ssh 192.168.1.1 “The IP of the Fonera”) 4. Make sure you can ping out to the internet from your Fonera router (ping google.com) Changing the MAC addresses: First we are going to install “macchanger” to our Jasager (Fonera) router. root@Jasager:/etc# cd /tmp #This is macchanger, a tool that will allow you to easily change your MAC addresses root@Jasager:/tmp# wget h**p://ipkg.k1k2.de/packages/macchanger_1.5.0-1_mips.ipk #remove the ** and replace with tt root@Jasager:/tmp# ipkg install macchanger_1.5.0-1_mips.ipk root@Jasager:/tmp# rm *.ipk After installing macchanger, we need to modify the file "network" located at /etc/init.d/network If you installed nano, run "nano network" otherwise run "vi network" root@Jasager:/tmp# cd /etc/init.d root@Jasager:/etc/init.d# cp network network.bak #Make a backup of the original file root@Jasager:/etc/init.d# chmod 444 network.bak #Make the backup file read-only You will need to insert two lines into the file to change the MAC address Replace “00:11:22:33:44:55″ with a MAC of your choice (make sure they are the SAME) root@Jasager:/etc/init.d# nano network #!/bin/sh /etc/rc.common # Copyright © 2006 OpenWrt.org START=40 STOP=40 boot() { setup_switch() { return 0; } include/lib/network setup_switch [ -s /etc/config/wireless ] || / /sbin/wifi detect > /etc/config/wireless macchanger ath0 -m 00:11:22:33:44:55 macchanger wifi0 -m 00:11:22:33:44:55 /sbin/wifi up } 1. Save the file, overwriting the existing file named “network” and reboot the router. 2. When the router is finished booting up, run ifconfig to confirm that ath0 and wifi0 contain the MAC address you specified. 3. Run a wireless network scanner to confirm that the router is broadcasting the new MAC address (airmon-ng and airodump-ng) I didn’t attempt it, but you could possibly use (ifconfig ath0 hw ether 00:11:22:33:44:55) and (ifconfig wifi0 hw ether 00:11:22:33:44:55) instead of (macchanger ath0 -m 00:11:22:33:44:55) and (macchanger wifi0 -m 00:11:22:33:44:55) Edited December 15, 2010 by swatspyder Quote
digininja Posted December 16, 2010 Posted December 16, 2010 A quick note, don't copy this exactly or things won't work properly: macchanger ath0 -m 00:11:22:33:44:55 macchanger wifi0 -m 00:11:22:33:44:55 I did this once and some machines stopped talking to the machine I'd done it on, turns out that 00:11:22:33:44:55 is a broadcast address and putting it on a single interface screws up some devices. Off the top of my head you can also specify the MAC for the new device when you use wlanconfig to create it but I might be wrong on that. Changing the MAC address with ifconfig doesn't work for most Madwifi-ng I've tried it on so macchanger is definitely the way to go. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.