[Q] openvpn issues - HTC Flyer, EVO View 4G

Hey everybody,
on my "normal" linux computer, I am using openvpn with the following config file:
Code:
port 1194
proto tcp-client
dev tap
tls-client
remote xxxxxxxx.dyndns.org 1194
ca /some/path/to/ca-certificate.crt
cert /some/path/to/certificate.crt
key /some/path/to/key.pem
cipher AES-256-CBC
comp-lzo
pull
ping 15
ping-restart 120
resolv-retry 60
verb 4
Now, from my computer, everything works fine.
Having applied the exact same config file to my Flyer, I am getting routing issues:
(Of course, I have changed the paths to the certificates)
Code:
[COLOR="Blue"]openvpn.log[/COLOR]:
Sun Jan 1 10:51:38 2012 us=60137 ROUTE default_gateway=192.168.150.1
Sun Jan 1 10:51:38 2012 us=72222 TUN/TAP device tap0 opened
Sun Jan 1 10:51:38 2012 us=72374 TUN/TAP TX queue length set to 100
Sun Jan 1 10:51:38 2012 us=72496 /system/xbin/bb/ifconfig tap0 10.0.0.2 netmask 255.255.255.0 mtu 1500 broadcast 10.0.0.255
Sun Jan 1 10:51:38 2012 us=75426 OpenVPN ROUTE: omitted no-op route: 10.0.0.1/255.255.255.255 -> 10.0.0.1
Sun Jan 1 10:51:38 2012 us=75731 [COLOR="Red"]/system/xbin/bb/route add -net 192.168.0.0 netmask 255.255.255.0 gw 10.0.0.1[/COLOR]
Sun Jan 1 10:51:38 2012 us=79393 Initialization Sequence Completed
Code:
/system/xbin/bb # [COLOR="Blue"]route[/COLOR]
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.150.1 * 255.255.255.255 UH 0 0 0 eth0
[COLOR="Red"]10.0.0.0 * 255.255.255.0 U 0 0 0 tap0[/COLOR]
192.168.150.0 * 255.255.255.0 U 311 0 0 eth0
[COLOR="Red"]192.168.0.0 10.0.0.1 255.255.255.0 UG 0 0 0 tap0[/COLOR]
default 192.168.150.1 0.0.0.0 UG 0 0 0 eth0
default 192.168.150.1 0.0.0.0 UG 311 0 0 eth0
Code:
/system/xbin/bb # [COLOR="Blue"]ip route[/COLOR]
192.168.150.1 dev eth0
[COLOR="Red"]10.0.0.0/24 dev tap0 src 10.0.0.2[/COLOR]
192.168.150.0/24 dev eth0 src 192.168.150.193 metric 311
[COLOR="Red"]192.168.0.0/24 via 10.0.0.1 dev tap0[/COLOR]
default via 192.168.150.1 dev eth0
default via 192.168.150.1 dev eth0 metric 311
Code:
/system/xbin/bb # [COLOR="Blue"]traceroute 10.0.0.1[/COLOR]
traceroute to 10.0.0.1 (10.0.0.1), 30 hops max, 38 byte packets
1 192.168.150.1 (192.168.150.1) 7.935 ms 5.737 ms 4.852 ms
2 * * *
3 92.72.0.1 (92.72.0.1) 21.607 ms !A 21.424 ms !A 21.668 ms !A
Code:
/system/xbin/bb # [COLOR="Blue"]traceroute 192.168.0.1[/COLOR]
traceroute to 192.168.0.1 (192.168.0.1), 30 hops max, 38 byte packets
1 192.168.150.1 (192.168.150.1) 6.012 ms 9.369 ms 5.554 ms
2 * 92.72.0.1 (92.72.0.1) 25.727 ms !A 21.209 ms !A
Anyone able to give me a hand? Much appreciated!

Related

Issue on inetd for N1

I add and configured /etc/inetd.conf, line data like:
8888 stream tcp nowait root micro_httpd /sdcard/www/
then run inetd.
#netstat -an |grep LIS
tcp 0 0 0.0.0.0:8888 0.0.0.0:* LISTEN
but when i telnet 127.0.0.1 8888, i got "Connection closed by foreign host".
micro_httpd standalone run is ok.
what's the problem?
Thanks
Eagle

