No Firewall with 3G? - Galaxy Tab 3 Q&A, Help & Troubleshooting

Hi, i have a SM-T211 (Tab3 7.0 3G) and I cant set any working firewall for 2G/3G. All these firewalls (Avast, Droidwall, Android Firewall) work perfectly with WLAN/Wifi but dont react on 3G/2G. All Rules in Iptables (and Ip6tables) are inserted correctly, but they seem not to work....
Has anyone a working firewall set (for 3G) with this Tablet? Could anyone with this tablet test if he has the same behaviour? Many thanks!

Interesting. I had been using Droidwall and was under the impression it was working. But I just unchecked Dolphin, and it turns out it isn't working.
I am also interested in this one. I would love to block Google Services Framework from detecting my internet connection.
I haven't tested on wi-fi.

thref23 said:
Interesting. I had been using Droidwall and was under the impression it was working. But I just unchecked Dolphin, and it turns out it isn't working.
I am also interested in this one. I would love to block Google Services Framework from detecting my internet connection.
I haven't tested on wi-fi.
Click to expand...
Click to collapse
I found out, that the interface-name of the common scripts does not match. So these Apps insert lines in "iptables" and "ip6tables", but they insert Lines with targets depending on interface-name. Seems our Interface-name (for 3G) is different, so no matching rule for 3G found. Same with Wifi works correctly.
So we have to find out Interface-name for 3g for iptables, after that our firewalls would be working...

OK found it, the interface-name is "ccinet0". This interface isnt used in scripts from Android Firewall or Avast or others.
Two Options so far:
1. You have to modify their scripts and add (u should find the right position for inserting) the following lines (xxx stands for your name of firewall):
iptables -A xxxwall -o ccinet+ -j xxxwall-3g
ip6tables -A xxxwall -o ccinet+ -j xxxwall-3g
2. You use an Script like the following (at the moment manually, may be automatic by a script-system):
#!/system/bin/sh
# Avast Rules extended
iptables -N cvtwall
iptables -D OUTPUT -j cvtwall
iptables -A OUTPUT -j cvtwall
iptables -N avastwall-3g
ip6tables -N cvtwall
ip6tables -D OUTPUT -j cvtwall
ip6tables -A OUTPUT -j cvtwall
ip6tables -N avastwall-3g
iptables -A cvtwall -o ccinet+ -j avastwall-3g
ip6tables -A cvtwall -o ccinet+ -j avastwall-3g
You will have to modify the names in Bold to your specific Firewall-Names...
You can also use it as init.d script, if u have a kernel with init.d Support...

Related

[INFO] OpenVPN (tun.ko) for LG Tmobile Gslate

