Hi everyone,
This thread is obsolete because I found a solution check out my app here: http://forum.xda-developers.com/android/apps-games/app-dhcpv6-client-t3176443
This is port of Roy Marples dhcpcd client for Android.
Background:
The fact that Android doesn't support DHCPv6 is for many system administrators an eyesore.
The guys from google don't plan to implement this feature very soon or not at all. See https code.google.com/p/android/issues/detail?id=32621
Because of this I decided to cross compile the dhcpcd client from Roy Marples for android.
source: http roy.marples.name/projects/dhcpcd/home
This client was tested on my Nexus 5 with:
Chroma ROM (build from 05-06-2015 with Android 5.1.1)
3.4.107 UBER-L Kernel
Working
Execution of dhcpcd
Optaining AND setting IPv4 address
Optaining IPv6 address (but not assigning the address to an interface)
NOT Working
Assigning IPv6 address to an interface
running as dhcp user (will give you permission denied on the interfaces)
as replacement for the stock client (see below)
Installation
Connect your phone to your PC
Open an adb shell (adb shell)
ON PHONE:
Make a folder for the dhcp client
cd /sdcard && mkdir dhcpcd
ON COMPUTER:
Copy files to phone
adb push roy-marples-dhcpcd-android.tar.gz /sdcard/dhcpcd
ON PHONE:
cd /sdcard/dhcpcd
extract roy-marples-dhcpcd-android.tar.gz
tar -xf roy-marples-dhcpcd-android.tar.gz
aquire root
su
remount /system rw
mount -o remount,rw /system
copy dhcpcd client
cp out/system/bin/dhcpcd /system/bin/dhcpcd6
DO NOT OVERWRITE THE STOCK DHCP CLIENT!!!!!
Copy all other files and create folders
mkdir /data/misc/dhcp6 && mkdir /system/etc/dhcpcd6
cp out/system/etc/dhcpcd6/* /system/etc/dhcpcd6/.
copy required libs
cp libs/* /system/lib
setting permissions
chmod 755 /system/bin/dhcpcd6
chown root:shell /system/bin/dhcpcd6
chmod 644 /system/lib/ld-linux-armhf.so.3
chmod 644 /system/lib/libc.so.6
chmod 755 /system/etc/dhcpcd6
chmod 550 /system/etc/dhcpcd6/dhcpcd-run-hooks
chmod 644 /system/etc/dhcpcd6/dhcpcd.conf
chmod 770 /data/misc/dhcp6
chown dhcp:dhcp /data/misc/dhcp6
Behavior
dhcpcd - stock dhcp client
dhcpcd6 - my cross compiled dhcp client
This client will not work without the stock dhcpcd client for some reason.
When killing dhcpcd and connecting to a w-lan network dhcpcd will be started, you can then call dhcpcd6 and you will get a secondary IPv4 address, however you can get but not set an IPv6 address, see Issues to fix.
If you replace dhcpcd with dhcpcd6, android will not invoke a dhcpcd process, when connecting to a network, also manually over command line by calling dhpcd will not get an IP address.
If dhcpcd6 is invoked by the dhcp user (su dhcp -c "/system/bin/dhcpcd6") will give a permission denied at the interfaces for some reason.
Issues to Fix
You can obtain an IPv6 address but you can not assign it to an interface for some reason:
Code:
wlan0: soliciting a DHCPv6 lease
wlan0: ADV xxxx:67c:xxxx:52cc:xxxx::1419/128 from xxxx:67c:xxxx:52cc:xxxx::1
wlan0: REPLY6 received from xxxx:67c:xxxx:52cc:xxxx::1
wlan0: adding address xxxx:67c:xxxx:52cc:xxxx::1419/128
if_addaddress6: Invalid argument
I went through the source code and found out that the problem might come from the sendmsg function which basically sends data through a socket: if-linux.c line 865
Any advice would be appreciated
Troubleshooting
If you get something like this:
Code:
wlan0: Router Advertisement from 1234::1234:xxxx:xxxx:xxxx
wlan0: ignoring RA from 1234::1234:xxxx:xxxx:xxxx (no public prefix, no managed address)
Add ipv6ra_accept_nopublic to the /system/etc/dhcpcd6/dhcpcd.conf file
Help needed!
Basically just how to get it fully working
Any advise would be appreciated
Compiled with:
Compiled on: x86_64 GNU/Linux (Debian Jessie)
arm-linux-gnueabihf-
package: binutils-arm-linux-gnueabihf
preconfigure.sh
Code:
export CROSS_TARGET=arm-linux-gnueabihf
export CC="${CROSS_TARGET}-gcc-5"
## export CXX="${CROSS_TARGET}-g++"
export AR="${CROSS_TARGET}-ar"
export AS="${CROSS_TARGET}-as"
export LD="${CROSS_TARGET}-ld"
export RANLIB="${CROSS_TARGET}-ranlib"
export READELF="${CROSS_TARGET}-readelf"
export STRIP="${CROSS_TARGET}-strip"
Compile:
Code:
./configure --host=arm-linux-gnueabihf --enable-static --enable-ipv4 --enable-ipv6 --enable-embedded --sysconfdir=/system/etc/dhcpcd6 --bindir=/system/bin --libexecdir=/system/etc/dhcpcd6 --statedir=/data/misc/dhcp6 --dbdir=/data/misc/dhcp6 --rundir=/data/misc/dhcp6 --libdir=/system/lib
make -j2 ARCH=arm
mkdir out
make install DESTDIR=out
Thanks To:
Roy Maprles - for the source of his dhcp client
-realm_01
Edit 1 10:20 17-06-2015
I rebuilded the dhcpcd client with some changes in the directories, also I figured out what why I can't assign a IPv6 address
This thread is obsolete because I found a solution check out my app here: http://forum.xda-developers.com/android/apps-games/app-dhcpv6-client-t3176443
Related
I have some questions about some settings within the kernel of the HD2 device. Because the fact that I'm a Windows user I hope someone can explain this to me.
Let's take a look into the initrd.gz and take a look at the init.rc:
Code:
chmod 666 /dev/uinput
chmod 666 /etc/bluez/audio.conf
chmod 666 /etc/bluez/hcid.conf
chmod 666 /etc/bluez/input.conf
EVERY (!) Device is working with this settings. Wether within the ROM nor somewhere else is a link to this files. Here is also a file named "hcid.conf" which was the old name because now its named main.conf. The hcid.conf is responsible for i.e. the bluetooth pin.
2. Go ahead within the init.rc file and you will see this:
Code:
service hciattach /system/bin/brcm_patchram_plus --enable_hci --enable_lpm \
--baudrate 3000000 --patchram /etc/firmware/bcm4329.hcd /dev/ttyHS0
user bluetooth
group bluetooth net_bt_admin
disabled
If you take again a look at /etc/firmware you will NOT see any bcm4329.hcd. This file never exists. Also the "brcm_patchram_plus" is not within the /bin direcotry. I only have found the source code for this.
Within a ripped ROM file I found this information within the init.rc:
Code:
# Make sure we startup btld before hcid
# Set target address to emulator host loopback IF
# Limit baudrate to 460800 to ensure reliable uart operation
service btld /system/bin/logwrapper /system/bin/btld -hwtun 10.0.2.2 -hb 460800 3000000 -lpm 1
#service btld /system/bin/logwrapper /system/bin/btld -lpm 1 -hb 3000000
user root
group bluetooth net_bt_admin
disabled
oneshot
Question:
Could all this be a problem which is related to the "non displaying MAC Address" of the bluetooth within the HD2?
Thanks!
I have found a little bug in the WiFi settings of MIUI HD2 GINGER v9.2 where the Phase 2 authentication drop down menu does not accept its setting. In my case I am trying to set it to MSCHAPV2 and after selecting Save it does not take the setting and reverts to None.
How can I fix that bug
Didn't try yet ...but try this:
I'm not using eduRoam but our wifi is TTLS with Phase 2 PAP. Here's what worked for me
Step One
using adb shell:
# cd /data/misc/wifi
# cp wpa_supplicant.conf /sdcard
# exit
Step 2:
mount the sdcard on pc/ usb and edit the file
Here's what I added to my wpa_suppliant.conf file has (replace the *** with the correct information)
network={
ssid="***"
proto=WPA
key_mgmt=WPA-EAP IEEE8021X
group=CCMP TKIP
eap=TTLS
identity="***"
anonymous_identity="anonymous"
password="***"
ca_cert="/sdcard/***.cer"
phase2="auth=PAP"
priority=3
}
If you have a certificate ( ***.CER) you will need to have it on your sdcard - not inside a folder.
Step 3:
adb shell
# cd sdcard
# cp wpa_supplicant.conf /data/misc/wifi
# cd /data/misc/wifi
# su
# ls –l
(check other file(s) owners in my case it was – wifi.wifi but on previous ROMs it was root.root or System.wifi)
chown wifi.wifi wpa_supplicant.conf
# chmod 777 wpa_supplicant.conf (read, write execute for all) – start with 777 and relax it (I was lazy and left it there)
# reboot
drivers
asix.ko gl620a.ko net1080.ko smsc75xx.ko
dm9601.ko mcs7830.ko plusb.ko smsc95xx.ko
I had tried to use dm9601
install the driver
adb push usbnet /data/local/tmp
adb push dm9601.ko /data/local/tmp
adb shell
su
mount -o rw,remount /system
cp /data/local/tmp/usbnet /system/bin
chmod 755 /system/bin/usbnet
cp /data/local/tmp/dm9601.ko /system/lib/modules
mount -o ro,remount /system
Basic usage:
int a Terminal, enter
su
usbnet
If you can see eth0 and IP address infomation, it has connected to network。
for static ip
ifconfig eth0 add 192.168.0.2
busybox route add default gw 192.168.0.1
setprop net.dns1 192.168.0.1
Has anyone else tried this? Im thinking of trying it out.
After reading several posts on mac spoofing and having failed to find a working thread.I decided to fill in the gaps with my linux knowledge (however little of that I may have).
So this method seems to solve some issues I've seen (MAC not changing because device wasn't downed) in these threads:
http://forum.xda-developers.com/showthread.php?t=1385577
http://forum.xda-developers.com/showthread.php?t=902354
without editing the nvram.txt
I've tested the ip link method on my recently rooted Samsung Tab 2 7.0"
Changing your mac address:
Prerequisites:
*A rooted device
*Busybox
*Terminal emulator
*Turn wifi on from your device's menu, do not connect to any network.
*Open your terminal emulator, now type:
$su
#ip link
*This should list all networking interfaces, identify your wifi device, take note of the name. now:
#ip link set NAME down
#ip link set NAME address 00:11:22:33:44:55
#ip link set NAME up
I believe that when using ifconfig the procedure is as follows:
$su
#ifconfig
*Take note of the device name
#ifconfig NAME down
#ifconfig NAME hw ether 00:11:22:33:44:55
#ifconfig NAME up
After doing the above you can connect to the desired network normally, using the default / other user interfaces.
NOTE: The mac address will be reset when WIFI is switched off.
I have confirmed the ip link method to be working. i.e. transmitted mac address is the new / changed one!
Actually in my case (SGS) i had to restart wifi first and then (while it's starting) quickly change the MAC using:
Code:
busybox ifconfig wlan0 hw ether 00:11:22:33:44:55
Important: It must be done about 500ms after enabling wifi, otherwise it won't work.
If I change MAC when wifi is off it simply returns to the original during next start.
Worked on i9000 with CM9 / 10
pawci0 said:
Actually in my case (SGS) i had to restart wifi first and then (while it's starting) quickly change the MAC using:
Code:
busybox ifconfig wlan0 hw ether 00:11:22:33:44:55
Important: It must be done about 500ms after enabling wifi, otherwise it won't work.
If I change MAC when wifi is off it simply returns to the original during next start.
Worked on i9000 with CM9 / 10
Click to expand...
Click to collapse
So downing the interface before changing and uping afterwards doesn't work?
i want to learn well the mac spoofing
setoPul Wilcox
this is actually incredibly useful, I got MACblocked off a network near college. thanks!
Doesn't work for me
Code:
# su
# ifconfig tiwlan0 down
# ip link set tiwlan0 address 00:11:22:33:44:55
ip: SIOCSIFHWADDR: Operation not supported on transport endpoint
# ifconfig tiwlan0 hw ether 00:11:22:33:44:55
error: SIOCSIFADDR (Invalid argument)
I guess its a kernel/driver problem... at least I know it works on normal Linux systems.
Itcouldbeyou said:
Doesn't work for me
Code:
# su
# ifconfig tiwlan0 down
# ip link set tiwlan0 address 00:11:22:33:44:55
ip: SIOCSIFHWADDR: Operation not supported on transport endpoint
# ifconfig tiwlan0 hw ether 00:11:22:33:44:55
error: SIOCSIFADDR (Invalid argument)
I guess its a kernel/driver problem... at least I know it works on normal Linux systems.
Click to expand...
Click to collapse
Funny that only some manufacturers disable such features. You could always try editing the nvram file? I haven't tried it though.
Isnt it dangerous ?
Script to apply random mac
I've made a script to create a random ghost mac every time I run it on the terminal emulator with su.
Code:
macaddr="52:54:$(dd if=/dev/urandom count=1 2>/dev/null | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4/')"
ip link set wlan0 down
ip link set wlan0 address $macaddr
ip link set wlan0 up
I've named it as gmac.sh and saved it on /sdcard/, thus by running:
Code:
$ su
# sh /sdcard/gmac.sh
the mac is changed.
Regards :cyclops:
Works differently on HTC Desire
Hello,
This is just to "set in stone" somewhere in the Internet that on some devices, you need *not* to down and up the network interface. Otherwise, the network driver will restore its MAC address from hardware/driver settings.
On a HTC Desire, MAC spoofing works this way:
* turn on the wifi interface using the standard Android interface
* run this script :
Code:
macaddr="52:54:$(dd if=/dev/urandom count=1 2>/dev/null | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4/')"
ip link set wlan0 address $macaddr
Best regards,
On some devices (e.g. HTC Desire among others), the wifi GUI still resets the mac address even with the method described in this thread.
worstenbrood has modified the wifi driver so that the mac address can be configured from a text file. It is described here:
http://forum.xda-developers.com/showthread.php?t=1525230
This is compatible with the wifi GUI and solves the problem of the wifi interface reloading its original mac address.
Anyone interested, I have backported his modifications to the latest state of the kernel developement in CM7.
thanks!
I get a 'operation not supported on transport endpoint' error when running the 'ip link set wlan0 address 00:11:22:33:44:55' and a about the same error with busy box.
Thanks for this! Gonna try this later.
damien.courousse said:
Hello,
This is just to "set in stone" somewhere in the Internet that on some devices, you need *not* to down and up the network interface. Otherwise, the network driver will restore its MAC address from hardware/driver settings.
On a HTC Desire, MAC spoofing works this way:
* turn on the wifi interface using the standard Android interface
* run this script :
Code:
macaddr="52:54:$(dd if=/dev/urandom count=1 2>/dev/null | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4/')"
ip link set wlan0 address $macaddr
Best regards,
Click to expand...
Click to collapse
anyone help me mine Hcl me 2G 2.0 i can't change mac please help me....
Hi,
This is a guide on compiling the latest (as of 2015-06-24) dropbear SSH daemon (2015.67) for the Zenfone 2 but should also work for other x86-64 architecture Android devices. The guide is mainly based off the work from the blog http://blog.xulforum.org/index.php?post/2013/12/19/Compiling-Dropbear-for-a-Nexus-7-tablet which is an excellent guide to getting an older version of dropbear running on Android devices.
I've modified the patch made by the original author to work on the latest dropbear version. There are not much changes from ver 2013.58 to 2015.67. The main difference seems to be the support for Elliptical Curve encryption.
** START DISCLAIMER **
I did not write the original codes/patch myself and have not scrutinized it for any security issues. USE IT AT YOUR OWN RISK.
** END DISCLAIMER **
Here's the list of requirements :-
1) Dropbear 2015.67 source code - dropbear-2015.67.tar.bz2 (https://matt.ucc.asn.au/dropbear/releases/dropbear-2015.67.tar.bz2)
2) Patch to compile for Android - dropbear-v67-android-patch-20150629 (https://goo.gl/LBokgG)
3) A recent Linux distro (I use Ubuntu 14.04.2 LTS) running x86-64.
4) Development tools i.e. C compiler, linker, etc... all the necessary tools to run configure, make, etc..
Steps :-
(1) Extract the source code to a directory of its own :-
Code:
tar xjf dropbear-2015.67.tar.bz2
cd dropbear-2015.67
(2) Patch the source :-
Code:
patch -p1 < dropbear-v67-android-patch-20150629
(3) Run configure :-
Code:
./configure --disable-zlib --disable-largefile --disable-loginfunc \
--disable-shadow --disable-utmp --disable-utmpx --disable-wtmp \
--disable-wtmpx --disable-pututline --disable-pututxline --disable-lastlog
(4) Run make :-
Code:
STATIC=1 MULTI=1 SCPPROGRESS=0 PROGRAMS="dropbear dropbearkey scp dbclient" make strip
(5) You should end up with a single static binary "dropbearmulti" which you should link dropbear, dbclient/ssh, dropbearkey and scp to.
Code:
./dropbear -h
Dropbear server v2015.67 [URL]https://matt.ucc.asn.au/dropbear/dropbear.html[/URL]
Usage: ./dropbear [options]
-A Android Mode, specify a user explicitly
-N Android Mode, user name
-C Android Mode, password
-R Android Mode, public key file (authorized_keys)
-U Android Mode, UID
-G Android Mode, GID
-b bannerfile Display the contents of bannerfile before user login
(default: none)
-r keyfile Specify hostkeys (repeatable)
defaults:
dss /etc/dropbear/dropbear_dss_host_key
rsa /etc/dropbear/dropbear_rsa_host_key
ecdsa /etc/dropbear/dropbear_ecdsa_host_key
-F Don't fork into background
-E Log to stderr rather than syslog
-m Don't display the motd on login
-w Disallow root logins
-s Disable password logins
-g Disable password logins for root
-B Allow blank password logins
-j Disable local port forwarding
-k Disable remote port forwarding
-a Allow connections to forwarded ports from any host
-p [address:]port
Listen on specified tcp port (and optionally address),
up to 10 can be specified
(default port is 22 if none specified)
-P PidFile Create pid file PidFile
(default /var/run/dropbear.pid)
-i Start for inetd
-W <receive_window_buffer> (default 24576, larger may be faster, max 1MB)
-K <keepalive> (0 is never, default 0, in seconds)
-I <idle_timeout> (0 is never, default 0, in seconds)
-V Version
I will assume you know what to do with the binary file generated so will not elaborate on the process.
Hope it works for you guys. I'll be happy to help out anyone who needs more details.
Cheers.
UPDATE: 2015-06-29
- I've updated the patch to fix dbclient/ssh client using password authentication.
Hi all,
For those of you using the dropbear ssh client and encountering a seg fault when using password authentication, I've fixed the patch now and it should be working.
Cheers.
wolfdude said:
I will assume you know what to do with the binary file generated so will not elaborate on the process.
Hope it works for you guys. I'll be happy to help out anyone who needs more details.
Click to expand...
Click to collapse
Ehm...
Replacing the not working dropbear binaries of ARM-oriented SSHD servers with a link to this should solve the problem discussed here ...
is it right ?!
Thanks again
Val3r10 said:
Ehm...
Replacing the not working dropbear binaries of ARM-oriented SSHD servers with a link to this should solve the problem discussed here ...
is it right ?!
Thanks again
Click to expand...
Click to collapse
In a nutshell, you will need to copy dropbearmulti to /system/xbin, create some symbolic links to it (dropbear, dropbearkey, dbclient, scp), run dropbearkey to generate your host keys, copy your client pubkey to /data/dropbear/authorized_keys and then startup dropbear with parameters like :-
Code:
dropbear -A -N root -R /data/dropbear/authorized_keys
Hope this helps.
Cheers.
wolfdude said:
[...] and then startup dropbear with parameters like :-
Hope this helps.
Click to expand...
Click to collapse
Thanks. Got that.
Actually I mean I would replace - with the symlink - the x86 binary file inside one of the above mentionned packages, i.e. QuickSSHd or SSHDroid, to make them compatible with ZE55xML...
I'm trying and reporting here