Related
Help!!
I just insalled the latest xubuntu on one of my pcs (gutsy gibbon)
trying to get it to connect to the internet thru my uni's wmodem app by usb.
ran
sudo -i
modprobe usbserial vendor=0xbb4 product=0x0cf
already did mkdev for ttyUSB0
dmesg shows device connected to ttyUSB0
echo "ATDT*99#" > /dev/ttyUSB0
causes connection light to go on in wmodem app on uni
but...
when I run wvdialconf I get:
ttyUSB0<*1> ATQ0 V1 E1 .. failed with 2400 baud, next try;9600 baud
ttyUSB0<*1> ATQ0 V1 E1 .. failed with 9600 baud, next try;115200 baud
ttyUSB0<*1> ATQ0 V1 E1 .. failed with 2400 baud, giving up.
Sorry, no modem detected! Is it in use by another program?
Did you configure it properly with setserial?
what do I have 2 do?
oh yeah, tried making 'tmobile' in /etc/ppp/peers
contains:
----
hide-password
noauth
connect "usr/sbin/chat -v -f /etc/chatscripts/tmobile"
debug
ttyUSB0
115200
defaultroute
noipdefault
user "tmobile"
remotename tmobile
ipparam tmobile
usepeerdns
---
and in /etc/chatscripts/tmobile
---
# ispauth PAP
# abortstring
ABORT BUSY 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED
# modeminit
'' "ATDT*99#"
# ispnumber
# OK-AT-OK "ATDT*99#"
# ispconnect
CONNECT \d\c
# prelogin
# ispname
# isppassword
# postlogin
-----
with
----
"tmobile" * "one2one"
----
in my chap-secrets
then tried using
pon tmobile
but light does not come on
running plog gives
last 2 lines as
chat[4923]: send (ATDT*99#^m)
chat[4923]: expect (CONNECT)
please can someone help as I'm not a linux xpert and the only way I have of using the internet is thru my uni.
ps uni works fine with my gf's laptop under XP
Similar problems for me
I have tried a very similar config with my Vario II (Hermes) with no avail. I have this working fine in XP & Vista x32 & x64.
I am also running Ubuntu 7.10 Gutsy. It would be great if someone could help on this issue as I suspect many people are trying to do this at the minute.
Dz
ok, was just being a luser
for some reason u have to use 'modprobe ipaq' instead of 'modprobe usbserial' then it works
Yipeeeeeeeeeeeeeeeeeeeeeeee!!!!
Hey, wondering if it would be possible to share the internet connection via wifi from reverse tether?
PC > Android > Wifi Hotspot > Other Device
Basically my 3G internet plan doesn't include tethering so I'm looking for a way to get internet on other devices in the room via wifi...
Though the computer does not have a wifi card so wondering if it would be possible to use the android device as a wifi switch?
I can connect my device to the internet through the PC connection via ADB Reverse USB Tunnel.. But then can I then enable wifi tethering to use that connection to share across the wifi for other devices to connect to and then share the same PC connection?
If its not possible I'm sure I'd be able to install drivers for one of my USB wifi cards, not ideal but if its the only way then I guess I'd have to.
Cheers, Dave
I also scoured everywhere and only thing i found was an app that allowed phone to use computer internet but don't think it broadcasted like Wi-Fi to other devices. I'll look in my Google play and try to locate it.
*Shaolin Shadowboxing*
I have my phone using the PC connection okay, but was looking to then share that through the phone wifi.. but I guess that wouldn't work.
I have a USB wifi adapter that I can setup to share the connection.
DavidTiger said:
I have my phone using the PC connection okay, but was looking to then share that through the phone wifi.. but I guess that wouldn't work.
I have a USB wifi adapter that I can setup to share the connection.
Click to expand...
Click to collapse
How is the pc connected to the internet?
Still Charged Up
Yes. Search reverse tether in play store.
*Shaolin Shadowboxing*
Connected via cable, there's no other connections available hence I was using USB Tethering on my Android phone..
Since there's no wifi available I'm just looking for a way to share it to others and my iPod etc..
JediNinjafication said:
Yes. Search reverse tether in play store.
Click to expand...
Click to collapse
I have reverse tethering working fine, Looking to see if it would be possible to then share that via wifi from the device.
Though I guess that would just slow things down and strain the phone a bit. I'll just setup the USB WiFi Adapter to share the connection
FOund Anything
HEy am trying to share my reverse tethering connection with another android phone. i successfully connected the android phone pop with my pc internet connection using usb tunnel (Reverse tethering). now i need to use the hotspot function on this phone to share the reverse tethered connection with other phones. IS THAT POSSIBLE ???
Reverse USB Tethered Connection Sharing via wifi?
CypherDroid said:
HEy am trying to share my reverse tethering connection with another android phone. i successfully connected the android phone pop with my pc internet connection using usb tunnel (Reverse tethering). now i need to use the hotspot function on this phone to share the reverse tethered connection with other phones. IS THAT POSSIBLE ???
Click to expand...
Click to collapse
Hey anyone found something for this issue ???
Managed to share reverse-tethered viw wifi-HotSpot!
I have managed to do it (provide access to PC's internet through android's wifi-hotspot) with linux-PC & Cyanogen-11 (hence "rooted") on a GS4 (i9505) with the following script. I had to manually set DNS at the bottom.
Code:
## 0.a. Connect android-phone to PC through USB.
## 0.b Enable Settings|...|Tethering
## (so that the device gets detected by the PC's kernel, you should see the following with 'dmsg':
## [ 3.976599] rndis_host 1-1:1.0 usb0: register 'rndis_host' at usb-0000:00:0b.0-1, RNDIS device, 4e:d5:8c:7b:4f:5a
## Enable Settings|...|Wifi-Hotspot
## Setup usb reverse-tethering.
# from: [url]http://forum.xda-developers.com/showthread.php?t=2287494[/url]
#
# Yours device might be 'rndis0' or something else. Check by just typing 'netcfg'.
#
netcfg usb0 dhcp
busybox route add default gw 10.42.0.1 dev usb0
## Disable mobile-data.
#
busybox ifconfig rmnet_usb0 0.0.0.0
## Masquerade through USB.
#
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -F
iptables -t nat -A POSTROUTING -o usb0 -j MASQUERADE
iptables -P FORWARD ACCEPT
## Set DNS (if neccessary).
#
setprop net.dns1 XX.YY.ZZ.WW
ankostis said:
I have managed to do it (provide access to PC's internet through android's wifi-hotspot) with linux-PC & Cyanogen-11 (hence "rooted") on a GS4 (i9505) with the following script. I had to manually set DNS at the bottom.
Code:
## 0.a. Connect android-phone to PC through USB.
## 0.b Enable Settings|...|Tethering
## (so that the device gets detected by the PC's kernel, you should see the following with 'dmsg':
## [ 3.976599] rndis_host 1-1:1.0 usb0: register 'rndis_host' at usb-0000:00:0b.0-1, RNDIS device, 4e:d5:8c:7b:4f:5a
## Enable Settings|...|Wifi-Hotspot
## Setup usb reverse-tethering.
# from: [url]http://forum.xda-developers.com/showthread.php?t=2287494[/url]
#
# Yours device might be 'rndis0' or something else. Check by just typing 'netcfg'.
#
netcfg usb0 dhcp
busybox route add default gw 10.42.0.1 dev usb0
## Disable mobile-data.
#
busybox ifconfig rmnet_usb0 0.0.0.0
## Masquerade through USB.
#
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -F
iptables -t nat -A POSTROUTING -o usb0 -j MASQUERADE
iptables -P FORWARD ACCEPT
## Set DNS (if neccessary).
#
setprop net.dns1 XX.YY.ZZ.WW
Click to expand...
Click to collapse
I have been looking for something like for .. forever, I am truely amazed to have finally find something that hints that it was done
did you really get it to work properly?
I have rooted 2.3 and xp,
if I have busy box installed and I run these via ssh server on my droid, should it work for my setup as well with no changes?
I am really surprised nobody ever made an app that does that automatically, this stuff is so basic and actually super useful and needed!
A random question but have you tried the "Fox-fi" app? i haven't tried to do this myself, but it's a little more flexible than the build in options, it may give you what you are looking for. I've used fox-fi in the past for abnormal tethering, short of going out and buying a cheap USB WiFi adapter of course..
tytiger said:
A random question but have you tried the "Fox-fi" app? i haven't tried to do this myself, but it's a little more flexible than the build in options, it may give you what you are looking for. I've used fox-fi in the past for abnormal tethering, short of going out and buying a cheap USB WiFi adapter of course..
Click to expand...
Click to collapse
in case you asked that me,
my rom has a built in hotspot feature, so I don't need an app for that
I am AMAZED that there are countries in which you are charged extra if you waste your already-paid 3g traffic via another medium that is not particularly your android.
really, next thing you you, you will be charged for having a private phonebook that helps you remember numbers instead of clicking on digits every time you want to call someone, because the cell-supplier wants you to pay extra to use it's phonebook app...
as far as I know from testing FoxFi, its not capable of turning the android into a router, thus bridging the two networks together
and by two networks, I mean the network created by connecting the android via usb to the pc,
and connecting the android via hotspot wifi to another pc/laptop/w'e
ankostis said:
I have managed to do it (provide access to PC's internet through android's wifi-hotspot) with linux-PC & Cyanogen-11 (hence "rooted") on a GS4 (i9505) with the following script. I had to manually set DNS at the bottom.
Code:
## 0.a. Connect android-phone to PC through USB.
## 0.b Enable Settings|...|Tethering
## (so that the device gets detected by the PC's kernel, you should see the following with 'dmsg':
## [ 3.976599] rndis_host 1-1:1.0 usb0: register 'rndis_host' at usb-0000:00:0b.0-1, RNDIS device, 4e:d5:8c:7b:4f:5a
## Enable Settings|...|Wifi-Hotspot
## Setup usb reverse-tethering.
# from: [url]http://forum.xda-developers.com/showthread.php?t=2287494[/url]
#
# Yours device might be 'rndis0' or something else. Check by just typing 'netcfg'.
#
netcfg usb0 dhcp
busybox route add default gw 10.42.0.1 dev usb0
## Disable mobile-data.
#
busybox ifconfig rmnet_usb0 0.0.0.0
## Masquerade through USB.
#
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -F
iptables -t nat -A POSTROUTING -o usb0 -j MASQUERADE
iptables -P FORWARD ACCEPT
## Set DNS (if neccessary).
#
setprop net.dns1 XX.YY.ZZ.WW
Click to expand...
Click to collapse
did you really got the solution??
i tried it but it didnt work!!
plz post d whole procedure!!
plz plz plz....!!!!
thanks in advance
Siddhesh09 said:
did you really got the solution??
i tried it but it didnt work!!
plz post d whole procedure!!
plz plz plz....!!!!
thanks in advance
Click to expand...
Click to collapse
There's already a thread that goes into detail on this... See http://forum.xda-developers.com/showthread.php?t=2287494
Sent from my HTCONE using xda app-developers app
Doesn't work here with Galaxy S2 and samsung stock rooted rom. Will try later with Cyanogenmod.
ankostis said:
I have managed to do it (provide access to PC's internet through android's wifi-hotspot) with linux-PC & Cyanogen-11 (hence "rooted") on a GS4 (i9505) with the following script. I had to manually set DNS at the bottom.
Click to expand...
Click to collapse
Which device was it?
Didn't get it working here on cyanogemod 11 anyway, got reverse tethering as much. The op doesn't explain which commands are for the linux and which ones for the phone, and he's the only one that claims it works. A further explanation is necessary. Attachment is for clarification.
The ppp adapter in my case was rmnet0.
So, I modified it as:
## Disable mobile-data.
#
busybox ifconfig rmnet0 0.0.0.0
After following all the steps, I get internet connection on mozilla firefox on Android for a few seconds but then immediately firefox goes to offline mode. I am able to ping servers like facebook from terminal emulator and I am even able to get internet on default browser.
But I can neither get internet on Google Play apps nor get internet on my laptop to which I tethered my Android device using portable wifi hotspot.
What could be the possible issue here ?
---------- Post added at 06:14 PM ---------- Previous post was at 05:32 PM ----------
can you please explain the purpose of using -o flag in setting the NAT rule for masquerade ?
iptables -t nat -A POSTROUTING -o usb0 -j MASQUERADE
I am assuming that usb0 here is the adapter through which the Android device recieves data from the system (Ubuntu Desktop in my case).
So how does usb0 become the output interface ?
Our intention is to share the reverse tethered network via portable wifi hotspot. So we need to masquerade all traffic recieved by the device to the wifi adapter say wlan0.
So shouldn't it be :
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
Or is there any need to specify an output adapter, because
Initially we did set up reverse tethering from the Linux Desktop (the Linux Desktop without GUI case) and there,
we masqueraded packets recieved from ethernet adapter (ethernet connection from wired router) to the usb adapter (usb used for reverse tethering).
For that we did not specify any output adapter anywhere.
So would this be fine :
iptables -t nat -A POSTROUTING -j MASQUERADE
Having said these, I was not able to successfully reverse tether as I was getting reverse tethered data only on terminal emulator and default browser and not on Google Play apps. I have added details in another comment for that.
got it working for me!
reversed tethering worked for me by following the instructions and calling "netcfg usb0 dhcp".
However the WiFi tethering didnt work at first: Other Devices could connect to my phone but no data was forwarded...
The problem was that iptables was not setup properly...
Now I just connect my phone to the pc, enable usb tethering and wifi tethering and run the following:
Code:
adb devices
pause
adb shell netcfg usb0 dhcp
adb shell busybox ifconfig rmnet0 0.0.0.0
adb shell echo 1 > /proc/sys/net/ipv4/ip_forward
adb shell iptables --flush
adb shell iptables --delete-chain
adb shell iptables --table nat --delete-chain
adb shell iptables --table nat -F
adb shell iptables --table nat -X
adb shell iptables -t nat -A POSTROUTING -o usb0 -j MASQUERADE
adb shell iptables -P FORWARD ACCEPT
adb shell iptables -A FORWARD -i usb0 -o wlan0 -j ACCEPT -m state --state RELATED,ESTABLISHED
adb shell setprop net.dns1 8.8.8.8
Hope this helps
where did you posted the above codes ??
puit said:
got it working for me!
reversed tethering worked for me by following the instructions and calling "netcfg usb0 dhcp".
However the WiFi tethering didnt work at first: Other Devices could connect to my phone but no data was forwarded...
The problem was that iptables was not setup properly...
Now I just connect my phone to the pc, enable usb tethering and wifi tethering and run the following:
Code:
adb devices
pause
adb shell netcfg usb0 dhcp
adb shell busybox ifconfig rmnet0 0.0.0.0
adb shell echo 1 > /proc/sys/net/ipv4/ip_forward
adb shell iptables --flush
adb shell iptables --delete-chain
adb shell iptables --table nat --delete-chain
adb shell iptables --table nat -F
adb shell iptables --table nat -X
adb shell iptables -t nat -A POSTROUTING -o usb0 -j MASQUERADE
adb shell iptables -P FORWARD ACCEPT
adb shell iptables -A FORWARD -i usb0 -o wlan0 -j ACCEPT -m state --state RELATED,ESTABLISHED
adb shell setprop net.dns1 8.8.8.8
Hope this helps
Click to expand...
Click to collapse
where to paste the above codes ?
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....
Apologies if this question/topic has been addressed, but search is down at the moment. Has anyone had any luck with wifi tethering and OpenVPN? OpenVPN works fine on the phone, but tethered clients are unable to browse the internet. Some google searching brought up some tips involving iptables commands but they did not help.
zullinux said:
Solved, need root
My setup:
- Samsung Galaxy Note Ics 4.0.4
- Openvpn for Android ( does not need root, might work with other vpn)
- Active data connection
- wifi tethering (should work also with usb)
Prerequisites:
- a root-ed phone
- a terminal
You need to issue 3 commands:
0) launch terminal and become root
yourprompt> su
yourprompt#
1) allow FORWARDING of vpn data (this will allow ALL forwarding)
yourprompt# iptables -A FORWARD -j ACCEPT
2) change NAT to MASQUERADE from ALL interfaces
yourprompt# iptables -t nat -A POSTROUTING -j ACCEPT
3) route traffic in specific tethering routing table
3a) see table for tethering (in my setup is table '60')
yourprompt# ip rule show
3b) add your private address (myne is 172.16.0.0/16) to the tethering table
yourprompt# ip route add 172.16.0.0/16 dev tun0 table 60
That's ALL! Hope it works for you too
Click to expand...
Click to collapse
deed02392 said:
Download a terminal client, e.g. ConnectBot and connect to your local shell.
Enter `su` to become root. (Double check with whoami afterwards).
Enable wifi tethering and ensure your data connection is working (connect to VPN)
Run `netcfg` and note your interface names (typically tun0 and wlan0 (ignore m.wlan0 or similar, only take the one with a real mac address), as is on my SGSII)
Double check the subnet for your wlan0 device and enter the following commands:
iptables -A POSTROUTING -s 192.168.43.0/24 -j MASQUERADE -t nat
(setup a postrouting entry for the tethered devices subnet, implementing NAT)
iptables -A FORWARD -j ACCEPT -i wlan0 -o tun0
forward packets from tethered devices across the tunnel
iptables -A FORWARD -j ACCEPT -i tun0 -o wlan0
forward packets from the tunnel to the tethered devices
Note, because you are using NAT, you will need to configure port forwards on your Android device to be able to run servers etc on tethered devices. Unlikely you'll need to worry about that though. Feedback if it worked or not. Posting this now from my home IP thanks to OpenVPN for Android and these iptable rules!
Click to expand...
Click to collapse
possible soloution
So after trying most combinations of these commands, it worked for me with the following:
My setup:
Nexus 7 (2013)
CleanROM 1.5 (ICS 4.3)
OpenVPN Connect for Android
WiFi-Connection to the source Internet (data-packets will come from there)
USB-Tethering (USB-Cable connected to my Win7 x86 PC)
Prerequisites:
- a root-ed phone
- a terminal
Click to expand...
Click to collapse
Step 1.
Connect you phone/tablet to the source of your internet connection (in my example its WiFi, it may be MobileData for you)
Step 2.
Connect your USB-Cable to the PC <-> phone/tablet
Step 3.
Activate USB-Tethering over the settings menu
(Settings -> "Wireless & Networks" -> More... -> "Tethering and portable hotspot" -> check "USB Tethering" )
Now wait until you can use this connection on your PC.
Step 4.
Start OpenVPN and connect to your VPN-Service
(At this point using the internet with your PC becomes impossible, at least for me)
Step 5.
You need to issue the following commands in a rooted terminal on you phone/tablet.
Code:
iptables --flush
iptables -A POSTROUTING -o tun0 -j MASQUERADE -t nat
iptables -A FORWARD -i tun0 -o wlan0 -m state --state RELATED,ESTABLISHED -j RETURN
iptables -A FORWARD -i wlan0 -o tun0 -m state --state INVALID -j DROP
iptables -A FORWARD -i wlan0 -o tun0 -j RETURN
The most important command for me was
Code:
iptables --flush
. Maybe because I played to much with iptables beforehand but this command did the trick for me.
(You should now be able to browse webpages with its IP-Addr. Ping www.google.com in Step 3 to get the IP)
Step 6.
This is the last step is to configure you PC to use a DNS server. I don't know why but after entering the commands on Step 5 DNS-Queries are no longer routed through your phone/tablet.
Google’s Public DNS
8.8.8.8
8.8.4.4
Click to expand...
Click to collapse
Right-click the connection on your PC and choose Properties / Settings. After that right-click the "IPv4 Protocol" and select Properties / Settings again. Enter at least a primary DNS and click OK after a few seconds everything should work properly.
Protocol:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
DNS:
Taylantz said:
So after trying most combinations of these commands, it worked for me with the following:
Step 1.
Connect you phone/tablet to the source of your internet connection (in my example its WiFi, it may be MobileData for you)
Step 2.
Connect your USB-Cable to the PC <-> phone/tablet
Step 3.
Activate USB-Tethering over the settings menu
(Settings -> "Wireless & Networks" -> More... -> "Tethering and portable hotspot" -> check "USB Tethering" )
Now wait until you can use this connection on your PC.
Step 4.
Start OpenVPN and connect to your VPN-Service
(At this point using the internet with your PC becomes impossible, at least for me)
Step 5.
You need to issue the following commands in a rooted terminal on you phone/tablet.
Code:
iptables --flush
iptables -A POSTROUTING -o tun0 -j MASQUERADE -t nat
iptables -A FORWARD -i tun0 -o wlan0 -m state --state RELATED,ESTABLISHED -j RETURN
iptables -A FORWARD -i wlan0 -o tun0 -m state --state INVALID -j DROP
iptables -A FORWARD -i wlan0 -o tun0 -j RETURN
The most important command for me was
Code:
iptables --flush
. Maybe because I played to much with iptables beforehand but this command did the trick for me.
(You should now be able to browse webpages with its IP-Addr. Ping www.google.com in Step 3 to get the IP)
Step 6.
This is the last step is to configure you PC to use a DNS server. I don't know why but after entering the commands on Step 5 DNS-Queries are no longer routed through your phone/tablet.
Right-click the connection on your PC and choose Properties / Settings. After that right-click the "IPv4 Protocol" and select Properties / Settings again. Enter at least a primary DNS and click OK after a few seconds everything should work properly.
Protocol:
http://i.imgur.com/g2sTL9F.jpg
DNS:
http://i.imgur.com/luEPpK1.png
Click to expand...
Click to collapse
You absolute legend!! Worked perfectly for me! I used this on my Galaxy Note 2 with Wifi Hotspot to bypass the Three UK tether block.
Thanks so much!
costcutter said:
You absolute legend!! Worked perfectly for me! I used this on my Galaxy Note 3 with Wifi Hotspot to bypass the Three UK tether block.
Thanks so much!
Click to expand...
Click to collapse
Glad I could help.
If someone has a solution for routing DNS queries with iptables it would be possible to skip the operating system part.
Would make the process faster and easier.
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 like below:
[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:
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
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. 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 android ,and only this method that it seems work,but it still something wrong that prevent android phone to join existing ad hoc network.
fadwa.ww said:
[email protected]:/ # iwconfig wlan0 mode ad-hoc
[email protected]:/ # iwconfig wlan0 channel 6
[email protected]:/ # iwconfig wlan0 essid 'Test1'
Click to expand...
Click to collapse
Did you forgot to execute "ip link set dev wlan0 up"?