[Q] USB Ethernet dongle on Samsung Lollipop - General Questions and Answers

Hi,
I'm trying to run my USB Ethernet dongle with my S4 LTE+ (GT-I9506 Lollipop), but aplications in the phone and other computers on the network didn't see that connection.
My tryings:
[email protected]:/ # netcfg eth0 up
[email protected]:/ # netcfg eth0 dhcp
[email protected]:/ # netcfg|grep eth0
eth0 UP 10.0.0.12/24 0x00001043 f0:25:b7:20:af:75
[email protected]:/ # ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=1.96 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=2.05 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=1.87 ms
[email protected]:/ # ping www.google.com
ping: unknown host www.google.com
2|[email protected]:/ # nslookup www.google.com
Server: 8.8.4.4
Address 1: 8.8.4.4 google-public-dns-b.google.com
Name: www.google.com
Address 1: 2a00:1450:4013:c01::93 ea-in-x93.1e100.net
Address 2: 74.125.136.104 ea-in-f104.1e100.net
Address 3: 74.125.136.103 ea-in-f103.1e100.net
Address 4: 74.125.136.99 ea-in-f99.1e100.net
Address 5: 74.125.136.105 ea-in-f105.1e100.net
Address 6: 74.125.136.147 ea-in-f147.
I've found this but it also doesn't work:
ndc network create 100
ndc network interface add 100 eth0
ndc network route add 100 eth0 <GATEWAY>/24
ndc network route add 100 eth0 0.0.0.0/0 <DNS1> <DNS2>
ndc resolver setnetdns 100 localdomain <DNS1> <DNS2>
ndc network default set 100
Any suggestions?
Thx

Related

Android and OpenVPN

Running android-openvpn-settings on Das BAMF 1.8.6 rooted thunderbolt.
My config file:
Code:
remote mine.dyndns.org 443
client
proto tcp
nobind
dev tap
comp-lzo
verb 4
log /sdcard/openvpn/openvpn.log
resolv-retry infinite
persist-key
persist-tun
redirect-gateway def1
dhcp-option DNS 192.168.1.1
route-gateway 192.168.1.1
route-delay 10
ns-cert-type server
key-direction 1
ca "camine.crt"
cert "mine2.crt"
Had to manually add this route for the log file to be free of errors. route-default would cause some route add/del's that would give Invalid Parameter or No Such Process errors since 192.168.1.0 wasnt anywhere in the table. So running this before opening the VPN tunnel got rid of the errors:
Code:
busybox route add -net 192.168.1.0 netmask 255.255.255.0 rmnet_sdio0
Heres what my routing table looks like after android-openvpn-settings runs and says the tunnel is open:
Code:
# busybox route -n
busybox route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
98.249.31.333 192.168.1.1 255.255.255.255 UGH 0 0 0 rmnet_sdio0
98.249.31.333 10.189.54.12 255.255.255.255 UGH 0 0 0 rmnet_sdio0
10.189.54.11 0.0.0.0 255.255.255.240 U 0 0 0 rmnet_sdio0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 rmnet_sdio0
0.0.0.0 192.168.1.1 128.0.0.0 UG 0 0 0 rmnet_sdio0
128.0.0.0 192.168.1.1 128.0.0.0 UG 0 0 0 rmnet_sdio0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 rmnet_sdio0
0.0.0.0 10.189.54.12 0.0.0.0 UG 0 0 0 rmnet_sdio0
No clue if the table is OK now. One weird thing is I can't ping through tun0 at all. Don't see tun0 in ifconfig either... Did I miss some huge step?
Code:
# ping -c 1 -I tun0 192.168.1.1
ping -c 1 -I tun0 192.168.1.1
ping: unknown iface tun0
only background I have is with that config (except redirect-gateway instead of redirect-gateway def1) used to work on my old WM phone.
Anyone have any ideas? Let me know if I can provide any more details... Ive been racking my brain on this the past couple of days. Out of ideas.
Bump. Any ideas?
Maybe my Tun setup is wrong? Where is tun.ko located on Das BAMF 1.8.6? The location in the android-openvpn-settings just says "tun"
A few things to try:
1) Change the symlinks /system/bin/ifconfig and /system/bin/route to point to /system/xbin/busybox instead of toolbox
2) Once the tunnel is established, try these commands in a terminal:
ip ru del table gprs
ip ru del table wifi
After "connecting" with android-openvpn-settings then running
Code:
netcfg tap0 dhcp
in a terminal openvpn works.
Still have no clue about CM7 built in OpenVPN and the broken tunnel message.

