Firewall not working on VPN connections [iptables/Droidwall] ? - Android Q&A, Help & Troubleshooting

Hey guys,
I really hope to get an answer on this as it is kind of really important for me here...
It seems that Droidwall stops working once I connect through a VPN and thus opening the door wide for any applications to connect to the internet; hello ads ..and what not...!!
I saw that someone has already opened an issue (almost 3 months ago) on code.google.com and it is the same issue here, except that I usually choose the Blacklist mode instead - checked means blocked.
I have to first enable "1016: VPN networking" and also "(root) App's running as root" for the VPN to connect properly; it does then, right away, I can see that Droidwall no longer blocks what I've selected. Re-applying the rules doesn't change that either.
I've never tried custom rules in that software, but I doubt that it would work since that it seems like all the apps are just bypassing Droidwall altogether when on VPN.
So any of you know a solution to this?
Preferrably using Droidwall, but other solutions are also welcomed.
I'm using CM7 (for Defy - recent nightly) and the VPN I've tried is DroidVPN (but I've read the same about at least one other VPN).
And btw, I've posted the same question on the Droidwall official thread, but no reply yet..
Thanks in advance.
Edit:
I've just tried LBE Privacy guard and I experience the same; even that plus Droidwall (both enabled while on vpn) and I can sill see ads go through...

Yo, I was going through my old posts/threads and I saw this one unanswered ....
So in case anyone else search for this in the future, here's the solution:
in Droidwall, hit menu, more, 'Set a custom script" and paste the following in the top box:
Code:
$IPTABLES -A "droidwall" -o tun+ -j "droidwall-wifi"
Hit OK and reboot.
You now have a vpn access that do not let every app go through on wifi (no solution for 3G yet... sorry).
Cheers
/AL
Edit [Jan19,2013]:
Thanks to topjor, here's the code to do the same thing on 3G:
Code:
$IPTABLES -A droidwall -o tun+ -j droidwall-3g || exit
Enjoy your new internet control powers!!

Related

[Q] Anyone get VPN Connections to work?

Hey guys,
I have been keeping my eyes out for the tun.ko module to come out in one of the kernels, and it finally did in the 1.76 GHz kernel. I had to reinstall VPN connections after flashing the kernel, and then VPN connections would tell me that my VPN was connected properly. However, I can't get data to pass through the VPN. No pings to the remote end, no RDP, nothing.
Anybody else get this working?
Thanks,
Seth
I thought I set up my VPN wrong >_> Well that explains it! Thanks! Same issue. I have however been able to see my phone in my router, though I can't do anything with it there in or out.
This sounds like the same issue I was having with openvpn (I assume that's what you're referring to since you're talking about the tun module). I'm running Das BAMF 1.3.2, and tun is already built into the kernel. I'm having the same problem. The VPN connects, no errors at all, even ran it in the terminal so I could see all of OpenVPN's connection output. But data is not routed through the tunnel. WhatIsMyIP still reports my Verizon IP address.
Now, on two occasions I have had success. I was able to connect and disconnect my VPN all I wanted and everything worked. However this only lasted for the current phone 'life cycle', ie it failed again after the next reboot. I can't find a pattern or anything, it seems that it will randomly work after a reboot, but not that often... 1 out of 10 maybe? I didn't waste my time trying to nail down a ghost.
I think I solved the OpenVPN problem. There's an option in OpenVPN settings called 'Fix HTC Routes'. If you check it, you can get the link to view the issue tracker. Essentially it deletes a few routing tables after OpenVPN starts up. For some reason, it doesn't seem to work on the Thunderbolt. Perhaps that option is using a deprecated script command (ip ru del route)? Whatever the reason, the fix is simple. After connecting to OpenVPN, open a terminal and issue the following commands:
Code:
ip ru del table gprs
ip ru del table wifi
Ignore any errors you might get if the routing table doesn't exist. I don't think you need SU, and you can use GScript Lite to make the process easier on you.
I'll give this a shot with VPN Connections when I get a chance and report back. If anybody else has any success, please post here.
I have had better success, but it's not right yet for me. I am able to get some data to flow using RDP, Telnet, etc., but nothing actually works completely right.
When telnetting into routers, I am not able to actually authenticate. however, I CAN finally see the prompts.
When using RDP, it doesn't time out any more, but I don't get any video data back to my phone's screen. No login page, etc.
Those two commands also seem to time out eventually. I need to reenter them to get the data flowing again, it seems.
Anybody else have better results?
Seth
Well, without knowing which VPN you're using, I can't say. But it does seem to work with openvpn and the OpenVPN Settings market app (I have my own install of openvpn, so I don't use the related OpenVPN Installer app).
The routing tables gprs/wifi are automatically recreated when those connections are re-established. Meaning, if you are on VPN via wifi, and wifi disconnects/reconnects, then the wifi routing table is recreated. The same goes for gprs if you lose connection and it is reestablished. I don't know what the system might try to do using the built in VPN connections.
Sorry about that, the lack of info wasn't very helpful.
I'm trying to connect to my Cisco VPN. We are using group authentication as well as user authentication. The outside device is a 2811 router, and if there are any other specifics that might help, I'd be happy to provide it.
Thanks,
Seth

Cisco VPN

I have gone through the steps in the development post for [Module] tun.ko for stock 2.6.32.9 (for openvpn/vpnc/etc), http://forum.xda-developers.com/showthread.php?t=1013513. I am still unable to connect to my companies Cisco VPN router. I have rooted my Atrix and confirmed that tun.ko is running. Every time I try VPN Connections, it will not connect with no response after an attempt. I have also tried VPNC Widget which tells me "0:unexpected operatorError: root access missing! Waringin:'Advanced Routing' feature missing - VPN Conectivity might be lost after a while"
VPN access is all I am missing to get RDP working, at least I hope as I can use it on my home domain with my Windows server.
I am somewhat new to Android devices, other than tinkering with my old AT&T Tilt with Android 2.2 on NAND. Any help to resolve is much appreciated.
I am still unable to connect through my company's VPN. I have found out that we use a Cisco 3000 Concentrator. If anyone else has had luck with this model, I would like to hear about it.
I had a lot of issues getting mine to work too..
After hours of hunting and lots of logcats later I figured out VPNConnections is very picky about your busybox version. Something to do with the output of the ps command.
Check this thread (Mostly my last two posts on page 5): http://forum.xda-developers.com/showthread.php?p=13859822
Cliff Notes version:
I got it working with VPN Connections .6, Busybox 1.17.1, and the tun.ko posted by rozzco in that thread.
BB 1.17.1 is available from Stericsons BB installer under alternate versions.
If you need the APK for it or the VPN app lemme know and I'll post it.
FWIW, I never got VPNC widget to work. I had your same error,
I tried your suggestions, using the specific versions. Still no luck. Look at logcat, it appears to attempt to connect but ultimately finishes with "process stderr: no response from target".
scoob8000 do you know what VPN device through which you are connecting? I don't know if it is a issue with the Cisco VPN 3000 Concentrator we are using. There was a mention of retiring the device, but they do not know when or with what it will be replaced.
Did you try this one?
http://code.google.com/p/get-a-robot-vpnc/
That is the VPN Connections app scoob8000 has mentioned.
rgbaxter said:
I tried your suggestions, using the specific versions. Still no luck. Look at logcat, it appears to attempt to connect but ultimately finishes with "process stderr: no response from target".
scoob8000 do you know what VPN device through which you are connecting? I don't know if it is a issue with the Cisco VPN 3000 Concentrator we are using. There was a mention of retiring the device, but they do not know when or with what it will be replaced.
Click to expand...
Click to collapse
From memory I think it's juist a old 26xx series router.. (Don't quote me on this lol)
It almost sounds like your at least hitting the network. Can anyone try to see your attempted connections on the concentrator?
Working IPSEC VPN Client for Cisco VPN Concentrator
I know this is an old thread, but thought I would post an update anyway.
I recently started looking for a VPN client I could use with our Cisco VPM Concentrator, and ran across the one mentioned in this topic, VPN Connections. I installed it from the same link also posted by lhurtado earlier.
I think this may be a newer version than what was available at that time, though. Either way, I've got it working without any issues, and I'm able to VPN into my network, and use RDP without any issues.
I did try this on a non-rooted Asus Transformer TF-101, and it did not work. I only got a "Failed to Connect" message in VPN Connections. I'll have to see if I can find the logcat mentioned previously for any information on why it is failing, but I'm guessing the stock Kernel/ROM does not have tun.ko.
Here's the specs on what I've got:
Acer Iconia A500 (rooted), custom ROM (Taboonay 2.2) and Kernel (HoneyVillain 3.4)
BusyBox 1.19.2
VPN Connections 0.99
2X Client
Cisco VPN Concentrator 3005
Hope this helps someone else who is looking for a VPN client that works with the Cisco VPN Concentrators.
As long as your kernel support tap/tun configs, you can use the VPN Widget. I use it with our cisco equipment at the hospital I work for. It works like a champ! You will need to get your information to get it to work properly but its the only one I have found so far to work out of the box (with the proper kernel).
As for the OP, being this is an old thread I sure he gave up- however if he was trying to RDP using the hostname, that is not possible (without hackery). Always use your IP until we have CIFS support. NetBIOS name are not resolved on a linux platform without it. I use RDP/VNC with my VPN over 4G almost daily.
Beating a dead horse
OK...First off, thank you to everyone for looking into this.
I'm a Network Engineer that has the pleasure of supporting a Cisco 3030 VPN Concentrator from the stone age. For those with Iphones we just give the Facutly/Staff the IPSEC/PSK and use the native VPN client and all is well.
The Androids (which I'm a die hard fan of) don't work....UNTIL version 4.0.x arrived.
There is an app called VPNCILLA (or for those rooted VPN WIDGET) that works with the old style concentrators. VPNCILLA has a 10 day trial, but afterward is a $4.95 one time fee.
They both work flawlessly and are easily setup.
Just wanted to pass the word in case the one person in the world out there is still trying to get it to work (like me).
Thanks
Shayne

[Q] Block Wifi if VPN is down?

I want to ensure nothing on my phone as access to wifi if my vpn is not connected. Anybody know how I could achieve this?
Any ideas greatly appreciated.
You might want to give Tasker a try. Llama (it's free / haven't used it though), or another Task automation tool might work too. It depends on how the app works, but you may have to do one or two things manually. For instance
Example Pseudo-code:
Code:
IF VPN app OPENED (
TURN OFF WIFI
SET VARIABLE vpnfrontend=1)
IF VPN app LOSES FOCUS (closed) (
ASK "Is VPN Enabled?"
IF YES (
ENABLE WIFI
SET VARIABLE vpnfrontend=0 )
IF NO (
SET VARIABLE vpnfrontend=0 ) )
That's the best I can think of off the top of my head.
Hope this helps!
Thanks for the reply closeone.
I purchased Tasker a couple of days ago. Hopefully I'll be able to do this - afraid there are going to be some manual steps though. I bought WifiJumper to auto connect to hotspots (known or unknown) so my wifi phone (Samsung Galaxy Player YP-G70) would be more like a cell phone. I thought if I could get OpenVPN working on my phone it automatically tries to reconnect but it is sometimes a slow process - thereby leaving my wifi connection open for a minute or so.
The ultimate goal here is: Android is a lot like CarrierIQ in that it tracks every IP you log in from. So I want to use a vpn so the IP I login from is the same one no matter where I'm at. I'm not a hacker, pedo, or even using P2P - I just want my privacy. Kind of a principal type of thing.
Your code is similar to what I was thinking of but.... I'm thinking I won't be able to check to see if VPN is enabled and then turn on wifi because the vpn requires wifi access to connect.
I'm still new to Android but so far the only tool I see to block wifi access is Airplane Mode and I think it blocks all apps (including the vpn). Maybe pdroid or Droidwall have some options for what I want to do????
Got to thinking if Droidwall had profiles I could build a profile that had wifi blocked for everything except Vpn. Then use Tasker to check to see if vpn was up. If not then set Droidwall to that profile. Problem is I don't think there is a way to run Tasker rule constantly. So there would be data leakage.
Sent from my YP-G70 using Tapatalk

Solved: Wifi Hotspot issue Samsung Galaxy S2 Telstra

Hi All,
I think I have finally cracked it. I have had this issue since getting my SG2 out of the box and i have read every forum possible for a solution. I mean i have tried everything until this:
Fix: This is for those people using their phone as a wifi hotspot that get a successful connection to their laptop or Tablet etc but cannot use the internet because of DNS issues. I.e, when connected to your laptop you establish a connection but get a limited connectivity warning.
Steps:
1. ensure you are on ICS
2. I want you to re download a fresh set of your APN's from telstra - http://configure.telstra.com.au/telstra/index.jsp (Follow your nose with this bit, you want the one that downloads all of them)
Now the fix!!
3. Go to Settings> more>mobile networks>access point names
4. Click on Telstra internet (telstra.iph)
5. Scroll down to APN Type
6. Type: default,supl,internet,dun
7. press menu then save
Your Done.
Your data notification will switch off and then back on in about 15 secs and away you go.
I really hope this helps those that have had this issue for ages.
Mewsik.
Hi,
I would be interested to see your feedback if this fix worked for you. I have had 2 work friends have the same issue and the above post fixed their wifi hotspot issue.
Cheers.
sorry to resurrect a super old thread, but i just want to say that this worked for me and thank you.
i am using openvpn and for some reason my "push dns" server rule was not applying to my phone. the computer kept pointing to my phone's ip as the dns resolver, but my phone was not resolving anything (most likely it was trying to resolve from localhost) but after i applied the above, openvpn push rules correctly applied and my computer now accepts the dns from my server automatically.
my setup:
openvpn server -> openvpn on phone -> usb tether -> computer
this way my computer's traffic is routed through openvpn on my phone so dont have to install it on my computer basically a portable vpn 'server'. this works for wifi as well so any clients that connect will also route through vpn.
Do you even have an I9100 ?
I can't believe they let this drag on this long without a fix. Upgrading to Kitkat was the worst mistake ever.
My VPN was flawless on 4.3 .... Someone please figure out how to downgrade back to 4.3.
Thanks OP for the info.
Total_Lag said:
sorry to resurrect a super old thread, but i just want to say that this worked for me and thank you.
i am using openvpn and for some reason my "push dns" server rule was not applying to my phone. the computer kept pointing to my phone's ip as the dns resolver, but my phone was not resolving anything (most likely it was trying to resolve from localhost) but after i applied the above, openvpn push rules correctly applied and my computer now accepts the dns from my server automatically.
my setup:
openvpn server -> openvpn on phone -> usb tether -> computer
this way my computer's traffic is routed through openvpn on my phone so dont have to install it on my computer basically a portable vpn 'server'. this works for wifi as well so any clients that connect will also route through vpn.
Click to expand...
Click to collapse
great, it also worked for me (Samsung S7, Proximus operator in Belgium), thanks!!!

[Q] Trouble using Adblock Plus with Xprivacy/Orbot/Orwall

Hi all, first post since I lost my last account login. On to business:
First off, I'm running an HTC One XL which doesn't seem to be an option in the user CP, whatever.
HTC One XL, rooted.
TWRP 2.7.1.0
4.4.4 Paranoid Android 4.6 Beta 1
Minimal GAPPS, just the framwork and play store.
Xposed Framework running Xprivacy
Orwall forcing all traffic through Orbot
Full disk encryption.
The problem is that I want to install Adblock Plus and have all traffic, WiFi and mobile be filtered for ads. I just can't seem to get it working.
I install Adblock, even allow it SU, I've tried turning on 'Local Traffic' in Orwall, forcing it through Tor, keeping it fenced and allowing it to bypass Tor. I've added a proxy address of 'localhost' on port '2020' of both the WiFi connection and my APN. Nothing, Orbot connects as usual but no traffic is getting through, I think Adblock's local server is being blocked somewhere but I don't know where.
I'm sure it worked briefly after I first installed it but then my phone randomly rebooted and I've not got it working since.
I'm very happy with my build up to this point with security and anonymity being very strong in the setup. Adblock would really put the cherry on top.
Help?
EDIT: Thinking about this further, I realsied that both Orbot and Adblock Plus are both proxy services and need to be configured in series such as:
WiFi or Mobile connection -> Orbot -> Adblock Plus
In order to configure a proxy in Orbot requires root permissions, something the Orbot devs strongly suggest you do not do and I'm inclined to agree. Therefor I've decided to use a Host file solution instead, maybe this thread will be of use to someone if they stumble upon it via a search engine. I hope so, I've spent far too many hours on this already.

Categories

Resources