yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy Nexus] adi003:
I have the following config:

OpenVPN server

10.8.0.1

OpenVPN client android phone:

tun0 10.8.0.6

Turned on wireless tethering and now i also have:

wlan0 192.168.43.1"interface on android phone

Client PC(linux ) - through tethering

192.168.43.164

I can ping 10.8.0.6 from linux and I can ping both 192.168.43.164 and 10.8.0.1 from android.

Made the following config on android:

iptables -t nat -A POSTROUTING -j ACCEPT

iptables -A POSTROUTING -s 192.168.43.0/24 -j MASQUERADE -t nat

iptables -A FORWARD -j ACCEPT -i wlan0 -o tun0

iptables -A FORWARD -j ACCEPT -i tun0 -o wlan0

There is only one small problem: I can't access the internet from Client PC(linux)

traceroute gives no output

Can anyone help? thanks!
[Samsung Galaxy Nexus] fern420:
So did anyone ever have any solid luck on this? I did not following this guide, i still get limited connections,I have recently started using a VPN and have run into this issue, if i activate tethering with the VPN connected I get a "limited" connection on any device trying to connect to my android and cant surf.

I just switched from witopia to privateinternetacess and here's the thing, i did not have this issue with witopia, i could tether just fine with my VPN ( all of their protocols) active and everything worked as it should connected devices showed ip's from the VPN as they should and browsed just fine.

Could this issue be something related to the VPN servers/providers themselves? I requested help from the helpdesk for Privateinternetaccess and they told me they couldn't help saying they weren't "licensed" to, whatever that means.
[Samsung Galaxy Nexus] mmorisa:
Hi fern,

Kindly check this thread:

http://xdaforums.com/showthread.php?p=35921217

I am using Note 2 and HMA vpn.

By using the built-in hotspot function, all my connectes devices cannot connect to the internet when VPN is active.

I have to disconnect my VPN so that my connected devices can access the internet.

With the above thread and solution, I don't have to disconnect my VPN anymore and all my connected devices can access the internet.

Please try and post feedback.

Regards,

Morisa

Sent from my GT-N7100
[Samsung Galaxy Nexus] CekMTL:
Thank you very much!... after some fiddling, it just worked, and now I can stream pandora from my MAC, :) thank you!
[Samsung Galaxy Nexus] mmorisa:
Good.... Good... Good... :thumbup:

Sent from my GT-N7100
[Samsung Galaxy Nexus] XerXesNG:
Gna try this solution now....but

How do I get my private address???????????

God why am I such a noob...

I've been 'googling'...

No specific command or way to know my private address