[Q] Enable both wifi and mobile data for multihoming

This might sound like a slightly odd thing to do, but I am trying to enable both wifi and mobile data on an Motorola Xoom pad at the same time. I need both interfaces as I am exploring multihoming of mobile devices. To illustrate the current behavior of the xoom.
sh-4.1# netcfg
...
ppp0 UP 95.209.163.33 255.255.255.255 0x000010d1
sh-4.1# svc wifi enable
sh-4.1# netcfg
...
ppp0 UP 95.209.163.33 255.255.255.255 0x000010d1
wlan0 UP 0.0.0.0 0.0.0.0 0x00001043
sh-4.1# netcfg
...
ppp0 DOWN 0.0.0.0 0.0.0.0 0x00001090
wlan0 UP 130.229.167.92 255.255.192.0 0x00001043
sh-4.1# netcfg
...
wlan0 UP 130.229.167.92 255.255.192.0 0x00001043
It seems that enabling data over wlan0 automatically disables the mobile data. Is there any known way to prevent this and have both interfaces enabled at the same time?
I have root access on the tablet and I am not afraid to write some code if that is what is needed. I just don't know where to start.
ps.
I have tried searching and not found any similar question.
ds.
/Pehr

join ad hoc network

Hello all,
I have android 4.2.2 ,Nexus 4
I would like to setup adhoc network .
Firstly I rooted the device,
secondly I tried to create adhoc network in android phone :
I create ad hoc network in an android smartphone with this:
-------------------
[email protected]:/ # ip link set dev wlan0 down
[email protected]:/ # iwconfig wlan0 mode ad-hoc
[email protected]:/ # iwconfig wlan0 channel 6
[email protected]:/ # iwconfig wlan0 essid 'Test1'
[email protected]:/ # ip link set dev wlan0 up
[email protected]:/ # ifconfig wlan0 192.168.65.129
---------------
when I typed iwconfig wlan0:
the result is:
result1:
-----------------
Qcom:802.11n ESSID:"Test1"
Mode:Ad-Hoc Frequency:2.437 GHz Cell: 02:82:5F:C1:4B:C1
Bit Rate=0 kb/s Tx-Power=0 dBm
RTS thr=2347 B Fragment thr=8000 B
Encryption keyff
--------------
Secondly, in my laptop ,I could see "Test1",so I did connect to "Test1" and I configure static ip address 192.168.65.128.
in this case ,the smartphone create the ad hoc network and my laptop join it,then I can ping from my laptop to mobile and vice-versa.
However,in other case when :
my laptop create ad hoc network
and later in an android mobile ,I tried to join it :
-----------------
[email protected]:/ # iwconfig wlan0 mode ad-hoc
[email protected]:/ # iwconfig wlan0 channel 6
[email protected]:/ # iwconfig wlan0 essid 'Test1'
------------
But,when I type iwconfig wlan0 ,essid still off/any
result2:
Qcom:802.11n ESSIDff/any
Mode:Ad-Hoc Frequency:2.437 GHz Cell: Not-Associated
Bit Rate:0 kb/s Tx-Power=0 dBm
RTS thr=2347 B Fragment thr=8000 B
Encryption keyff
it seems that android mobile can create ad hoc network but can not join existing one.
so the same result I found when I try to setup adhoc network between two android mobiles:
in both android mobiles I typed :
--------------
[email protected]:/ # ip link set dev wlan0 down
[email protected]:/ # iwconfig wlan0 mode ad-hoc
[email protected]:/ # iwconfig wlan0 channel 6
[email protected]:/ # iwconfig wlan0 essid 'Test1'
[email protected]:/ # ip link set dev wlan0 up
-------------------
for the first one I configure
[email protected]:/ # ifconfig wlan0 192.168.65.129
the second one:
[email protected]:/ # ifconfig wlan0 192.168.65.127
so the result of iwconfig wlan0:
in the first one: like result1
in the second android smartphone :like result2
and of course ,I can't ping from one to other.
in brief,it seems that in android smartphone I can create adhoc network but I can't join existing one.
can anybody tell me what it's wrong here,and if there is any possible solution,
I tried many methods to setup ad hoc network in my android mobiles,and only this method that it seems work,but it still something wrong that prevent android phone to join existing ad hoc network.