[script] reliable interface stats

[script] reliable interface stats
pro: reliable, works on any Linux; low battery consumption; runs only when necessary
contra: no GUI
prerequisites: script manager able to trigger on network changes
root is not needed, because the script uses the readable-for-all /proc/net/dev interface to gather statistics.
My problem was that I could not find any app that would give me the megabytes sent from/to the device. They would either ignore GPRS, WiFi or count from reboot to reboot, display stupid ads or cost even money without delivering. I'm on a data flatrate with throttling from 200MB up, and I only want to know how much I already "spent".
The following script should run on network changes, but it can be run at any time. You get more data entries in the log files for the various active interfaces when running it more often.
EDIT: it turns out the "network change" event works perfectly for interface wlan0, but not for pdp0, which happens to be the GPRS/G2/G3/G4 packet interface. Maybe "Tasker" does better than "Script Manager" with this, try and find out. What will always work is manual mode: after using an interface, run the script. This will enter the numbers from any interface that traffic into the respective log.
The script is run with zero or one argument. If given, it can be the name of an interface or the string "all" to get just a readout of the current counters of all interfaces that had traffic without logging anything.
The output is lines with bytes, data packets, errornous and dropped packets for "rx" (received) and "tx" (transmitted) for all or the selected interfaces. Without arguments all active interfaces are logged to separate files in /sdcard/. If you want to change this directory or the names or the date format, well, it should be easy to adapt.
Note that this first script does only data gathering as to the byte counts and it must run on network events. See below for the script(s) that do evaluation according to date to find out how much to go until throttling.
Code:
#!/system/bin/sh
want_if="${1:-*}"
all=""
case "-${want_if}" in
-all)
want_if="*"; all=all;
;;
esac
log_prefix="/mnt/sdcard/interface-stats"
now="$(date '+%d.%m.%y-%H:%M:%S')"
# rx: bytes packets errs drop fifo frame compressed multicast
# tx: bytes packets errs drop fifo colls carrier compressed
# lo: 4944 74 0 0 0 0 0 0 4944 74 0 0 0 0 0 0
# wlan0: 42447725 41554 302 0 0 0 0 0 3280981 33753 0 0 0 0 0 0
while read intf rb rp re rd x x x x tb tp te td rest
do
case "-${intf}" in
-${want_if:-*}:)
case "${rb}--${tb}" in
0--0) continue;;
esac
stats="rx: $rb $rp $re $rd tx: $tb $tp $te $td"
intf_="${intf%:}"
echo "${intf} ${stats}"
[ -z "${all}" ] &&
echo "${now} ${stats}" >> "${log_prefix}-${intf_}.txt"
;;
esac
done < /proc/net/dev
exit 0
Here's the script to output the megabytes. It gets zero, one or two arguments, the first being a date pattern that needs to match the dates in the log file, the second the name of said logg.
An optional third argument, if given, gives debug output. Use only if the number doesn't look plausible.
It doesn't need any special privileges and can be run anytime.
If less than one megabyte has been hit so far, then the output is the number of bytes. Due to limitations of "awk" there can still be decimals in the output!
Code:
# /home/ino/interface-stats.sh _date: 20120225-2103_
# vim: set filetype=sh ts=4:
# -*- mode: sh; -*-
#
# <url:man:1 awk>
# sample:
#
# 25.02.12-02:28:28 rx: 182909647 374371 462 0 tx: 681742703 542899 0 0
# 25.02.12-12:15:00 rx: 3 374464 494 0 tx: 5 542974 0 0
#
# at around noon the device was rebooted, so the stats start at low
# values.
#
# algorithm:
#
# initialize old-accumulator and offset to zero.
#
# since received and transmitted bytes are accumulated by the kernel,
# the script has to just store the sum of the received and transmitted
# bytes into an accumulator, unless the current value is less than the
# running count. this happens after a reboot. so store this first low
# value into $offset, store the old accumulator and keep the running game
# until either the next reboot or EOF. now
# accumulator = old-accumulator + accumulator - offset.
awk_prog='
BEGIN {
debug = debug > 0
accu=0
accu_old=0
offset=0
accu_sum=0
# megabytes
mb_scaler=1024*1024
# field definitions
rx_bytes=3
rx_packets=4
rx_errors=5
rx_dropped=6
tx_bytes=8
tx_packets=9
tx_errors=10
tx_dropped=11
# date pattern
# 25.02.12-12:15:00 rx: 3 374464 494 0 tx: 5 542974 0 0
pat_date_dflt = "[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]-[0-9][0-9]:[0-9][0-9]:[0-9][0-9]"
pat_date = length(pat_date) == 0 ? pat_date_dflt : pat_date
}
function dbg(x) {
if (debug > 0) print("debug: " x);
}
# no particular validity check: if there are 11 fields and the first one
# matches the date the user is after, we will use the record.
(NF == 11) && ($1 ~ pat_date) {
dbg("select line: " $0)
accu_sum = $rx_bytes + $tx_bytes
if (accu_sum < accu) {
dbg("break: accu_sum=" accu_sum "; accu_old=" accu_old "; accu=" accu "; offset=" offset);
accu = accu_old + accu - offset
accu_old = accu
offset = accu_sum
accu = accu_sum
} else {
accu = accu_sum
}
}
END {
dbg("eof: accu_sum=" accu_sum "; accu_old=" accu_old "; accu=" accu "; offset=" offset);
accu = accu_old + accu - offset
if (accu > mb_scaler) accu = (accu / mb_scaler) "MB"
print(accu)
}
'
debug=0
log_prefix="/mnt/sdcard/interface-stats"
dates="${1:-.}"
want_if="${2:-wlan0}"
debug="${3+1}"
input="${log_prefix}-${want_if}.txt"
awk -v pat_date="${dates}" -v debug="${debug}" "${awk_prog}" "${input}"
And finally this one is for quick inspection of a logg. Gets the name of an interface as argument if needed. Again it needs no privileges and is appropriate for use as a SMwidget.
Code:
#!/system/bin/sh
want_if="${1:-wlan0}"
log_prefix="/mnt/sdcard/interface-stats"
logg="${log_prefix}-${want_if}.txt"
[ -r "${logg}" ] &&
while read tim rx rb rp re rd tx tb tp te td rest
do
case "${rb}--${tb}" in
0--0) continue;;
esac
stats="rx: $rb $rp $re $rd tx: $tb $tp $te $td"
echo "${tim} ${stats}"
done < "${logg}"
exit 0
Does somebody know what tags to brace code with in order to keep formatting intact? To me all my stuff has no indentation and lines seem to break at other points than just and only newlines!
EDIT: just found out that there's no problem in the web view, it's just the "forum runner" that can't render what the "\[ code \]" tag generates.
Well, as an alternative, what's the least-hassle file dump?