I just compiled a tun.ko and got OpenVPN working on the Tmobile Gslate! so I thought I would share:
1- Rooted (thanks to Chandon)
http://forum.xda-developers.com/showthread.php?t=1065882
2- Install tun.ko (Attached below)
download and unzip
Code:
adb remount
adb push tun.ko /system/lib/modules
adb shell
chmod 755 /system/lib/modules/tun.ko
Note: This tun module was built for kernel 2.6.36.3+
3- Install BusyBox using BusyBox Installer (from Market)
Install to /system/xbin
4- Install OpenVPN using OpenVPN Installer (from Market)
Install binary to /system/xbin
Install route to /system/xbin/bb
5- Install OpenVPN Settings (from Market)
6- Install OpenVPN static binary:
Download Static openvpn
Un-bz2 the file (7-Zip on Windows | bunzip2 on linux)
Code:
adb remount
adb push openvpn-static /system/xbin/openvpn
adb shell
chmod 555 /system/xbin/openvpn
7- Link Busybox ifconfig and route to /system/xbin/bb
Code:
adb shell
su
mkdir /system/xbin/bb
ln -s /system/xbin/ifconfig /system/xbin/bb/ifconfig
ln -s /system/xbin/route /system/xbin/bb/route
8- Setup OpenVPN Settings (from Market)
OpenVPN settings > Advanced > Load tun kernel module <- turn ON
OpenVPN settings > Advanced > TUN module settings
Load module using - insmod
Path to tun module - /system/lib/modules/tun.ko
9- copy your .conf files to /sdcard/openvpn
REBOOT
CONNECT!~
Extra for SMB mounters : Cifs.ko ! - Attached!
Edit: June 5 '11 - Extra for Asian users : nls_utf8.ko - Attached!
Well, I'm able to connect to my OpenVPN server now, but there must be something different in the binary..."client.conf: Connected" keeps spamming the notification area. Are you having this problem?
On a related note - I've got a couple other options, if I can get my cross-compiling tools set up correctly...I could use SonicWALL's NetExtender app, but that needs ppp_async and ppp_synctty built. I also wanted to be able to talk to a Windows-friendly PoPToP VPN server, but I suspect I'd need the ppp_mppe.ko built for that.
I tried compiling the whole kernel with the options I've mentioned, but I don't think I did it right...the make went all the way through, but I was using the gcc 4.4.3 eabi set in the SDK/NDK toolset. Since then, I've been trying to set things up according notes I found at K's Cluttered loft ( at triple-w dot (noob html limitation workaround) ailis.de/~k/archives/19-ARM-cross-compiling-howto dot HyperText Markup Language ) but start encountering problems when I try to build glibc...do you know of any instructions/tutorials which might help to educate this n00b (aye, that be me) in the fine art of ARM cross compiling?
bealesbane said:
Well, I'm able to connect to my OpenVPN server now, but there must be something different in the binary..."client.conf: Connected" keeps spamming the notification area. Are you having this problem?
On a related note - I've got a couple other options, if I can get my cross-compiling tools set up correctly...I could use SonicWALL's NetExtender app, but that needs ppp_async and ppp_synctty built. I also wanted to be able to talk to a Windows-friendly PoPToP VPN server, but I suspect I'd need the ppp_mppe.ko built for that.
I tried compiling the whole kernel with the options I've mentioned, but I don't think I did it right...the make went all the way through, but I was using the gcc 4.4.3 eabi set in the SDK/NDK toolset. Since then, I've been trying to set things up according notes I found at K's Cluttered loft ( at triple-w dot (noob html limitation workaround) ailis.de/~k/archives/19-ARM-cross-compiling-howto dot HyperText Markup Language ) but start encountering problems when I try to build glibc...do you know of any instructions/tutorials which might help to educate this n00b (aye, that be me) in the fine art of ARM cross compiling?
Click to expand...
Click to collapse
Yeah I have that spamming problem too .. always have with the honeycomb tablets.
I used 4.4.0 eabi, and had to hard code the localversion in the setlocalversion file and absolute path to the eabi modules in the makefile to get it to cross compile
I built and attached the ppp_async.ko , ppp_synctty.ko , ppp_mppe.ko for you (I did not test a insmod as I built and tested the cifs and tun on a friends tablet - do let me know if these work!)
That's great! Thanks for putting those together. All of the modules you created insert fine with insmod (this version of busybox still has an issue with modprobe running on this tablet, suspect may be related to self-referring parameter, but hope to experiment more later) with the exception of mppe. That one comes back with "insmod: init_module '/system/lib/modules/ppp_mppe.ko' failed (File exists)".
This, however, may not be due to the module itself, strictly speaking. The other two, which are presented by SonicWALL as a workaround to their proprietary VPN app, inserted fine, but still produce an I/O error when a connection is attempted...closer inspection of the app's log reveals a similar complaint under the hood:
06-01 08:01:36.848 I/NetExtender.ppp( 8207): Nxhelper: start pppd main routine
06-01 08:01:36.858 D/NetExtender.ppp( 8207): using channel 1
06-01 08:01:36.858 E/NetExtender.ppp( 8207): Couldn't create new ppp unit: File exists
06-01 08:01:36.858 I/NetExtender.ppp( 8207): Nxhelper: pppd hung up, notify the service
My off the wall guess, pending further investigation, is that inserting mppe, or trying to initialize the other two, results in an attempt to create a device handle which is not being properly enumerated? ( i.e., attempting to create an instance of /dev/ppp, which already exists, instead of a new handle, say, /dev/ppp0, ppp1, etc.) Again, just theorizing blindly at this point - but you've certainly given me a great deal to work with, and I say thank ya big big.
I'll update you with any progress I make here, but at least for the time being I still have basic connectivity to one of my networks, and I can do much with that. And the cifs module works a treat as well!
In the meantime, a simple script allows me to toggle the VPN on and off without being annoyed by the spamming...then I add a widget to the script using ScriptManager (from the market) and viola! Look ma, no hands!
Code:
#!/system/bin/sh
BB="/system/xbin/busybox"
VPN="/system/xbin/openvpn"
TUNDTL=`$BB ifconfig tun0 2>&1`
RESULT=$?
if [ $((RESULT)) -eq 1 ]; then
$VPN --config /mnt/sdcard/openvpn/client.conf --daemon MYVPN
else
VPNPID=`ps openvpn | grep "^root"`
VPNPID=`echo $VPNPID | cut -d" " -f2`
if [ $((VPNPID)) -gt 99 ]; then
$BB kill -KILL $VPNPID
fi
fi
exit
(Just for anyone who doesn't want to wait until OpenVPN Settings gets a bugfix for Honeycomb. Obviously, adjust locations as needed. Oh, and don't give the script a name that starts with "openvpn"...unless you WANT a kamikaze script. This simple script obviously wouldn't work for multiple tunnels, (if they're even supported), but it does ya fine for the basic config.)
awesome idea for the spamming .. sadly I have 8 openVPN servers I switch between so i have to put up with the spamming.. any idea what the reason of the spamming is? maybe contact the dev?
The source for the app is available at 'code.google.com/p/android-openvpn-settings'. The issue has been reported already by a few people (issue 70), but it looks like there are quite a few other issues reported, so no telling if or when Mr. Schäuffelhut will have a chance to review it. It seems like it would be a good starter project for a would-be contributor...I haven't done any java developing, but it seems like it would be easier to isolate our issue and tweak it than bloat my simple script to allow multiple PIDs to be tracked and toggled...though the latter is certainly possible, and after I get my second OpenVPN server online (Audiogalaxy offline for better part of day yesterday, need to make myself independent of that), if the Java is too daunting I just may do so. So many tempting projects, so little time.
Simple VPN handler script to tide us over until 0.4.8 or more in OpenVPN-Settings
Ok, since you were so kind as to compile those extra modules for me, I figure the least I can do is give you something in return. Here's a simple VPN handler to manage multiple tunnels. Filenames for config files are entered relative to the CFGS folder, and module load/remove is manual rather than auto...and I put in connection sharing, as I'm using it this way...but it'll certainly let you use as many tunnels as the kernel will let you work with.
As always, the standard, 'you take your life into your own hands if you use this code, not responsible for problems up to and including user death' disclaimer applies. It seems to be working for me, though I'm only using 2 VPN's ATM.
Good luck! (Will still let you know if I make any progress in Java Dev)
Code:
[email protected]: /data/local/bin > cat ./vpnhandler
#!/system/bin/sh
export BB="/system/xbin/busybox"
export VPN="/system/xbin/openvpn"
export MODS="/system/lib/modules"
export CFGS="/mnt/sdcard/openvpn"
export SPACES=" "
LOOPBACK=0
while [ $((LOOPBACK)) -eq 0 ]; do
LOOPBACK=1
CIFMOD=`$BB lsmod | grep -c "^cifs"`
if [ $((CIFMOD)) -eq 0 ]; then CIFMOD="Load"; else CIFMOD="Remove"; fi
TUNMOD=`$BB lsmod | grep -c "^tun"`
if [ $((TUNMOD)) -eq 0 ]; then TUNMOD="Load"; else TUNMOD="Remove"; fi
clear
echo "Simple VPN Handler"
echo "=================="
echo
echo "ACT # Tunnel Name Configuration File "
echo "--- --- -------------------- ------------------------------"
while read vpndefs; do
TUNNO=`echo "${vpndefs}" | cut -d"~" -f1`
TUNNAME=`echo "${vpndefs}" | cut -d"~" -f2`
TUNCFG=`echo "${vpndefs}" | cut -d"~" -f3`
TUNSTAT=`$BB ps w | grep openvpn | grep -c "\-\-daemon ${TUNNAME}\$"`
if [ $((TUNSTAT)) -eq 1 ]; then TUNSTAT="*"; else TUNSTAT=" "; fi
DISPLINE=" ${TUNSTAT} ${SPACES:0:$((3-${#TUNNO}))}${TUNNO} ${TUNNAME}${SPACES:0:$((22-${#TUNNAME}))}${TUNCFG}"
echo "${DISPLINE}"
done < "${CFGS}/cfglist"
echo
echo "_______________________________________________________________"
echo
echo " A - Add a new tunnel definition"
echo " D - Delete an existing tunnel "
echo " C - ${CIFMOD} CIFS Module "
echo " T - ${TUNMOD} TUN Module "
echo " S - Share tap0 to eth0 traffic "
echo " X - Break traffic forwarding "
echo " Q - Quit "
echo
echo -n " Select action, or a tunnel number to toggle on or off : "
read actkey
if [ "$actkey" = "C" -o "$actkey" = "c" ]; then
LOOPBACK=0
if [ "$CIFMOD" = "Load" ]; then
LOADMOD=`$BB insmod ${MODS}/cifs.ko 2>&1`
else LOADMOD=`/system/bin/toolbox rmmod cifs.ko 2>&1`
fi
fi
if [ "$actkey" = "T" -o "$actkey" = "t" ]; then
LOOPBACK=0
if [ "$TUNMOD" = "Load" ]; then
LOADMOD=`$BB insmod ${MODS}/tun.ko 2>&1`
else LOADMOD=`/system/bin/toolbox rmmod tun.ko 2>&1`
fi
fi
if [ "$actkey" = "S" -o "$actkey" = "s" ]; then
LOOPBACK=0
iptables -F; iptables -t nat -F; iptables -X; iptables -t nat -X
echo 1 | tee /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o tap0 -j MASQUERADE
iptables -A FORWARD -i eth0 -j ACCEPT
fi
if [ "$actkey" = "X" -o "$actkey" = "x" ]; then
LOOPBACK=0
iptables -F; iptables -t nat -F; iptables -X; iptables -t nat -X
echo 0 | tee /proc/sys/net/ipv4/ip_forward
fi
if [ "$actkey" = "A" -o "$actkey" = "a" ]; then
LOOPBACK=0
echo; echo -n " Enter tunnel number to assign : "; read TUNNO
TUNCHK=`cat "${CFGS}/cfglist" | grep -c "^${TUNNO}~"`
if [ $((TUNCHK)) -eq 0 ]; then
echo; echo -n " Enter a name for the tunnel : "; read TUNNAME
echo; echo -n " Enter filepath/name for config file (relative to ${CFGS}) : "; read TUNCFG
echo "${TUNNO}~${TUNNAME}~${TUNCFG}" >> "${CFGS}/cfglist"
else echo -n " That number is already in use. "; read TUNNO
fi
fi
if [ "$actkey" = "D" -o "$actkey" = "d" ]; then
LOOPBACK=0
echo; echo -n " Enter tunnel number to delete : "; read TUNNO
TUNCHK=`cat "${CFGS}/cfglist" | grep -c "^${TUNNO}~"`
if [ $((TUNCHK)) -eq 0 ]; then
echo -n " That number is not currently in use. "; read TUNNO
else vpndefs=`cat "${CFGS}/cfglist" | grep "^${TUNNO}~"`
TUNNAME=`echo "${vpndefs}" | cut -d"~" -f2`
TUNSTAT=`$BB ps w | grep openvpn | grep -c "\-\-daemon ${TUNNAME}\$"`
if [ $((TUNSTAT)) -gt 0 ]; then
echo; echo -n " Tunnel is active. Turn off before deleting."; read TUNNO
else RESULT=`cat "${CFGS}/cfglist" | egrep -v "^${TUNNO}~" > "${CFGS}/cfglist.tmp"`
$BB mv -f "${CFGS}/cfglist.tmp" "${CFGS}/cfglist"
fi
fi
fi
if [ "$actkey" = "Q" -o "$actkey" = "q" ]; then LOOPBACK=0; fi
if [ $((LOOPBACK)) -eq 1 ]; then
TUNCHK=`cat "${CFGS}/cfglist" | grep -c "^${actkey}~"`
LOOPBACK=0
if [ $((TUNCHK)) -eq 0 ]; then
echo -n " That number is not currently in use. "; read TUNNO
else TUNNO="${actkey}"
vpndefs=`cat "${CFGS}/cfglist" | grep "^${TUNNO}~"`
TUNNAME=`echo "${vpndefs}" | cut -d"~" -f2`
TUNCFG=`echo "${vpndefs}" | cut -d"~" -f3`
TUNSTAT=`$BB ps w | grep openvpn | grep -c "\-\-daemon ${TUNNAME}\$"`
if [ $((TUNSTAT)) -gt 0 ]; then
VPNPID=`$BB ps w | grep openvpn | grep "\-\-daemon ${TUNNAME}"`
VPNPID=`echo $VPNPID | cut -d" " -f1`
if [ $((VPNPID)) -gt 99 ]; then
RESULT=`$BB kill -KILL $VPNPID`
fi
else RESULT=`$VPN --config "${CFGS}/${TUNCFG}" --daemon "${TUNNAME}"`
fi
fi
fi
if [ "$actkey" = "Q" -o "$actkey" = "q" ]; then LOOPBACK=1; fi
done
exit
Note: It'll throw out some screen errors if you don't have a zero length file in $CFGS/cfglist, but it'll let you add your first tunnel anyway. (Didn't bother to trap for that.)
Oh, and ScriptManager doesn't seem to like digging for scripts in /data/local/bin, but doesn't appear to have a problem executing things in /mnt/sdcard, even though I don't seem to be able to set the execute bit on any file in that fs. There's reference in Google of known glitch in some kernels that cause fs' mounted with the 'default_permissions,allow_other' flags to behave strangely. If they ever fix that, you may need to relocate, that's all.
Note also that the "ACT" column which denotes 'active' tunnels with an '*' only verifies that there is a process running with the designated label name. At this time, actual connectivity is left to you to determine.
it's very helpful, thanks very much!!
but could you compile nls_utf8.ko too? please
You should try and come up with a working recovery!
Sent from my LG-V909 using XDA Premium App
bealesbane said:
Ok, since you were so kind as to compile those extra modules for me, I figure the least I can do is give you something in return. Here's a simple VPN handler to manage multiple tunnels. Filenames for config files are entered relative to the CFGS folder, and module load/remove is manual rather than auto...and I put in connection sharing, as I'm using it this way...but it'll certainly let you use as many tunnels as the kernel will let you work with.
As always, the standard, 'you take your life into your own hands if you use this code, not responsible for problems up to and including user death' disclaimer applies. It seems to be working for me, though I'm only using 2 VPN's ATM.
Good luck! (Will still let you know if I make any progress in Java Dev....
Click to expand...
Click to collapse
Bealsbane way to go man, that is far more code than I could figure out! now i feel like i owe you a beer! haha .. I tried the code but it helps to have a gui currently .. i although do have alot of Java experience and possibly you and I could get a new OpenVPN Settings/Installer for gingerbread/honeycomb based devices!
once again thanks!
aureole999 said:
it's very helpful, thanks very much!!
but could you compile nls_utf8.ko too? please
Click to expand...
Click to collapse
Added to the first Post .. please test it and let me know if it works! good luck!
edit: tested by aureole999 and confirmed working
Excellent work ru1dev. I just added this thread to the G-Slate XDA bit.ly bundle. Would you mind if I posted a link to it over on G-SlateFans?
Bling_Diggity said:
Excellent work ru1dev. I just added this thread to the G-Slate XDA bit.ly bundle. Would you mind if I posted a link to it over on G-SlateFans?
Click to expand...
Click to collapse
Go ahead as long as it is a link back to the OP. Thanks for spreading the knowledge
please dont bash me as i know im a little off topic but hi everyone i have a major issue with my rooted gslate.if anyone can help it would be greatly appreciated. i downloaded cw from the market and when it askes you for compatibility i accedently chose the option (lg optimus 3d) thinking it was for my gslate and now after i turned off the gslate and go to turn it back on its stuck on LG blackscreen and says
[HasValidKernelImage] Magic value mismatch:
[DetectOperatingSystems]kernel image is invalid !!!
Starting Fastboot USB download protocol
Ive looked all over the internet and cant find anything to help me out so please can someone help me.
maybe a way to nvflash the proper kernel back.
tun.ko checksum
Hi guys, can anybody please post the md5sum output of the tun.ko? even though im using the same kernel, i cannot load the module on my g-slate. thanks
jomnoc said:
Hi guys, can anybody please post the md5sum output of the tun.ko? even though im using the same kernel, i cannot load the module on my g-slate. thanks
Click to expand...
Click to collapse
md5 - 3daf2d134dc2ae6c4a40fe3d8ac49344
Thanks! I have 6707fd6a79cc849d13e8dd4016f96028 .... ideas? can you upload your file? Thanks again
jomnoc said:
Thanks! I have 6707fd6a79cc849d13e8dd4016f96028 .... ideas? can you upload your file? Thanks again
Click to expand...
Click to collapse
yes that is the md5 for the tun.ko .. in a rush i gave you the md5 for the zip of the tun.ko previously. are you sure you are running kernel 2.6.36.3+
it has to be exactly that kernel..with the '+' on the end
yes i am. or i was haha.. it was a friend's tablet. but it certainly had that kernel version. thanks for the help. if i get it again i may ask for help

[HOWTO] USB/RNDIS Tethering (root required)

First, let me apologize if solutions to this problem have already been posted on this forum and elsewhere. I developed this solution completely independently, and I am sharing it here in hopes that it may prove useful to someone else.
This pair of scripts will allow you to share your phone's Internet connection with a computer via a USB cable. It definitely works when the computer is running Linux (assuming you have RNDIS support in your kernel), and it should work as well when the computer is running Windows. However, it will not work with Mac, as OS X does not have an RNDIS driver.
First, upload these two scripts to your /sdcard:
/sdcard/usb_tether_start.sh:
Code:
#!/system/bin/sh
prevconfig=$(getprop sys.usb.config)
if [ "${prevconfig}" != "${prevconfig#rndis}" ] ; then
echo 'Is tethering already active?' >&2
exit 1
fi
echo "${prevconfig}" > /cache/usb_tether_prevconfig
setprop sys.usb.config 'rndis,adb'
until [ "$(getprop sys.usb.state)" = 'rndis,adb' ] ; do sleep 1 ; done
ip rule add from all lookup main
ip addr flush dev rndis0
ip addr add 192.168.2.1/24 dev rndis0
ip link set rndis0 up
iptables -t nat -I POSTROUTING 1 -o rmnet0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
dnsmasq --pid-file=/cache/usb_tether_dnsmasq.pid --interface=rndis0 --bind-interfaces --bogus-priv --filterwin2k --no-resolv --domain-needed --server=8.8.8.8 --server=8.8.4.4 --cache-size=1000 --dhcp-range=192.168.2.2,192.168.2.254,255.255.255.0,192.168.2.255 --dhcp-lease-max=253 --dhcp-authoritative --dhcp-leasefile=/cache/usb_tether_dnsmasq.leases < /dev/null
/sdcard/usb_tether_stop.sh:
Code:
#!/system/bin/sh
if [ ! -f /cache/usb_tether_prevconfig ] ; then
echo '/cache/usb_tether_prevconfig not found. Is tethering really active?' >&2
exit 1
fi
if [ -f /cache/usb_tether_dnsmasq.pid ] ; then
kill "$(cat /cache/usb_tether_dnsmasq.pid)"
rm /cache/usb_tether_dnsmasq.pid
fi
echo 0 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -D POSTROUTING 1
ip link set rndis0 down
ip addr flush dev rndis0
ip rule del from all lookup main
setprop sys.usb.config "$(cat /cache/usb_tether_prevconfig)"
rm /cache/usb_tether_prevconfig
while [ "$(getprop sys.usb.state)" = 'rndis,adb' ] ; do sleep 1 ; done
To start USB tethering:
Code:
adb shell "su -c 'sh /sdcard/usb_tether_start.sh'"
Grant the superuser request on the phone if one appears.
If you're on Linux, you'll see a new network interface appear (probably called "usb0"). Bring the link up on that interface (ip link set usb0 up), run a DHCP client, and you're all set!
If you're on Windows, it will probably Just Work™.
To stop USB tethering:
Code:
adb shell "su -c 'sh /sdcard/usb_tether_stop.sh'"
Again, grant the superuser request on the phone if one appears.
That's it!
OMG !!!!
You rock ! This solution is the FIRST one which works on my international i9300 device (not a 'Sprint' version) with cm10.1.
I can't understand why ... but i'll keep your script on my ext SDCard.
I'll prupose this script to french cm10.1 users.
Thank you!
OS X does not have an RNDIS driver? really?
...OS X does not have an RNDIS driver...
Click to expand...
Click to collapse
Please have a look at HoRNDIS: USB tethering driver for Mac OSX (it even supports modern/recent OSX versions!) @ hxxp://joshuawise.com/horndis (unable to embed inline URL link due to new user restriction)
whitslack said:
First, let me apologize if solutions to this problem have already been posted on this forum and elsewhere. I developed this solution completely independently, and I am sharing it here in hopes that it may prove useful to someone else.
This pair of scripts will allow you to share your phone's Internet connection with a computer via a USB cable. It definitely works when the computer is running Linux (assuming you have RNDIS support in your kernel), and it should work as well when the computer is running Windows. However, it will not work with Mac, as OS X does not have an RNDIS driver.
First, upload these two scripts to your /sdcard:
/sdcard/usb_tether_start.sh:
Code:
#!/system/bin/sh
prevconfig=$(getprop sys.usb.config)
if [ "${prevconfig}" != "${prevconfig#rndis}" ] ; then
echo 'Is tethering already active?' >&2
exit 1
fi
echo "${prevconfig}" > /cache/usb_tether_prevconfig
setprop sys.usb.config 'rndis,adb'
until [ "$(getprop sys.usb.state)" = 'rndis,adb' ] ; do sleep 1 ; done
ip rule add from all lookup main
ip addr flush dev rndis0
ip addr add 192.168.2.1/24 dev rndis0
ip link set rndis0 up
iptables -t nat -I POSTROUTING 1 -o rmnet0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
dnsmasq --pid-file=/cache/usb_tether_dnsmasq.pid --interface=rndis0 --bind-interfaces --bogus-priv --filterwin2k --no-resolv --domain-needed --server=8.8.8.8 --server=8.8.4.4 --cache-size=1000 --dhcp-range=192.168.2.2,192.168.2.254,255.255.255.0,192.168.2.255 --dhcp-lease-max=253 --dhcp-authoritative --dhcp-leasefile=/cache/usb_tether_dnsmasq.leases < /dev/null
/sdcard/usb_tether_stop.sh:
Code:
#!/system/bin/sh
if [ ! -f /cache/usb_tether_prevconfig ] ; then
echo '/cache/usb_tether_prevconfig not found. Is tethering really active?' >&2
exit 1
fi
if [ -f /cache/usb_tether_dnsmasq.pid ] ; then
kill "$(cat /cache/usb_tether_dnsmasq.pid)"
rm /cache/usb_tether_dnsmasq.pid
fi
echo 0 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -D POSTROUTING 1
ip link set rndis0 down
ip addr flush dev rndis0
ip rule del from all lookup main
setprop sys.usb.config "$(cat /cache/usb_tether_prevconfig)"
rm /cache/usb_tether_prevconfig
while [ "$(getprop sys.usb.state)" = 'rndis,adb' ] ; do sleep 1 ; done
To start USB tethering:
Code:
adb shell "su -c 'sh /sdcard/usb_tether_start.sh'"
Grant the superuser request on the phone if one appears.
If you're on Linux, you'll see a new network interface appear (probably called "usb0"). Bring the link up on that interface (ip link set usb0 up), run a DHCP client, and you're all set!
If you're on Windows, it will probably Just Work™.
To stop USB tethering:
Code:
adb shell "su -c 'sh /sdcard/usb_tether_stop.sh'"
Again, grant the superuser request on the phone if one appears.
That's it!
Click to expand...
Click to collapse
what is the difference between this and native tethering?
for rooted stock roms
http://forum.xda-developers.com/showthread.php?t=2224083
this is the by far the easiest..

[Q] Developer Help Needed for 4G Wifi Tethering on 4.2.2 AOSP ROMs

I saw this code and it mentions that it fixes 4G Wimax tethering but I'm not sure if it will work on the Epic 4G Touch 4.2.2 AOSP ROMs
iptables -A bw_FORWARD -i !lo+
iptables -A natctrl_FORWARD -j RETURN -i rmnet+ -o wlan0 -m state --state RELATED,ESTABLISHED
iptables -A natctrl_FORWARD -j DROP -i wlan0 -o rmnet+ -m state --state INVALID
iptables -A natctrl_FORWARD -j RETURN -i wlan0 -o rmnet+
iptables -A natctrl_FORWARD -j DROP
iptables -A natctrl_nat_POSTROUTING -t nat -o rmnet+ -j MASQUERADE
I saw the code here https://jira.cyanogenmod.org/browse/CYAN-544
Wondering if it's possible to make a flashable zip to fix our 4G Wimax Wifi Tethering Woes on 4.2.2 ROMs?

cm12.1-20151109-NIGHTLY-nicki: can't change ttl

hello,
I have installed CM 12.1-20151109-NIGHTLY-nicki, enabled root but can't change ttl value. Is netfilter module missing in kernel?
[email protected]:/ # grep ^ro.cm.version /system/build.prop
ro.cm.version=12.1-20151109-NIGHTLY-nicki
error example:
[email protected]:/ # iptables -t mangle -I POSTROUTING -j TTL --ttl-set 65
iptables: No chain/target/match by that name.
how to add/install the module to the android system to be able modify TTL values?
[email protected]:/ # iptables -t mangle --list|grep -i ttl
1|[email protected]:/ #
It seems to be not avaialble in the CM12.1
when I checked it on my asus zeonfon2 runing on stock Android 5.0, the module is there and I can modify TTLs.
[email protected]:/ # iptables -t mangle --list|grep -i ttl
TTL all -- anywhere anywhere TTL set to 65
TTL all -- anywhere anywhere TTL set to 65
TTL all -- anywhere anywhere TTL set to 65

Fix DNS issue (internet access) on NSTV Pro 2019 [Magisk]

Hello my friends!
*** You should have ROOT access ***
*** This steps is not contains details so is not for newbies ***
1- Install AFWall (https://github.com/ukanth/afwall)
2- Install dnscrypt-proxy for Android (https://github.com/adit/dnscrypt-proxy)
3- Install NTP & GPS Clock [ROOT] (https://play.google.com/store/apps/details?id=jp.xrea.poca.clocksync&hl=en&gl=US)
4- Run AfWall and:
write thiscustom script:
HTML:
iptables -t nat -A OUTPUT -p tcp ! -d 8.8.8.8 --dport 53 -j DNAT --to-destination 127.0.0.1:5354
iptables -t nat -A OUTPUT -p udp ! -d 8.8.8.8 --dport 53 -j DNAT --to-destination 127.0.0.1:5354
iptables -t nat -A OUTPUT -p tcp ! -d 8.8.8.8 --dport 853 -j DNAT --to-destination 127.0.0.1:5354
iptables -t nat -A OUTPUT -p udp ! -d 8.8.8.8 --dport 853 -j DNAT --to-destination 127.0.0.1:5354
and this shutdown script
HTML:
iptables -t nat -D OUTPUT -p tcp ! -d 8.8.8.8 --dport 53 -j DNAT --to-destination 127.0.0.1:5354
iptables -t nat -D OUTPUT -p udp ! -d 8.8.8.8 --dport 53 -j DNAT --to-destination 127.0.0.1:5354
iptables -t nat -D OUTPUT -p tcp ! -d 8.8.8.8 --dport 853 -j DNAT --to-destination 127.0.0.1:5354
iptables -t nat -D OUTPUT -p udp ! -d 8.8.8.8 --dport 853 -j DNAT --to-destination 127.0.0.1:5354
5- Run AFWall and make sure all apps has access to Internet and start Firewall.
6- Turn Off Automatic Date&Time from settings.
7- Run "NTP & GPS Clock" app Sync device Date&Time. (try ntp-server: 132.163.97.5 or 132.163.96.5 or 129.6.15.32)
HTML:
#dcp stop
#dcp disable
#dcp start
8- Done! all DNS request redirect to dnscrypt-proxy (Magisk-Module)
Note: You can play around more with AfWall and dnscrypt to gain much more security.

Categories

Resources