[Q] Wifi MAC change - Legend Q&A, Help & Troubleshooting

Hi all,
I've put CM7 on my HTC Legend and also upgraded the Radio as per instructions on some other thread here (http://forum.xda-developers.com/showthread.php?t=841932). All is fine, but I have some weird issues with not getting IP address from an AP
(NOTE: The wifi connecting problem was there before the radio upgrade, too - I upgraded radio to solve the GPS problems on CM7)
What happens (not always) is that Legend does not get an IP address from my local AP, while my notebook does, and internet access works (tested on several wifi clients).
The issue is fixed by restarting the AP - which is what I do not want to do anymore - like I said other wifi clients work fine and killing the AP for my Legend disturbs others that use the AP at that moment.
One thing I wanted to try was to change the MAC on the Legend to fool the AP.
I tried:
- busybox ip command that comes with CM7,
- busybox ifconfig command that comes with CM7,
- compiled 1.18.x busybox and tried ip and ifconfig
- tried with macchanger
all to have something like this printed:
# /data/local/download/busybox ifconfig tiwlan0 hw ether 00:23:76:dc:51:6e
ifconfig: SIOCSIFHWADDR: Operation not supported
tiwlan0 Link encap:Ethernet HWaddr 00:23:76C:51:6F
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
AFAIK, both ip and ifconfig should be able to do it.
Is there any other way to change the MAC? It does not need to be permanent (for now)..
OTOH, how can I get more information on wifi operation to see why it does not work?

Related

Nook -> Ad-Hoc

I tried to get an ad-hoc connection running using directions under the G1 subforum. This was the post:
forum.xda-developers.com/showpost.php?p=2886271&postcount=13
I figured if the G1 could connect to an ad-hoc, the Nook should be able to. I got part of the way through this and ran into some road-blocks. Some of this is directly copied from the post above - I certainly am not savvy enough to put this all together myself. I had installed busybox before I started doing any of these steps.

First, make sure wifi is disabled on the phone gui.


Next, Set up the ad-hoc network. I used android wifi tether on my HTC G1 to start broadcasting. The SSID was "g1". I set it to use the 192.168.3.0 subnet. No encryption, no access control.
copy /system/etc/wifi/tiwlan.ini to /data/local/bin/tiwlan.ini for easy editing

In tiwlan.ini, look for "WiFiAdhoc = 0".
Change it to the following (set ssid to whatever you use):
WiFiAdhoc = 1
dot11DesiredSSID = g1
dot11DesiredBSSType = 0
After updating tiwlan.ini, enable wifi manually:
adb shell
# insmod /system/etc/wifi/tiwlan_drv.ko
# tiwlan_loader -f /system/etc/wifi/firmware.bin -e /proc/calibration -i /data/local/bin/tiwlan.ini
# ifconfig tiwlan0 192.168.3.99 netmask 255.255.255.0
# ifconfig tiwlan0 up
ifconfig showed the tiwlan0 interface was up.
lo
Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
tiwlan0
Link encap:Ethernet HWaddr 08:00:28:7F:57: DB
inet addr:192.168.3.99 Bcast:192.168.3.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
I then discovered I had no iptables binary, so I pulled it off the rooted HTC G1.

adb pull /data/data/android.tether/bin/iptables
adb shell
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# exit
adb push ./iptables /system/bin/iptables
adb shell
# chmod 755 /system/bin/iptables
# mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system