[Q] tun.ko for Samsung i9008

Hi, guys
I have a Samsung i9008 which is specific for China Mobile 3G TD-SCDMA.
Kernel version: 2.6.29-zeus1
I have download samsung i9008 resource code and compiled a tun.ko file.
Installed successfully without any errors (insmod).
# insmod /system/tun.ko
insmod: setup_module '/system/tun.ko'
# dmesg | grep tun
<6>[ 7.047790] IPv4 over IPv4 tunneling driver
<6>[ 7.066741] IPv6 over IPv4 tunneling driver
<6>[ 174.259918] tun: Universal TUN/TAP device driver, 1.6
<6>[ 174.266601] tun: (C) 1999-2004 Max Krasnyansky <[email protected]>
# lsmod
tun 11036 0 - Live 0xbf283000g_serial_softmodem 18504 0 - Live 0xbf279000
tiwlan_drv 823192 0 - Live 0xbf1ab000
omaplfb 16584 0 - Live 0xbf1a1000
pvrsrvkm 149188 43 omaplfb, Live 0xbf177000
modem_relay 71096 0 - Live 0xbf160000
vibrator 4104 0 - Live 0xbf159000
gsd4t 6900 0 - Live 0xbf152000
accel 18012 1 - Live 0xbf148000
PL_sensor 20276 0 - Live 0xbf13e000
compass 16848 1 - Live 0xbf134000
samsung_battery 24823 0 - Live 0xbf128000
dpram_flashless 183768 4 - Live 0xbf0f6000
param 17376 0 - Live 0xbf0ef000
rfs_fat 233792 6 - Live 0xbf0b0000 (P)
rfs_glue 75052 1 rfs_fat, Live 0xbf098000 (P)
fsr_stl 250268 6 - Live 0xbf055000 (P)
fsr 324408 4 dpram_flashless,param,fsr_stl, Live 0xbf000000 (P)
I have installed BusyBox. I have tried many version of BusyBox.
But when I connect in VPNC or run vpnc's script, the phone reboot.
I think the procesure of setup tunnel cause phone crash.
I can't find the solution to resolve.