wired networking without DHCP

I suspect I'm not the only person with a wired network adapter - and some of us may be trying to do things like configure routers, etc, where there's no active DHCP server.
I was in this situation a couple of days ago, configuring a dd-wrt box with DHCP turned off.
The best how-to I found was at this entry at HeadlessAndroid
This could be "old hat" to everybody here (other than me), but, for most of my android devices, if I'm in the terminal, I'm connected via "adb terminal" so I've never needed to do this - and ifcfg does not work the way I'd have expected.
Hope this helps someone...
Networking on a Headless Android System
Android isn't the most intuitive environment for setting up networking on the command line. After playing with several different options here's what I've found.
Summary
# netcfg eth0 dhcp
# route add default gw 192.168.0.1 dev eth0
# setprop net.dns1 208.67.222.222
# setprop net.dns2 208.67.222.220
Details
The Android tools are quite different from the tools found on other embedded Linux systems, so most people I've talked to have had difficulty figuring out what utilities to use and how to use them. The most interesting one is ifconfig. When you type ifconfig on an Android system nothing happens. On a standard busybox or gnu based Linux system you will see the available networking interfaces and their associated settings (ok, technically ifconfig -a will show you that information). Since ifconfig doesn't show anything, most people assume (incorrectly) that it doesn't work.
On my development platform, to set a static IP address, I did the following:
# ifconfig eth0 192.168.0.84 netmask 255.255.255.0
Which didn't give any response, but DID show the following when I did netcfg.
# netcfg
lo UP 127.0.0.1 255.0.0.0 0x00000049
eth0 UP 192.168.0.84 255.255.255.0 0x00001043
usb0 DOWN 0.0.0.0 0.0.0.0 0x00001002
tunl0 DOWN 0.0.0.0 0.0.0.0 0x00000080
gre0 DOWN 0.0.0.0 0.0.0.0 0x00000080
sit0 DOWN 0.0.0.0 0.0.0.0 0x00000080
So what about DHCP you may ask?
# netcfg eth0 dhcp
Which yields the following.
# netcfg
lo UP 127.0.0.1 255.0.0.0 0x00000049
eth0 UP 192.168.0.227 255.255.255.0 0x00001043
usb0 DOWN 0.0.0.0 0.0.0.0 0x00001002
tunl0 DOWN 0.0.0.0 0.0.0.0 0x00000080
gre0 DOWN 0.0.0.0 0.0.0.0 0x00000080
sit0 DOWN 0.0.0.0 0.0.0.0 0x00000080
Just because you have an IP address now doesn't mean the applications on your Android device can get to the network. For that you have to set a default route and set the DNS resolver addresses. Again, with route keep in mind it won't show the usual output that a standard busybox or gnu based embedded Linux system would show.
To set the default route:
# route add default gw 192.168.0.1 dev eth0
And to set the DNS (I'm using OpenDNS addresses here):
# setprop net.dns1 208.67.222.222
# setprop net.dns2 208.67.222.220
And that allows the holy grail of a DNS resolved ping to a domain on the Internet.
# ping google.com
PING google.com (74.125.224.134) 56(84) bytes of data.
64 bytes from nuq04s09-in-f6.1e100.net (74.125.224.134): icmp_seq=1 ttl=57 time=41.5 ms
64 bytes from nuq04s09-in-f6.1e100.net (74.125.224.134): icmp_seq=2 ttl=57 time=43.2 ms
References
I found some great information in the following links.
http://www.anddev.org/advanced_networking_with_android-linux-t155.html
http://elinux.org/Android_Networking
Click to expand...
Click to collapse

Samsung Tab S 10.5- Cannot Use WLAN And Ethernet At The Same Time

networ
Dear all,
I am facing some issues with my device and I think that those can be a general "problem" of Android.
First I will describe what I want to do:
I have got an Android tablet with root access. (Samsung Tab S 10.5) and a docking station (Samsung EE-MT800) with ethernet socket.
When I plug in the network cable, I can configure the ethernet interface within Android settings or I can configure it with terminal emulator.
This is working fine, but: As soon as I want to use both, the WLAN and the Ethernet itnerface I cannot use both at one time. If have checked netcfg and it shows the interfaces wlan0 and eth0 "UP" and configured with the correct IP addresses. The routes were added correctly and the default route is set to the WLAN and the ethernet default route not present. BUT I cannot ping devices connected to the ethernet interface directly. After disabling wlan0 interface, a ping is possible.
References from CLI:
[email protected]:/ # netcfg
wlan0 UP 192.168.2.108/24 0x00001043 78:40:e4:11:11:11
sit0 DOWN 0.0.0.0/0 0x00000080 00:00:00:00:00:00
eth0 UP 192.168.5.77/24 0x00001043 6c:a7:fa:00:00:00
p2p0 UP 0.0.0.0/0 0x00001003 7a:40:e4:16:e3:61
lo UP 127.0.0.1/8 0x00000049 00:00:00:00:00:00
rmnet1 DOWN 0.0.0.0/0 0x00001090 00:00:00:00:00:00
rmnet0 DOWN 0.0.0.0/0 0x00001090 00:00:00:00:00:00
rmnet2 DOWN 0.0.0.0/0 0x00001090 00:00:00:00:00:00
rmnet3 DOWN 0.0.0.0/0 0x00001090 00:00:00:00:00:00
ip6tnl0 DOWN 0.0.0.0/0 0x00000080 00:00:00:00:00:00
[email protected]:/ # ip route show
default via 192.168.2.1 dev wlan0 metric 310
192.168.2.0/24 dev wlan0 proto kernel scope link src 192.168.2.108 metric 310
192.168.5.0/24 dev eth0 proto kernel scope link src 192.168.5.77
Ping:
192.168.2.1 and 8.8.8.8 possible,
192.168.5.1 impossible
After disabling wlan0 interface, ping is possible:
[email protected]:/ # netcfg wlan0 down
[email protected]:/ # ip route show
192.168.5.0/24 dev eth0 proto kernel scope link src 192.168.5.77
[email protected]:/ # ping 192.168.5.1
PING 192.168.5.1 (192.168.5.1) 56(84) bytes of data.
64 bytes from 192.168.5.1: icmp_seq=1 ttl=64 time=2.06 ms
64 bytes from 192.168.5.1: icmp_seq=2 ttl=64 time=1.17 ms
64 bytes from 192.168.5.1: icmp_seq=3 ttl=64 time=1.10 ms
64 bytes from 192.168.5.1: icmp_seq=4 ttl=64 time=1.02 ms
^C
--- 192.168.5.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 1.025/1.342/2.063/0.419 ms
Can somebody help me with this?

Categories

Resources