Now, from the OP's post, the iptables rules:
iptables -I FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
gave this error:
iptables v1.3.7: can't initialize iptables table `filter': iptables who? (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
when I run modprobe I get: "modprobe: cannot parse modules.dep"
<stopped here>
____________________________________________________
The rest of the commands I didn't bother to run:

iptables -I FORWARD -s 192.168.2.0/24 -j ACCEPT

iptables -P FORWARD DROP

iptables -t nat -I POSTROUTING -s 192.168.2.0/24 -j MASQUERADE

echo 1 > /proc/sys/net/ipv4/ip_forward
If all went well, you now have internet access.
____________________________________________________
I also tried the wpa_supplicant hack from:
forum.xda-developers.com/showthread.php?t=754961&page=1
This didn't work, with either the version 0.5.11 or 0.6.10 of wpa_supplicant. Version 0.5.11 allows the wifi to start but I get a "unable to scan networks" error. The 0.6.10 version won't even start wifi.
Restoring the original wpa_supplicant and setting permissions back to 755 brought the wifi back
Anyone with more skills than I have any ideas?
Its not the nook, I connected successfully using my Fascinates Verizon 3G Hotspot software but wifi tether would not pick up. Its not the nook that needs hacking its the wifi tether broadcasting app. Something about it isn't broadcasting in a way that other android devices can pick up. I tried this in the verizon store the other day phone to phone. It just doesn't work. But the 3g hot spot works like a million bucks.
ad-hoc under android
Most android devices don't connect to ad-hoc networks. Some are capable of tethering and broadcasting as an infrastructure AP, but my phone isn't. I need the nook to see and connect to ad-hoc networks because that is all my G1 can broadcast. Its not a nook problem per se, but an android problem. There are hacks described on this forum to circumvent the problem, they just don't work with my phone or the nook.
Assuming this is the same problem I'm having trying to tether via MyWi on my iPhone. (Ad-Hoc vs infrastructure) I'm very jealous of my co-worker who's Evo tethers to his NC perfectly.
macndroid said:
I tried to get an ad-hoc connection running using directions under the G1 subforum. This was the post:
...
I also tried the wpa_supplicant hack from:
forum.xda-developers.com/showthread.php?t=754961&page=1
This didn't work, with either the version 0.5.11 or 0.6.10 of wpa_supplicant. Version 0.5.11 allows the wifi to start but I get a "unable to scan networks" error. The 0.6.10 version won't even start wifi.
Restoring the original wpa_supplicant and setting permissions back to 755 brought the wifi back
Anyone with more skills than I have any ideas?
Click to expand...
Click to collapse
I don't yet have a nook to try this on, but I've used both these techniques on more than 1 device... the second is better IF you can get as far as you did with the 0.5.11... I'd suspect that it might be as simple as an edit to the /system/etc/wifi/wpa_supplicant.conf that might be needed to have it set up the same as other devices using 0.5.x... I got this version working a few days ago on the Viewsonic Gtab (2.2 but running 0.5.11) so you might try comparing your conf with the one there... I'd suspect the only diff should/might be the cntl_interface definition...
I've attached the file with .txt added that worked for me on the Gtab...
macndroid said:
Most android devices don't connect to ad-hoc networks. Some are capable of tethering and broadcasting as an infrastructure AP, but my phone isn't. I need the nook to see and connect to ad-hoc networks because that is all my G1 can broadcast. Its not a nook problem per se, but an android problem. There are hacks described on this forum to circumvent the problem, they just don't work with my phone or the nook.
Click to expand...
Click to collapse
This is correct. From what I've read Android as of now doesn't support Ad-Hoc connections at all. All the HTC handsets I've used will work with Infrastructure mode because of the Broadcom chipset used. The OMAP based chips and Samsungs chips don't allow using them in Infrastructure mode from what I've read.
My Droid Inc works fantastic as a base station. My Droid didn't, and neither did my Vibrant.
I don't know why Android doesn't support Ad-Hoc connections yet, in my opinion that's just stupid.
Thanks
jtbnet said:
I don't yet have a nook to try this on, but I've used both these techniques on more than 1 device... the second is better IF you can get as far as you did with the 0.5.11... I'd suspect that it might be as simple as an edit to the /system/etc/wifi/wpa_supplicant.conf that might be needed to have it set up the same as other devices using 0.5.x... I got this version working a few days ago on the Viewsonic Gtab (2.2 but running 0.5.11) so you might try comparing your conf with the one there... I'd suspect the only diff should/might be the cntl_interface definition...
I've attached the file with .txt added that worked for me on the Gtab...
Click to expand...
Click to collapse
Wow - thanks for the input! I'll try again with your conf file when I get home and let you know how it goes.
It really is a shame Google didn't just make this work right the first time.
Edit: I also tried wpa_cli (pulled from my phone running CM 6) and added the ad-hoc network and tried to force it to connect but the interface remained disconnected even though the network was in the list wpa_cli generated. Details can be found here : www.olsr.org/?q=olsr_on_android. Maybe I need to try with the modified wpa_supplicant binary.....
Anyone know if there is an phone with the broadcom chipset that I can get used for a reasonable price AND I can use with T-mobile? At this point it might be the easiest solution.
SOLVED!
For those who haven't found the other thread, Cicada posted a wpa_supplicant (and directions for installation) that work on all Ad-Hoc networks tested so far.

[Q] Connecting SGA with hostapd wifi on Ubuntu 11.04

Dear All,
I am on Ubuntu 11.04, and it has been quite sometime to figure out how to make an access point out of it. I had BCM4312 card which didn't allow me to install the b43 firmware, and finally figured that b43-lpphy (low power card, has a separate firmware!!) was the firmware that I had to use. Wifi worked! But now when I connect it to my phone(Samsung Galaxy Ace s5830, right now on CM9 rom) I get the following error message, and the internet connection - though is getting connected is very patchy!
Station 00:07:ab:fd:33:2d trying to deauthenticate, but it is not authenticated.
wlan1: STA 00:07:ab:fd:33:2d IEEE 802.11: authenticated
wlan1: STA 00:07:ab:fd:33:2d IEEE 802.11: associated (aid 1)
wlan1: STA 00:07:ab:fd:33:2d RADIUS: starting accounting session 4F88DE29-00000925
wlan1: STA 00:07:ab:fd:33:2d WPA: pairwise key handshake completed (RSN)
wlan1: STA 00:07:ab:fd:33:2d IEEE 802.11: disassociated
Could not set station 00:07:ab:fd:33:2d flags for kernel driver (errno=95).
Click to expand...
Click to collapse
When I connect the same wifi with other laptops/ Samsung Galaxy S, the issue doesn't seem to be there and browsing is flawless.The above happens over and over again... and my phone keeps shouting out this because of proxyDroid connecting and disconnecting, and the browsing part becomes stressful. I would be very grateful if someone could help me with this
Thanks
Sudharshan

[Q] USB LAN Adaptor No Carrier

Hello,
I'm trying to get an USB LAN Adaptor with QF9700 chipset working with an Odys Xelio Pad (A10 Winner) with ICS 4.03
I can't find Setting for Ethernet in the ICS Settings menu.
The adaptor is working on an Odys Loox on the fly without problems
The output of dmesg is :
qf9700 1-1:1.0: eth0: register 'qf9700' at usb-sw_hcd_host0-1, QF9700 USB Ethernet, 00: ...
init: waitpid returned pid 3636, status = 00000000
init: untracked pid 3636 exited
netcfg
eth0 DOWN 0.0.0.0/0 0x00001002
ifconfig 192.168.0.33
netcfg
eth0 DOWN 192.168.0.33/24 0x00001002
dhcpcd eth0
eth0: waiting for carrier
eth0: carrier acquired
eth0: broadcasting for a lease
eth0: carrier lost
It seems that der Adaptor is recognized correctly but the network interface is not coming up.
ifconfig up eth0 doesn't help also.
Has somebody an idea how I can get further ?
Regards
Klaus

Spoof WIFI Mac address in Neo V

Spoof your MAC Address in Neo V.
My MAC was blocked from using the Wifi connection at my workplace. So I searched the Great Google on how to change my MAC Address or at least spoof it. What I found goes below.
I found this trick while searching the forum. But there it was mentioned for Google Nexus. So, I modified it to work with my Neo V but this should work with Neo as well . (I don't have Neo so I couldn't test it)
Requirements:
ROOTED PHONE
BUSYBOX INSTALLED
Baseband .72 installed.
Any Terminal App (I used Terminal Emulator)
Process to spoof
Open your Terminal App and type following commands:
Code:
su
busybox iplink show wlan0
The above command should show you your current MAC Address
Now type following command:
Code:
busybox ifconfig wlan0 hw ether 00:11:22:33:44:55
The above command should set your MAC Address to 00:11:22:33:44:55.
Instead of 00:11:22:33:44:55, you can use your any other MAC Address.
Enjoy your spoofed MAC Address.
NOTE: Remember once you restart your phone, the spoofed address is gone and it returns to your original MAC. So you will have to run the entire process again. Or you can just make a shell script and execute it on restart. If anyone asks me for the script I will add it later to this thread.
Click thanks button if this post helped you.
Can u please help me out in my HTC Desire S ???
For HTC Desire S
victorharsh said:
Can u please help me out in my HTC Desire S ???
Click to expand...
Click to collapse
Can you run the following Command and send me the result in this thread?
or you can PM me.
Type this in Terminal App:
Code:
busybox ifconfig
so that I can see your hardware details...
please check your PM
For HTC Desire S
Ok
So you can type following in terminal:
Code:
su
busybox ifconfig eth0 hw ether 00:11:22:33:44:55
Instead of 00:11:22:33:44:55, you can use your any other MAC Address that you know is valid.
Another important thing (for HTC Desire S only) : Switch ON your wifi connection so that hardware can be detected but don't connect it to any network or else it will become busy and wont allow you to change its MAC.
To confirm if the MAC Address is changed or not run the following code:
Code:
busybox iplink show eth0
this should now display your new MAC Address.
This does not work on my phone. It says "Busybox: applet not found".
ameer1234567890 said:
This does not work on my phone. It says "Busybox: applet not found".
Click to expand...
Click to collapse
You need to have busybox installed on your phone and for that it needs to be rooted. This is the requirement for this to work.
Also remember linux is case-sensitive so you need to type all the commands in lowercase.
khurram.khu said:
You need to have busybox installed on your phone and for that it needs to be rooted. This is the requirement for this to work.
Also remember linux is case-sensitive so you need to type all the commands in lowercase.
Click to expand...
Click to collapse
I have busybox installed. That is the reason the error mentions "applet not found". And yes, I am aware of linux case sensitivity.
Thank you for helping.
ameer1234567890 said:
I have busybox installed. That is the reason the error mentions "applet not found". And yes, I am aware of linux case sensitivity.
Thank you for helping.
Click to expand...
Click to collapse
From what I can see in the message I am guessing that you must be typing Busybox instead of busybox as seen in below quote.
ameer1234567890 said:
This does not work on my phone. It says "Busybox: applet not found".
Click to expand...
Click to collapse
I may be wrong but other than that I can't think of anything else.
khurram.khu said:
From what I can see in the message I am guessing that you must be typing Busybox instead of busybox as seen in below quote.
I may be wrong but other than that I can't think of anything else.
Click to expand...
Click to collapse
I am typing busybox (not caps). The error is because my busybox installation (Stericsson) does not come with those applets/functions.
Which busybox version are you using?
ameer1234567890 said:
I am typing busybox (not caps). The error is because my busybox installation (Stericsson) does not come with those applets/functions.
Which busybox version are you using?
Click to expand...
Click to collapse
I m using busybox v1.18.4
khurram.khu said:
I m using busybox v1.18.4
Click to expand...
Click to collapse
Which busybox installer?
ameer1234567890 said:
Which busybox installer?
Click to expand...
Click to collapse
I did not install it on my phone. It was probably installed by the method I used to root my phone.
And I used Rooting Toolkit for Xperia 2011 ICS [FW:.562]{LOCKED & UNLOCKED BOOTLOADERS} from DooMLoRD to root.
khurram.khu said:
I did not install it on my phone. It was probably installed by the method I used to root my phone.
And I used Rooting Toolkit for Xperia 2011 ICS [FW:.562]{LOCKED & UNLOCKED BOOTLOADERS} from DooMLoRD to root.
Click to expand...
Click to collapse
OK, I figured it out. Doesn't seem to work on my Xperia Pro. Never mind! Thanks for helping!
ameer1234567890 said:
OK, I figured it out. Doesn't seem to work on my Xperia Pro. Never mind! Thanks for helping!
Click to expand...
Click to collapse
OK...
But I really wanted to help you....
ameer1234567890 said:
OK, I figured it out. Doesn't seem to work on my Xperia Pro. Never mind! Thanks for helping!
Click to expand...
Click to collapse
try to use Terminal IDE
if I try any other terminal emulator I got same applet not found, but wen I'm useing Terminal IDE its ok
vla_diss said:
try to use Terminal IDE
if I try any other terminal emulator I got same applet not found, but wen I'm useing Terminal IDE its ok
Click to expand...
Click to collapse
Thanks man for solving someone's problem on my behalf
khurram.khu said:
Thanks man for solving someone's problem on my behalf
Click to expand...
Click to collapse
No problem, I'm glad that I can help
and I tryed busybox 1.18.4 and its working, but I like 1.20.1 so I'm back to terminal IDE and just for fun
Code:
#!/bin/sh
iplink show wlan0
echo "Enter new MAC:"
read num
ifconfig hw ether $num
or if u use 1.18.4
Code:
#!/bin/sh
busybox iplink show wlan0
echo "Enter new MAC:"
read num
busybox ifconfig hw ether $num
Help! Here is my ifconfig. Xperia Pro
Code:
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1158 errors:0 dropped:0 overruns:0 frame:0
TX packets:1158 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:64043 (62.5 KiB) TX bytes:64043 (62.5 KiB)
tiwlan0 Link encap:Ethernet HWaddr 84:00:D2:4C:5F:51
inet addr:192.168.2.127 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::8600:d2ff:fe4c:5f51/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:311 errors:0 dropped:0 overruns:0 frame:0
TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:52561 (51.3 KiB) TX bytes:3642 (3.5 KiB)
ameer1234567890 said:
Help! Here is my ifconfig. Xperia Pro
Code:
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1158 errors:0 dropped:0 overruns:0 frame:0
TX packets:1158 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:64043 (62.5 KiB) TX bytes:64043 (62.5 KiB)
tiwlan0 Link encap:Ethernet HWaddr 84:00:D2:4C:5F:51
inet addr:192.168.2.127 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::8600:d2ff:fe4c:5f51/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:311 errors:0 dropped:0 overruns:0 frame:0
TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:52561 (51.3 KiB) TX bytes:3642 (3.5 KiB)
Click to expand...
Click to collapse
So the modified commands for you would be:
Code:
su
busybox ifconfig tiwlan0 hw ether 00:11:22:33:44:55
if it says anything about the Device or Resource busy, then try turning your Wifi OFF and try the above code again.
:fingers-crossed: I hope this helps you this time. :fingers-crossed:
:good::good:
Now to verify that the MAC is changed type this:
Code:
busybox iplink show tiwlan0
Hopefully it must have changed by now. :good::fingers-crossed:
Tell us what happens after you are done with this.

tethering on rooted tablet, RNDIS device is created but ping doesn't work

Dear all
i'm trying to enable rndis communication between a tablet running Android 4.4.2 KOT49H rooted.
in the setting menu i'm not able to find any tethering option, so i've uploaded the script usb_tether_start.sh found here:
https://forum.xda-developers.com/showthread.php?t=2127850
After the start of the service, on andorid side i see that the rndis0 device is created and is up:
13: rndis0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether a2:63:00:89:3d:46 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.1/24 scope global rndis0
inet6 fe80::a063:ff:fe89:3d46/64 scope link
valid_lft forever preferred_lft forever
Click to expand...
Click to collapse
On the laptop side (running ubunto 14.0.4 LTS) the device is created too
dmes:
[ 8643.359537] usb 3-1: new high-speed USB device number 10 using xhci_hcd
[ 8643.495555] usb 3-1: New USB device found, idVendor=10d6, idProduct=4d02
[ 8643.495564] usb 3-1: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[ 8643.495568] usb 3-1: Product: P706
[ 8643.495571] usb 3-1: Manufacturer: P706
[ 8643.495575] usb 3-1: SerialNumber: A03B610405C78BB9
[ 8643.512630] rndis_host 3-1:1.0 usb0: register 'rndis_host' at usb-0000:45:00.0-1, RNDIS device, 32:ff:48:ea:0c:df
Click to expand...
Click to collapse
and ifconfig usb0 reports the device:
# ifconfig usb0
usb0 Link encap:Ethernet IndirizzoHW 32:ff:48:ea:0c:df
indirizzo inet:192.168.2.3 Bcast:192.168.2.255 Maschera:255.255.255.0
indirizzo inet6: fe80::30ff:48ff:feea:cdf/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:252 errors:0 dropped:0 overruns:0 carrier:0
collisioni:0 txqueuelen:1000
Byte RX:552 (552.0 B) Byte TX:40689 (40.6 KB)
Click to expand...
Click to collapse
I also see some TX/RX bytes but the ping or any other kind of communication between the laptop and the tablet isnt' working, i've tried both static ip configuration and request via dhcp client on laptop side (the dhcp request on the laptop hangs...)
Any idea or help?
Thanks to all in advance

Categories

Resources