[Q] VPN tunnel crash the phone

Hi, guys
I have a Samsung i9008 which is specific for China Mobile 3G TD-SCDMA.
OS: OMS 2.0 (from Android 2.1?)
Kernel version: 2.6.29-zeus1
I have download Samsung i9008 resource code and compiled a tun.ko file.
Installed successfully without any errors (insmod).
# insmod /system/tun.ko
insmod: setup_module '/system/tun.ko'
# dmesg | grep tun
<6>[ 7.047790] IPv4 over IPv4 tunneling driver
<6>[ 7.066741] IPv6 over IPv4 tunneling driver
<6>[ 174.259918] tun: Universal TUN/TAP device driver, 1.6
<6>[ 174.266601] tun: (C) 1999-2004 Max Krasnyansky <[email protected]>
# lsmod
tun 11036 0 - Live 0xbf283000
g_serial_softmodem 18504 0 - Live 0xbf279000
tiwlan_drv 823192 0 - Live 0xbf1ab000
omaplfb 16584 0 - Live 0xbf1a1000
pvrsrvkm 149188 43 omaplfb, Live 0xbf177000
modem_relay 71096 0 - Live 0xbf160000
vibrator 4104 0 - Live 0xbf159000
gsd4t 6900 0 - Live 0xbf152000
accel 18012 1 - Live 0xbf148000
PL_sensor 20276 0 - Live 0xbf13e000
compass 16848 1 - Live 0xbf134000
samsung_battery 24823 0 - Live 0xbf128000
dpram_flashless 183768 4 - Live 0xbf0f6000
param 17376 0 - Live 0xbf0ef000
rfs_fat 233792 6 - Live 0xbf0b0000 (P)
rfs_glue 75052 1 rfs_fat, Live 0xbf098000 (P)
fsr_stl 250268 6 - Live 0xbf055000 (P)
fsr 324408 4 dpram_flashless,param,fsr_stl, Live 0xbf000000 (P)
I have installed BusyBox and VPNC. I have tried many version of BusyBox.
But when I connect in VPNC or run vpnc's script, the phone reboot.
I think the procesure of setup tunnel cause phone crash.
I changed some parameters in .config and re-compiled tun.ko. The phone reboot as before.
I can't find the solution to resolve.

USB tethering and WIFI tethering problems

I have a desktop PC without wireless nic, so I connect my mobile phone XiaoMi Redmi4 prime to PC via usb cable enabling USB tethering .
I have a ipad, and I want to transfer some video from PC to ipad via WIFI, so I enabled wifi tethering on Redmi4. But I just can ping ipad from PC.
IP:
Redmi4 - 192.168.42.129 / 192.168.43.1
PC - 192.168.42.241
iPad - 192.168.43.14
I have the root shell access on Redmi4, here is route table in Redmi4 :
[email protected]:/ # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.177.95.72 * 255.255.255.248 U 0 0 0 rmnet_data0
192.168.42.0 * 255.255.255.0 U 0 0 0 rndis0
192.168.43.0 * 255.255.255.0 U 0 0 0 wlan0
I tried to add static route on Redmi4 as default gateway, but still not working.
I also tried to clear all iptables rules by typing : iptables -F, still not working.
So anyone who knows how to fix this?
Any one who can help me ?

Categories

Resources