:(
[Samsung Galaxy Nexus] XerXesNG:
*4 hours of google*

Please just tell me how to get the table number and that ip range to add

I can connect to vpn, can't use wifi tether over the vpn...laptop connects, but doesn't connect to internet...same problem
[Samsung Galaxy Nexus] mmorisa:
Please look at 2 posts above...

Sent from my GT-N7100
[Samsung Galaxy Nexus] XerXesNG:
The last number, the setup table number or something like that is what i cant get. Table_id or something... Ive figured out a way to get IP range already. I cant figure a

Out the command that gives table for tethering

---------- Post added at 04:10 AM ---------- Previous post was at 03:55 AM ----------

If you run this command:

ip addr show

You can find the private ip.

A section of my result is below

22: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000

link/ether 78:9e:d0:54:ea:3c brd ff:ff:ff:ff:ff:ff

inet 192.168.43.1/24 brd 192.168.43.255 scope global wlan0

inet6 fe80::7a9e:d0ff:fe54:ea3c/64 scope link

192.168.43.1/24 is my private ip

I figured that out playing around with the terminal. Risky i know :( i keep using the help command or argument for thingsike iptables list, iptables show etc nothing shows my table number.

Please forgive my probably incorrect use of the commands
[Samsung Galaxy Nexus] mmorisa:
Hi there, your private IP will change whenever your mode of connection changes... For example from wifi to mobile and vice-versa. And also when your mobile changes signal from 3G/H to E/G if there is connection drop.

I would like to suggest that you try the app that I post the link inside my previous posts. You don't have to worry about IP tables whatever etc.

. One more thing, what type of android phone you are currently trying to configure?

Regards,

Morisa

Sent from my GT-N7100
[Samsung Galaxy Nexus] XerXesNG:
Hi,

Thanks for your help so far

I'm trying to configure my Galaxy s3 mini. I rooted it from a guide on this forum. It has been working flawlessly well, the perfect root. My two other friends have the same phone, unrooted, and cannot tether their internet via wifi when connected tovpn too. There's usually no interned connection on the other devices.

A whole lot of google shows its with the iptables or route thingy.

Ive tried all the apps in alll the posts i could find so far, no success. The Trev E mod app doesn't really create the wifi connection to share. My laptop can detect the network. Attached screen shots here.

Even with an open wii connection, no passphrase, it still doesn't connect my laptop to my vpn.

Is there any other information you'd need?

Maybe its impossible to fix this in galaxy s3 and s3 mini using 4.x OS
[Samsung Galaxy Nexus] XerXesNG:
Hi...

Ony my galaxy s3 mini, how do I know the table number

When i type ip rule show

only three entries come up

local, main and default with numbers 0, 32766 and 32767 I think

No number comes up for the wifi device

And yes, i am tethering and connected to the vpn

PS, i am a complete rookie
[Samsung Galaxy Nexus] mmorisa:
Type

ip add show

In your terminal

Your wifi will be wlan0

It will show up or down depending if you connected or not

And your vpn shall be tun0

It will also show up or down

Your mobile data will be rmnet0

It will also show upnor down

Sent from my GT-N7100
[Samsung Galaxy Nexus] XerXesNG:
Heeeeeeeelllllp!!

Hi there...

I'm a total rookie, I just follow instructions carefully.

I've been searching for a solution to this problem on my s3mini

Rooted.

I used Terminal Emulator, AND FOLLOWED THE INSTRUCTIONS ABOVE still my wifi connected laptop didn't connect to the internet. My openvpn log showed something like routes adding and stuff

still didn't work

Then I used ConnectBot to retry the same exact steps, still nothing happened

On my phone, i think the subnet is 192.168.43.1/24. Do you think that could be a reason it did not work?

I've tried so many options so far for this issue.
[Samsung Galaxy Nexus] thantos_mehak:
1. connect to your vpn. confirm that it works (maybe go http://www.whatismyip.com/ before and after vpn setup, should have different results).

2. start wifi tethering.

3. Start a terminal and do the following (prompt $ is just a placeholder for your prompt, don't type it):

prompt $ su -
prompt # iptables -t filter -F FORWARD
prompt # iptables -t nat -F POSTROUTING
prompt # iptables -t filter -A FORWARD -j ACCEPT
prompt # iptables -t nat -A POSTROUTING -j MASQUERADE

Wait about 2 minutes then try to connect a wifi device to your wireless network. If everything works, great, otherwise get busybox from the play store and do the following from a terminal on your phone and post the output:

prompt $ su -
prompt # iptables -t filter -n -L
prompt # iptables -t nat -n -L
prompt # busybox ifconfig
prompt # busybox route
[Samsung Galaxy Nexus] woody1:
The last post seems pretty straight forward. I have 3 questions:

1. Are these changes to the router tables persistent, or do I have to put them in each time?

2. Do I need to

undo

the router table changes after the tethering session is over?

3. Has anybody written a script to make these changes (if not, doesn't seem like it would be hard to write one)?
[Samsung Galaxy Nexus] thantos_mehak:
First, I am making the assumption that you are talking about iptables (which are different than routing tables (shown with the command route))

Using a Galaxy S2(SGH-T989) running CM10, I have to re-input the above around once a day, sometimes more. It looks like something in the system re-adds old forwarding rules.

I haven't had to reset the iptables to the previous rules.

I have written a shell script and a simple android program. I will post the shell script here, just copy and paste the below into a file and save it. I may post the android program after I have made it possible to undo any changes it has made.

Shell script:

#!/system/bin/sh (you may need to confirm this is the proper path to sh, with `which sh`)
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -A FORWARD -j ACCEPT
iptables -t nat -A POSTROUTING -j MASQUERADE

You need root access to run the above. And it must be run with sh (which pretty much makes the #! useless but old habits die hard).
[Samsung Galaxy Nexus] woody1:
I've been using a similar script. The script works ok when I run it as root in Terminal Emulator. I have also tried to run the script from SL4A and it doesn't work. I think the problem is that SL4A can't run scripts as root.

It would be useful to find a way to run the script from a desktop button instead of from Terminal Emulator. Any ideas on how to do that?

---------- Post added at 12:13 PM ---------- Previous post was at 12:04 PM ----------

So how can you tell when the rules get reset? Does the forwarding stop working or does it just stop routing through the VPN without warning?
[Samsung Galaxy Nexus] erkme73:
I was about to try the various scripts described in these four pages, but before I did, I just tested my connection.

I turned on my wifi tethering (treve), and on the phone (note2, TMO) found my wan IP as a TMO IP. I then connected with my laptop to the phone's AP, and found the same TMO IP address.

I then started the built-in VPN client, connecting to my Asus router's native VPN server (stock firmware). I retested the phone's IP, and found it to be a FIOS IP (same as my home ISP). I then checked the IP address of the AP-connected laptop - and it too had the same FIOS IP address.

I didn't disconnect the laptop from the phone when I started the VPN session, yet the laptop's WAN IP address changed to reflect the endpoint of the tunnel.

From my basic understanding of what I just witnessed, is it safe to assume my ROM already has this patch? Based on what I've read here, I would have expected the laptop to retain the TMO IP address...
[Samsung Galaxy Nexus] thantos_mehak:
To check if the settings reset or another program added more rules, run the below

iptables -t filter -L

iptables -t nat -L

Your the FOWARD chain (in the filter table) should only have one rule and the POSTROUTING chain (in the nat able) should only have one rule.

---------- Post added at 11:24 PM ---------- Previous post was at 11:13 PM ----------

What ROM are you using? I have had to do the above process with both cm10 and paranoid android 3.0 (or so). It is possible that the built-in vpn does some special magic for you (aka auto setting the rules).

What type of vpn do you setup? (pptp, l2tp, ipsec, etc)

If you can repeat the working vpn sharing setup and paste the output of these commands (run from a terminal):

iptables -t nat -L

iptables -t filter -L

That may confirm the magic hypothesis. Pretty sure with OpenVPN you would need to add the rules yourself.
[Samsung Galaxy Nexus] erkme73:
After giving a night to sleep on, I think I figured it out. I'm using the wifi-tethering by TrevE. When I look at the startup/shutdown log of the app, it appears that it does what you guys are describing here. This is a summary of what I find in the log after starting the tethering:

It doesn't detail what those steps are - and I'm to wet behind the ears to figure it out. But when I start tethering on this app, it takes a good 10 seconds to go through that script before the AP becomes visible to my wifi devices.

But, if I"m connected with my laptop, go to whatsmyip and keep hitting refresh as the VPN is started, I can see how it changes from the local TMO IP to the endpoint IP. As soon as I kill the VPN, it reverts back to the local TMO IP.

So it's definitely doing the rerouting.

My ROM is stock, rooted deoxed on the TMO Note II. The VPN server is the stock integrated VPN server found on the Asus RT-N56U, firmware version 3.0.3.1v-027.

It is a pretty simple (noob friendly) setup. I only have to add UN and PW for any VPN account I want to create (no certificates or other configuration required). It's using PPTP, MS-Chap v2, MPPE-128, broadcasting traffic in both directions, MTU & MRU both set to 1460. I've reserved a specific internal LAN IP for each user account. It just works. For once, I'm the guy who's got a working setup... That never happens. I ought to play the Powerball.
[Samsung Galaxy Nexus] erkme73:
New but related question...

With the VPN working properly, my phone gets it's WAN/public IP address statically assigned from my home router (192.168.1.250). Thus, I can forward any/all ports on my home router to this new VPN IP address.

On the phone end, I'd like to redirect those incoming ports to a specific IP address of a tethered device - my Gargoyle router that then has it's own LAN subnet.

The question is, is there a way to have a DMZ-like or port range rule on the phone that will direct specific (or all) ports to an IP on the phone's LAN side?
[Samsung Galaxy Nexus] bitstryke1101:
Thanks for the work guys, I was able to get my connection up and running.

For whoever is on this forum, if you're running into problems after you use thantos_mehak's solution, try checking to see if your DNS is working ok. On the computer you are tethering to, open up a shell (cmd/terminal) and try pinging a well known website (like google) as well as "8.8.8.8". In my situation, i was able to reach 8.8.8.8, but not google. Meaning my DNS queries wern't going through. If you have that problem, change the adapter settings to use a well known DNS server (The ones i used were 8.8.8.8 and 8.8.4.4)

I know its farfetched that someone else had this problem, but if you did - hope this helped :)
[Samsung Galaxy Nexus] Never2Blazed:
legend! thank you very much.
[Samsung Galaxy Nexus] Solarusj:
Fancy Helping

Guys

I have been watching these posts with interest. Is anyone up for a challenge? I have been trying to turn one of my old HTC Desire Z's into a secure Mifi / GMS Router. I have OpenVPN up and running (Client and Server) and have tried a number of Wifi Tethering products coupled with a a number of different methods to try and get the routing working but it isn't happening.

Is someone here up for it that really knows their networking? I will provide whatever information you require to come up with the rules (screen shots etc if required).

Thanks
[Samsung Galaxy Nexus] emp111:
Hi

with regard to step three, after issuing the ip rule command I get the following results:

0: from all lookup local

32766: from all lookup main

32767: from all lookup default

I assume that the number refers to the table number, but which do I choose?

Also just to be noobishly clear :) the private address' to which you refer is the address' given to my tethered devices?

Thank you in advance for your help
[Samsung Galaxy Nexus] egandt:
HAs anyone tried tethering on 4.3 based ROM

I tried 3 methods so far that are documented:

#!/system/bin/sh

iptables -t filter -F FORWARD

iptables -t nat -F POSTROUTING

iptables -t filter -A FORWARD -j ACCEPT

iptables -t nat -A POSTROUTING -j MASQUERADE

and

iptables -t nat -A POSTROUTING -j ACCEPT

# Mine is 192.168.43.1/24

iptables -A POSTROUTING -s 192.168.43.1/24 -j MASQUERADE -t nat

iptables -A FORWARD -j ACCEPT -i wlan0 -o tun0

iptables -A FORWARD -j ACCEPT -i tun0 -o wlan0

and finally

iptables -A FORWARD -j ACCEPT

iptables -t nat -A POSTROUTING -j ACCEPT

# 10.120.24.0 is My Subnet

ip route add 10.120.24.0/16 dev tun0 table 60

The problem is that no matter the state of teh VPn connection only 3 items are shown by "ip rule show"

0: from all lookup local

32766: from all lookup main

32767: from all lookup default

So the VPN is not shown as registered. So obviously the 3rd command fails.

I assume since all 3 methods are failing, it may be related to Android 4.3, but thought it worth asking as this is about the only valid thread on doing this on XDA.

Thanks,

ERIC
[Samsung Galaxy Nexus] anewday:
Thanks so much, this worked! :D
[Samsung Galaxy Nexus] AndehX:
This is the only thing that has actually worked for me! Absolutely amazing! Props to you sir. I can actually play my 3DS online through my phones wifi now.

I assume these changes will not be saved? If so, when will your program to automatically apply them, be available?

Cheers!

Edit/ Also, just pasted those commands into a txt file, renamed to .sh and copied to my phone. tried to run it, and got the errors:

iptables: No chain/target/match by that name.

iptables: No chain/target/match by that name.

'ptables v1.4.11.1: Invalid target name 'ACCEPT

the commands I typed were:

su

sh wifi.sh

Im assuming I did something wrong.
[Samsung Galaxy Nexus] thantos_mehak:
I will try and get the source someplace tonight or tomorrow night for the app I wrote to do this.

I will reply further then.

I haven't gotten anything to work successfully for 4.3 but I did see a couple posters who did. Again, will try and add links tonight or tomorrow night.
[Samsung Galaxy Nexus] AndehX:
Well im on 4.3 and the commands you provided enabled me to connect my 3DS to my phone. Nothing I have tried up until now has worked.
[Samsung Galaxy Nexus] thantos_mehak:
What rom are you using?
[Samsung Galaxy Nexus] AndehX:
Im using stock touchwiz 4.3
[Samsung Galaxy Nexus] AndehX:
Any update on this mate?
[Samsung Galaxy Nexus] AndehX:
just gonna bump this again, as I'd really like to see some progress on this issue :)
[Samsung Galaxy Nexus] thantos_mehak:
Sorry for taking so long

Here is a link to the source for the app. You will need to modify it to work on for your system. Sorry for taking so long. Just got a new kid, takes a lot more time than I thought.

The following code is provided with no warranty. Sorry I don't have time to work on it more but you can do what you want with the source.

merlin.uno/files/static_tables.tar.gz

merlin.uno/files/static_tables.zip
[Samsung Galaxy Nexus] dionysos77:
is there any application (root) that can do these settings for ordinary users.
[Samsung Galaxy Nexus] snekiam:
Hey, your website isn't loading for me. Maybe its down, or maybe i am missing something..
[Samsung Galaxy Nexus] thantos_mehak:
Sorry, I switched domains a month or two ago. Meant to update the link but forgot. Check it out now. (merlin.uno).
[Samsung Galaxy Nexus] snekiam:
Do you think you could help me build this source? Totally noobish about compiling android apps
[Samsung Galaxy Nexus] prakalejas:
Sharing my solution:

it's not fully automatic, but it works. Tested on multiple non nexus devices.

1. Just install

Smanager https://play.google.com/store/apps/details?id=os.tools.scriptmanager&hl=en

SMWidgets https://play.google.com/store/apps/details?id=os.tools.smwidgets&hl=en

2. place ppp.sh to permanent location and create a widget/shortcut on home screen and run it after enabling tather and connected to VPN.
[Samsung Galaxy Nexus] mexican-bum:
I am trying to get this to work on a galaxy s5 active, doesn't seem to work, maybe doing something wrong though
[Samsung Galaxy Nexus] prakalejas:
Seems like kit kat is the problem.

Here's a solution, that worked on G900F.

ADD THESE LINES AT THE END OF PPP.SH SCRIPT:

ip rule add from 192.168.43.0/24 lookup 61

ip route add default dev tun0 scope link table 61

ip route add 192.168.43.0/24 dev wlan0 scope link table 61

ip route add broadcast 255.255.255.255 dev wlan0 scope link table 61

Special thanks to Scootley: http://xdaforums.com/google-nexus-5/help/solution-to-tethering-openvpn-issues-t2564626
[Samsung Galaxy Nexus] migidid:
Does this mess with my other network configurations? and also my VPN ip keeps changing everytime i reconnect so i figure i need to do this everytime i connect to new VPN address ?
[Samsung Galaxy Nexus] :
delete
[Samsung Galaxy Nexus] timxzl:
If you tried

iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -A FORWARD -j ACCEPT
iptables -t nat -A POSTROUTING -j MASQUERADE

but tethered clients still cannot access the Internet, it is probably because your packets never gets the correct routing.

You may try this:

ip rule show

suppose it prints out something like "32765:	from 192.168.43.0/24 lookup 60", then execute this:

ip rule del from 192.168.43.0/24

the above command will delete the special routing policy for tethered clients, and let their packets use the normal routing rules.

Remember all these commands need to be executed by root.
[Samsung Galaxy Nexus] Spamm00r:
I'm trying to achieve this on STock I9100.

But none of the methods mentioned above Work.

Some write that using the App "WIFI Tether for roots" will do it without any modification, but I can't get it to work at all.

http://code.google.com/p/android-wifi-tether/

Wifi tethering without VPN works flawless though but as soon as I enabale VPN, I have no internet on the connected devices.

The methods mentioned here are also not practical on a smartphone. You can't type commands on a phone without having dozens of typos. And having to do this again and agaian is a Pain in the ass.

A simple app is required here.
[Samsung Galaxy Nexus] dwreck420:
do you have to do this every time? just once? please advise
[Samsung Galaxy Nexus] alanthehat:
what is "table"?

In several of the instruction sets I'm seeing "... table 60"

What is table

What is 60

http://linux.die.net/man/8/ip shows table but it's a huge page & I'm not confident. Also, it does not mention table 60. I am reasonably, but not absolutely, sure that 60 is a purely arbitrary number. Would ip route show all show tables that are already used?
[Samsung Galaxy Nexus] El_Dark:
Reporting from a Samsung Galaxy Grand Neo: it worked flawlessly with openVPN client de.blinkt.openvpn! Thanks dude!!!
[Samsung Galaxy Nexus] pvries86:
When I follow the first block of instructions, it kinda works. I can access devices is my remote network. However DNS isn't working.

I can ping internal devices on their IP address

I can ping external websites on their IP address

I can NOT ping either on their hostname.

Should I execute the second block of commands and post the output here, or does anyone already know a fix?
[Samsung Galaxy Nexus] k3nd:
This method need to root or nor?
[Galaxy S III Q&A, Help & Troubleshooting] andreasy:
I hate to ask this but after returning my HTC One X back and while waiting for a refund which I don't even know if I'll ever get, I better ask this question before doing the same mistake again. Well, I returned my HOX because GPS was unusable. Not just on my phone, basically HOX doesn't really have GPS. It only has it as a decorative feature but there is no way you can use it for navigation. Such issue definitely can't be fixed with a software fix so I decided to return it and see forward to SG SIII.

What I wanted to ask is, are there any serious hardware issues with SIII as well that should stop me from buying it? I don't mean issues like instability (or network errors) with S-Voice and similar things that could be solved in the near future with software updates. I mean real hardware issues like the one I described above that make you believe they won't ever be fixed because it's impossible.

Now I come from HTC only background so I may miss some things from Samsung. I therefore need to ask the following simple questions as well:

- Does Samsung offer a sync software similar to HTC Sync? (That will allow you to sync with Outlook)

- Is the SGSIII fully rootable (with S-OFF bootloader)

- 2-way call recording works (is there a kernel hack or does it work/not by default)?

- Anyone used iGo navigation with success?

Those are my requirements so if it fulfills them and there are no issues, that's enough for me to buy this phone.

Thanks :laugh: