Firing Script Upon obtaining 3G (edge) IP - Android Software Development

Hello all,
I am trying to run a script to change dns servers used by my ISP. currently, unfortunately I can't set this in apn settings.
How can I run a script when IP address is leased through 3G connection?
I tried a /etc/ppp/ip-up script but it doesn't get fired.. I think pppd is not working, something else is working..
Best,

ok i think i got it.
setprop net.rmnet0.dns1 8.8.8.8
setprop net.rmnet0.dns2 8.8.4.4
and
setprop net.dns1 8.8.8.8
setprop net.dns2 8.8.4.4

i dont know if this is persistent so check it with getprop in a terminal/shell

@nicandris
thanks for trying actually those are commands that I'll put in my script. that dns settings change every time i associate with the apn.
I don't want to develop an application just for listening apn changes, so, that was why I asked for a auto-firing script.

so you want a script/program that checks if you are connected with 3G and fires up a script?

Related

[MOD]Speed up internet over Wifi/Data

Well, this search started around solving the intermittent data transfer problem and network timeouts on my edge and 3G network and finally came down to this.
I changed the DNS on phone to OpenDNS and finally it all sorted out like magic. Seems like Vodafone India wasn't really having the best of DNS Servers..
So using the adb shell or any terminal, enter the following commands. You need to have busybox installed to run these commands. Most custom ROMs already have it.
1. getprop | grep dns
rmnet0 is the interface name for the 3G connection.
net.rmnet0.dns1 and net.rmnet0.dns2 are the properties to be changed to point to OpenDNS server. Since, these properties are changed after the connection is established, net.dns1 and net.dns2 also have to be changed.
Setprop net.rmnet0.dns1 208.67.220.220
Setprop net.rmnet1.dns2 207.67.222.222
Setprop net.dns1 208.67.220.220
Setprop net.dns2 207.67.222.222
Hope this solves all such problems you face on your phones.
Hit the thanks button if it helped...
You could also use Google's DNS servers as stated by NoDataFound...
Google's DNS Servers - 8.8.8.8 and 4.4.4.4
Sent from Bionix 1.3.1 sipping Tiger's Blood on Vibrant.
Reserved for comments.
Hope this helps some people out!
can I ask what is the cause of this problem?
Sent from my SGH-T959 using XDA App
In my case, it was a bad DNS Server from my operator. Plus its been even more severe since the Japan tsunami and I'm in India here..
So this helped me alot. And OpenDNS has been proven reliable across the world, so thought of using it...
I prefer using googles dns servers in this situation. Easy to remember and quick. http://code.google.com/speed/public-dns/
Anyway to get it to stick after a reboot? mine keeps reverting back.
I guess i could add it to init.rc right?
NoDataFound said:
I prefer using googles dns servers in this situation. Easy to remember and quick. http://code.google.com/speed/public-dns/
Click to expand...
Click to collapse
For Google:
"Configure your network settings to use the IP addresses 8.8.8.8 and*8.8.4.4 as your DNS servers"

Clearwire Ubee Atlas Stick / Freedompop

Has anyone been able to get Clearwire / Freedompops 4G USB Stick to work in any rom?
It supposedly is compatible with android under with RNDIS or CDC support. Plugging it in, my a500 recognizes it and asks to start PPPWidget, however PPP widget does not find a driver. Model is the ubee atlas usb stick.
Under terminal emulator I've tried:
dhcpcd eth0
netset.eth0.dns1 208.67.222.222
ifconfig displays eth0 with a MAC address matching my stick and an IP address, but I've got no connection in browser.
This is under the latest flexreaper rom.
hey gtjeffc,
i got my ubee stick just today from freedompop, and all i had to do was run 'dhclient eth1'
there's a web interface available for the modem at 192.168.14.1
also, this was in my resolv.conf:
search clearwire-wmx.net
nameserver 192.168.14.1
nameserver 66.233.172.12
nameserver 75.94.255.12
pakf said:
hey gtjeffc,
i got my ubee stick just today from freedompop, and all i had to do was run 'dhclient eth1'
there's a web interface available for the modem at 192.168.14.1
also, this was in my resolv.conf:
search clearwire-wmx.net
nameserver 192.168.14.1
nameserver 66.233.172.12
nameserver 75.94.255.12
Click to expand...
Click to collapse
Excellent news. Did you need superuser permission to run it? I will try it when I get home - hopefully it will work and we can put in a script that will run when the modem is detected to auto-run when it's inserted in the USB port.
gtjeffc said:
Excellent news. Did you need superuser permission to run it? I will try it when I get home - hopefully it will work and we can put in a script that will run when the modem is detected to auto-run when it's inserted in the USB port.
Click to expand...
Click to collapse
Ok, got it to work. At first I could only get to 192.168.14.1, until I added another interface in dhcpcd.conf. I set the ubee stick to NAT mode as well.
It works, but not all applications recognize that there is a network connection (Play, Maps).
What ROM are you using?
Let me get this straight. Freedompop now runs on Android tablets and if so has anyone cloned to Android phones yet by using the MAC Address. I know there's a Iphone sleeve but I'd like to reduce the carrying load.
gtjeffc said:
Ok, got it to work. At first I could only get to 192.168.14.1, until I added another interface in dhcpcd.conf. I set the ubee stick to NAT mode as well.
It works, but not all applications recognize that there is a network connection (Play, Maps).
What ROM are you using?
Click to expand...
Click to collapse
What ROM are you on? I tried in on one of the jellytime builds and I can get to the management interface but in NAT mode it looks like dns requests are never fulfilled despite having dhcpcd entries and resolv.conf entries.
---------- Post added at 10:51 PM ---------- Previous post was at 10:25 PM ----------
sidenote, I just tried to access google directly via ip and it worked, check my ip and its the stick's ip.. so something is wrong with the dns settings of the stick.
Okay, manually setting the ip works I did both
setprop net.eth0.dns1 x.x.x.x
and
setprop net.dns1 x.x.x.x
and it worked after the second one, so I'm not sure if the first is needed. Now to figure out a way to automatically run dhcpcd eth0 when the usb is inserted..
UBee Stick PXU1964 4G - noobe trying to get it working
Hey There hoping for a little direction.
I tried PPPWidget on my Acer A500 rooted with JellyTime+ Ver. 4.1.2. I have a 4G dongle from Freedompop it's a Ubee Stick PXU1964.
Plugging in the stick It seams to lock and get 2 bars of signal. The Widget recognizes its plugged in but then says "no drivers". The Widget directory shows no files in any of folders - cfg,lib or log I don't know if that is normal or not.
Using the Terminal emulator I was able to get to the stick and in the browser display the setup screen. But I still can't get to the net.
Anyone get any further??
Any help would be appreciated sure would like to get this working.:good:
Here is what I have done so far:
on tablet launch terminal prgm
type: su "rtn"
type: netcfg (check eth0 or eth1or usb0 or usb1 is up; if down do next step)
type: ifconfig eth0 up
type: dhcpcd eth0
type: setprop dns1 66.233.127.12 (or use whatever DNS server you wish)
type: ifconfig eth0 192.168.0.2 (just picked this ip)
Launch browser go to stick setup adr (192,168.14.1) - displays Ubee Stick setup screen
try google.com says not connected
Update: March 7,2013
YAHOOOO Success~~
I have successfully been able to repeatedly connect to the FreedomPop 4G network with my A500 and JellyTime (JellyBean Spinoff Custom ROM). And also I have optimized the process to just 4 steps and it does not require any connections to a PC or other device.
This requires the tablet be Rooted.
Plug in your FreedomPop Ubee Stick PXU1964 USB 4G Dongle - should work with any dongle though
Launch your Terminal emulator.
Check to see if the Dongle green light stays on indicating it has acquired a signal and that
you have some bars of signal.
At the prompt
type: su ( To invoke super user access)
type: Ifconfig eth0 192.168.1.12 ( Can be any IP address you choose (You can type: netcfg to confirm the Dongle is seen by the Tablet)
type: dhcpcd eth0 ( Wait for lease to complete and next prompt.)
type: setprop net.dns1 8.8.8.8 (use any dns server - I used Google's free dns server or 8.8.4.4 also Google)
Thats all there is to it.
You can check things are setup correctly by:
typing: netcfg
It will reply with all connected devices and eth0 will show the IP address and port - mine was 192.168.1.12/24 and reading
further it shows the MAC address of the Dongle.
Launch your favorite browser and input 192.168.14.1 (for the FreedomPop PXU1964) for the URL or what ever URL is required by your device.
The FreedomPop setup screen should appear. Click on Network about center screen and it should show how many bytes transferred.
Click on the Advanced Link and insure it's set to NAT Mode.
Open another browser window and select your favorite Web Site URL and it should come up!
Happy 4g browsing!!!!! Seems to work pretty good even with one or two bars although the download is fastest when all the bars are lite and
the signal to noise ratio is at its best......
Next project is to script this process and automate it - unfortunately I don't know how to do that so I have some studying to do before I can ----
That is unless someone takes pity on me and points me in the right direction.... Any takers to help an old man? (;>
Thanx in advance.....
Last Update April 15th, 2013
Within a couple of days of my last post I found out how to automate the process above. It is actually very simple. It would have been nice if someone would have thrown a dog bone as it would have only taken a couple of minutes. Guess nobody ever looks at these old posts?? Anyway If your trying to connect try this it might work.
Download SManager and SMWidgets from the Google Play Store - the free version(s) works fine or you can use any Text Editor although SManager ads is really nice for making scripts. SMWidgets is needed to make the widget and generate the Icon to launch your application from the Home Screen.
Launch SManager access the tool bar and select "New Script" Enter a filename, I choose FreedomPop.sh - Notice the ( .SH) that tells android it is a script - similar to .bat in DOS.
Enter the filename and press ok. SManager responds with "Open With..." and provides options for editing. Choose SM Editor or a text editor.
After the line: #!/system/bin.sh
type: Ifconfig eth0 192.168.1.12 ( Can be any IP address you choose) Optional -You can type: netcfg to confirm the Dongle is seen by the Tablet
type: dhcpcd eth0 ( Wait for lease to complete and next prompt.)
type: setprop net.dns1 8.8.8.8 (use any dns server - I used Google's free dns server or 8.8.4.4 also Google)
Select save or back out to the file screen, it will ask if you wish to save your work. Say yes. Find your script in the listing and press and hold until the menu comes up. Select (Open as...) and Open As... Script/Executable.
On the 3rd Line select the "SU" icon.
On the default (4th Line)make sure to select "Is script".
At this point you can change the Alias which should contain the script name you choose.
Save your work.
Hit run to test out your script.
Lastly grab the SMWidgets icon from the widgets icons screen and move it to an available space on your home screen. It will launch and select
"Add one script widget" Select your script and it will create a quick launch Icon that will launch your script.
Good Luck!
Thank you!
Dude thank you very much on this useful tutorial. I bought the freedompop stick and when I plugged it in, it was not working and I thought it is just another waste of my money....until I ended up with your tutorial. Thanks a lot, and you method worked on my rooted Verizon Galaxy Note 2 (stock rom).:highfive:
PBates123 said:
Hey There hoping for a little direction.
I tried PPPWidget on my Acer A500 rooted with JellyTime+ Ver. 4.1.2. I have a 4G dongle from Freedompop it's a Ubee Stick PXU1964.
Plugging in the stick It seams to lock and get 2 bars of signal. The Widget recognizes its plugged in but then says "no drivers". The Widget directory shows no files in any of folders - cfg,lib or log I don't know if that is normal or not.
Using the Terminal emulator I was able to get to the stick and in the browser display the setup screen. But I still can't get to the net.
Anyone get any further??
Any help would be appreciated sure would like to get this working.:good:
Here is what I have done so far:
on tablet launch terminal prgm
type: su "rtn"
type: netcfg (check eth0 or eth1or usb0 or usb1 is up; if down do next step)
type: ifconfig eth0 up
type: dhcpcd eth0
type: setprop dns1 66.233.127.12 (or use whatever DNS server you wish)
type: ifconfig eth0 192.168.0.2 (just picked this ip)
Launch browser go to stick setup adr (192,168.14.1) - displays Ubee Stick setup screen
try google.com says not connected
Update: March 7,2013
YAHOOOO Success~~
I have successfully been able to repeatedly connect to the FreedomPop 4G network with my A500 and JellyTime (JellyBean Spinoff Custom ROM). And also I have optimized the process to just 4 steps and it does not require any connections to a PC or other device.
This requires the tablet be Rooted.
Plug in your FreedomPop Ubee Stick PXU1964 USB 4G Dongle - should work with any dongle though
Launch your Terminal emulator.
Check to see if the Dongle green light stays on indicating it has acquired a signal and that
you have some bars of signal.
At the prompt
type: su ( To invoke super user access)
type: Ifconfig eth0 192.168.1.12 ( Can be any IP address you choose (You can type: netcfg to confirm the Dongle is seen by the Tablet)
type: dhcpcd eth0 ( Wait for lease to complete and next prompt.)
type: setprop net.dns1 8.8.8.8 (use any dns server - I used Google's free dns server or 8.8.4.4 also Google)
Thats all there is to it.
You can check things are setup correctly by:
typing: netcfg
It will reply with all connected devices and eth0 will show the IP address and port - mine was 192.168.1.12/24 and reading
further it shows the MAC address of the Dongle.
Launch your favorite browser and input 192.168.14.1 (for the FreedomPop PXU1964) for the URL or what ever URL is required by your device.
The FreedomPop setup screen should appear. Click on Network about center screen and it should show how many bytes transferred.
Click on the Advanced Link and insure it's set to NAT Mode.
Open another browser window and select your favorite Web Site URL and it should come up!
Happy 4g browsing!!!!! Seems to work pretty good even with one or two bars although the download is fastest when all the bars are lite and
the signal to noise ratio is at its best......
Next project is to script this process and automate it - unfortunately I don't know how to do that so I have some studying to do before I can ----
That is unless someone takes pity on me and points me in the right direction.... Any takers to help an old man? (;>
Thanx in advance.....
Last Update April 15th, 2013
Within a couple of days of my last post I found out how to automate the process above. It is actually very simple. It would have been nice if someone would have thrown a dog bone as it would have only taken a couple of minutes. Guess nobody ever looks at these old posts?? Anyway If your trying to connect try this it might work.
Download SManager and SMWidgets from the Google Play Store - the free version(s) works fine or you can use any Text Editor although SManager ads is really nice for making scripts. SMWidgets is needed to make the widget and generate the Icon to launch your application from the Home Screen.
Launch SManager access the tool bar and select "New Script" Enter a filename, I choose FreedomPop.sh - Notice the ( .SH) that tells android it is a script - similar to .bat in DOS.
Enter the filename and press ok. SManager responds with "Open With..." and provides options for editing. Choose SM Editor or a text editor.
After the line: #!/system/bin.sh
type: Ifconfig eth0 192.168.1.12 ( Can be any IP address you choose) Optional -You can type: netcfg to confirm the Dongle is seen by the Tablet
type: dhcpcd eth0 ( Wait for lease to complete and next prompt.)
type: setprop net.dns1 8.8.8.8 (use any dns server - I used Google's free dns server or 8.8.4.4 also Google)
Select save or back out to the file screen, it will ask if you wish to save your work. Say yes. Find your script in the listing and press and hold until the menu comes up. Select (Open as...) and Open As... Script/Executable.
On the 3rd Line select the "SU" icon.
On the default (4th Line)make sure to select "Is script".
At this point you can change the Alias which should contain the script name you choose.
Save your work.
Hit run to test out your script.
Lastly grab the SMWidgets icon from the widgets icons screen and move it to an available space on your home screen. It will launch and select
"Add one script widget" Select your script and it will create a quick launch Icon that will launch your script.
Good Luck!
Click to expand...
Click to collapse
Got 169.254 ip addr
PBates123 said:
Hey There hoping for a little direction.
I tried PPPWidget on my Acer A500 rooted with JellyTime+ Ver. 4.1.2. I have a 4G dongle from Freedompop it's a Ubee Stick PXU1964.
Plugging in the stick It seams to lock and get 2 bars of signal. The Widget recognizes its plugged in but then says "no drivers". The Widget directory shows no files in any of folders - cfg,lib or log I don't know if that is normal or not.
Using the Terminal emulator I was able to get to the stick and in the browser display the setup screen. But I still can't get to the net.
Anyone get any further??
Any help would be appreciated sure would like to get this working.:good:
Here is what I have done so far:
on tablet launch terminal prgm
type: su "rtn"
type: netcfg (check eth0 or eth1or usb0 or usb1 is up; if down do next step)
type: ifconfig eth0 up
type: dhcpcd eth0
type: setprop dns1 66.233.127.12 (or use whatever DNS server you wish)
type: ifconfig eth0 192.168.0.2 (just picked this ip)
Launch browser go to stick setup adr (192,168.14.1) - displays Ubee Stick setup screen
try google.com says not connected
Update: March 7,2013
YAHOOOO Success~~
I have successfully been able to repeatedly connect to the FreedomPop 4G network with my A500 and JellyTime (JellyBean Spinoff Custom ROM). And also I have optimized the process to just 4 steps and it does not require any connections to a PC or other device.
This requires the tablet be Rooted.
Plug in your FreedomPop Ubee Stick PXU1964 USB 4G Dongle - should work with any dongle though
Launch your Terminal emulator.
Check to see if the Dongle green light stays on indicating it has acquired a signal and that
you have some bars of signal.
At the prompt
type: su ( To invoke super user access)
type: Ifconfig eth0 192.168.1.12 ( Can be any IP address you choose (You can type: netcfg to confirm the Dongle is seen by the Tablet)
type: dhcpcd eth0 ( Wait for lease to complete and next prompt.)
type: setprop net.dns1 8.8.8.8 (use any dns server - I used Google's free dns server or 8.8.4.4 also Google)
Thats all there is to it.
You can check things are setup correctly by:
typing: netcfg
It will reply with all connected devices and eth0 will show the IP address and port - mine was 192.168.1.12/24 and reading
further it shows the MAC address of the Dongle.
Launch your favorite browser and input 192.168.14.1 (for the FreedomPop PXU1964) for the URL or what ever URL is required by your device.
The FreedomPop setup screen should appear. Click on Network about center screen and it should show how many bytes transferred.
Click on the Advanced Link and insure it's set to NAT Mode.
Open another browser window and select your favorite Web Site URL and it should come up!
Happy 4g browsing!!!!! Seems to work pretty good even with one or two bars although the download is fastest when all the bars are lite and
the signal to noise ratio is at its best......
Next project is to script this process and automate it - unfortunately I don't know how to do that so I have some studying to do before I can ----
That is unless someone takes pity on me and points me in the right direction.... Any takers to help an old man? (;>
Thanx in advance.....
Last Update April 15th, 2013
Within a couple of days of my last post I found out how to automate the process above. It is actually very simple. It would have been nice if someone would have thrown a dog bone as it would have only taken a couple of minutes. Guess nobody ever looks at these old posts?? Anyway If your trying to connect try this it might work.
Download SManager and SMWidgets from the Google Play Store - the free version(s) works fine or you can use any Text Editor although SManager ads is really nice for making scripts. SMWidgets is needed to make the widget and generate the Icon to launch your application from the Home Screen.
Launch SManager access the tool bar and select "New Script" Enter a filename, I choose FreedomPop.sh - Notice the ( .SH) that tells android it is a script - similar to .bat in DOS.
Enter the filename and press ok. SManager responds with "Open With..." and provides options for editing. Choose SM Editor or a text editor.
After the line: #!/system/bin.sh
type: Ifconfig eth0 192.168.1.12 ( Can be any IP address you choose) Optional -You can type: netcfg to confirm the Dongle is seen by the Tablet
type: dhcpcd eth0 ( Wait for lease to complete and next prompt.)
type: setprop net.dns1 8.8.8.8 (use any dns server - I used Google's free dns server or 8.8.4.4 also Google)
Select save or back out to the file screen, it will ask if you wish to save your work. Say yes. Find your script in the listing and press and hold until the menu comes up. Select (Open as...) and Open As... Script/Executable.
On the 3rd Line select the "SU" icon.
On the default (4th Line)make sure to select "Is script".
At this point you can change the Alias which should contain the script name you choose.
Save your work.
Hit run to test out your script.
Lastly grab the SMWidgets icon from the widgets icons screen and move it to an available space on your home screen. It will launch and select
"Add one script widget" Select your script and it will create a quick launch Icon that will launch your script.
Good Luck!
Click to expand...
Click to collapse
Hi PBates123,
I followed your direction and successfully put the eth0 ip as 192.168.1.12. eth0 is up. However, every time I run dhcpcd eth0, it say "using IPv4LL 169.254.109.250" I cannot get to 192.168.14.1, nor the internet.
I notice that the MAC id show in eth0 and my stick MAC id is different by only the last digit, it's 9 instead of 7. Is this normal ? Also, do you suppose to be able to browser the content of your usb freedom stick? Since mine seems not to be mounted.
I also have the Freedompop Ubee Stick PXU1964. My android tablet is Curtis KLu LT7033.
Any help would be appreciated. I have gotten this far and went through a great pain to successfully root my Klu tablet...

[Q] Microsoft virtual network adapter not working properly!

Hello i am 19 years old so i don't exactly have lots of experience with all this. (iv gone down the route of programming in c++. only started looking into Batch seriously for the last few weeks) I am having a problem which i could use help with. Lately i have been using the Microsoft virtual network adapter (im sure heard of it!)
I wrote a small batch file for the purpose of starting the network. (ill copy and paste it in at the bottom) now this program worked perfectly for about a month but now i cant get a device to connect to the network as nothing can obtain an ip address.
What i did to troubleshoot..
1. I changed the ip settings from dhcp to static.
this allowed me to connect to the network but i couldn't access the internet.
2. I checked the properties of the network from the control panel and it
shows that my network is sending packets but is not receiving any. I tried
running windows troubleshooting on the network and it tells me that the
network does not have a valid ip configuration. even though it is set
dhcp.
3. I tried typing the following into cmd "netsh interface ip reset"
in return i get;
"C:\Windows\system32>netsh interface ip reset
Resetting Global, OK!
Resetting Interface, OK!
Resetting Unicast Address, OK!
Resetting Neighbor, OK!
Resetting Path, OK!
Resetting Route, OK!
Resetting , failed.
Access is denied.
Resetting , OK!
Restart the computer to complete this action."
why does it say resetting failed followed by access denied?
i think this is the cause of "failed to obtain ip address problem but why then does it not allow internet connectivity through the static ip settings? is there something i have missed or is something corrupt maybe?
I also tried going to device manager and uninstalling the network adapter from their then allowing windows to find it and re-install the driver.
Thank you for having the patients to read this far. As i said at the beginning i would copy paste my program here so you can see exactly what im trying to do here.
Thanks again.
@ECHO off
color a
:beginning
echo To Create a Hotspot with the name "hotspot" and
echo a password of "12345678" just press ENTER to the first two
echo options
echo ............................................................................... ################################################################################
set /p ssid=Enter name for your network: || set ssid=hotspot
set /p key=Enter password for network(must be 8 characters or longer!): || set key=12345678
netsh wlan set hostednetwork mode=allow ssid=%ssid% key=%key%
netsh wlan start hosted network
:refresh
netsh wlan show hostednetwork
echo Press ENTER to Refresh information!
echo ............................................................................... ################################################################################
echo Enter "RR" to Restart!
echo ............................................................................... ################################################################################
echo Enter "E" to Exit!
echo ............................................................................... ################################################################################
set /p option= || set option=r
if %option%==R goto :refresh
if %option%==r goto :refresh
if %option%==RR goto :beginning
if %option%==rr goto :beginning
if %option%==E goto :end
if %option%==e goto :end
:end
netsh wlan stop hostednetwork
Feel free to use this code for doing anything you want to do with it. (but im sure there are better versions of this that do the same thing online too)
apologies if this thread should not be here. just running out of options for getting this fixed. I believe a forum full of people who hack and mod win 8 probably have the best understanding of it!
feherneoh said:
I could only notice, that where there are 3 lines of netsh wlan next to each other, the middle one has a space in 'hostednetwork', the other 2 don't.
Sent from my Htc Hd2 using xda app-developers app
Click to expand...
Click to collapse
yeah the commands can be either "netsh wlan start hostednetwork" or "netsh wlan start hosted network" it makes no difference.
but yeah that is bad coding on my part never the less.
I know the program works fine its something else causing it not to work properly.

[Q] Has Anyone Got a DNS Service Working Yet?

Hello,
I'm trying to set up USAccess on my Nexus Player. As there are no existing guides, I've just been using standard Android guides. So far, I am unable to connect to the internet after changing my DNS settings. I've been searching endlessly and have only found questions regarding this topic before the Nexus Player was released.
I
I tested on my NP both by changing the DNS settings on the device and at the router level and did not have any luck connecting to Netflix on either. With the DNS set on the device, the internet connection wouldn't work on any app but when I changed it on the router, apps worked (Play store for example) but Netflix wouldn't connect.
I wonder if it is similar to the Chromecast where the DNS settings are hardcoded and you need to set up some modifications on your router (or have root access to make the necessary changes).
My suggestion would be to open a ticket with USAccess and they may be able to assist/verify that everything is configured correctly.
Setting DNS on my router works for me for accessing Australian content from the states. So this seems to be a netflix specific thing.
Sent from my Nexus 5
I'm in Canada and Netflix usa works fine for me (go to settings in Netflix and under member if it says US then it should be working) I use unblockus I have my dns settings changed on the router. Now just need a way for the nexus player to load the usa play store, this has always been tricky on Android. Worst case I will sideload Hulu for the time being.
I'm also up in Canada, and I was able to use unotelly's DNS to access Netflix US. I did notice that after changing the DNS settings on the player itself, I couldn't connect to anything until I changed the language setting in the settings app to us English (instead of Canadian), and although everything is connecting now, I've lost the recommendations bar (it just says recommendations are not available right now)
So far USAccess.ca is not working here either. Going to need to do more digging and see what the device is actually trying to do!
I am also up in Canada and I use AdFreeTime DNS service, however I cannot get Netflix to work. When I change the DNS addresses on my router to AdFreeTime, Netflix throws an -100 connection error, but everything else connects fine. I am re-routing google's dns services 8.8.8.8 and 8.8.4.4 to AdFreeTime DNS servers through iptables on my Asus router. Maybe that's an issue?
Can someone from Canada who has Netflix US working post exactly how they got Netflix to connect properly? Thank you.
I just got usaccess.ca working... It turns out I think my version of DD-WRT had some dnsmasq issues (even with strict-order enabled). I flashed a newer release of DD-WRT so i could get tcpdump working and when i finally went to capture the traffic, low and behold netflix was working with the US DNS servers set in dnsmasq. I could even watch US content
Now i just need to find that Hulu Plus .apk!!!
Elrondolio said:
I am also up in Canada and I use AdFreeTime DNS service, however I cannot get Netflix to work. When I change the DNS addresses on my router to AdFreeTime, Netflix throws an -100 connection error, but everything else connects fine. I am re-routing google's dns services 8.8.8.8 and 8.8.4.4 to AdFreeTime DNS servers through iptables on my Asus router. Maybe that's an issue?
Can someone from Canada who has Netflix US working post exactly how they got Netflix to connect properly? Thank you.
Click to expand...
Click to collapse
As a followup: I got Netflix US content working properly on the NP by setting my router to my US dsn services, but I had to disable routing the google dns servers to my AdFreeTime dns servers (which I was doing through an iptables script on my custom Asus AC68U router.) This kind of blows as routing google dns to US dns services such as AdFreeTime, Unblock US, etc was the only way to make the Chromecast work with US Netflix and other services from Canada.
There has to be a way to keep those pesky google dns services built in to Chromecast and the Nexus Player routed to unblocked US dns services without messing up Netflix on the NP.
Any ideas would be greatly welcomed.
The Nexus Player doesn't have hard coded DNS servers. I was able to change my WIFI connection from DNS to STATIC; enter in static, gateway, and DNS (USAccess) IPs and a day later, the settings took and my Netflix region change to US EN.
BlackVariant said:
Hello,
I'm trying to set up USAccess on my Nexus Player. As there are no existing guides, I've just been using standard Android guides. So far, I am unable to connect to the internet after changing my DNS settings. I've been searching endlessly and have only found questions regarding this topic before the Nexus Player was released.
Click to expand...
Click to collapse
+1 for this problem, I get the error -100, using USAccess. Have tried setting a static profile with USAccess DNS and with the IP's on my router. Works fine on my Amazon Fire TV but not the Nexus Player.
I had the same problem with usaccess, so I used the trial of unotelly to compare. unotelly works perfectly including displaying the US play store. Could be worth the extra expense, i have 7 days left to decide .
So following this:
http://forum.xda-developers.com/nexus-player/general/how-to-change-dns-ip-t2953282
USAccess is still not working for you?
I'm using 107.20.195.51 not their new region switching DNS IP.
habskilla said:
So following this:
http://forum.xda-developers.com/nexus-player/general/how-to-change-dns-ip-t2953282
USAccess is still not working for you?
I'm using 107.20.195.51 not their new region switching DNS IP.
Click to expand...
Click to collapse
I do all that and it says ip address not valid. Could you give a better description on what exactly ip addresses and gateways ishould use. Id really appreciate it
OathYvne said:
I do all that and it says ip address not valid. Could you give a better description on what exactly ip addresses and gateways ishould use. Id really appreciate it
Click to expand...
Click to collapse
Everyone has a different home network setup. So, I'll try to help you out.
Go to:
Settings
Network
Wi-Fi Connected
Pick your current Wi-Fi connection
Status info
Write down the IP address
e.g 192.168.2.23
When you go back to your Advanced settings, use the following:
IP address = IP address you wrote down from above (e.g. 192.168.2.23)
Gateway = You will have to figure out. It is usually the first three sets of numbers from your IP address and .1
So, from my example, Gateway = 192.168.2.1
Network prefix length = 24
DNS 1 = Enter in your DNS IP
DNS 2 = Use your secondary DNS IP
I use USAccess so my numbers are
Primary DNS: 107.20.195.51 Secondary DNS: 107.20.190.171
Hit next and you should see settings saved message.
habskilla said:
Everyone has a different home network setup. So, I'll try to help you out.
Go to:
Settings
Network
Wi-Fi Connected
Pick your current Wi-Fi connection
Status info
Write down the IP address
e.g 192.168.2.23
When you go back to your Advanced settings, use the following:
IP address = IP address you wrote down from above (e.g. 192.168.2.23)
Gateway = You will have to figure out. It is usually the first three sets of numbers from your IP address and .1
So, from my example, Gateway = 192.168.2.1
Network prefix length = 24
DNS 1 = Enter in your DNS IP
DNS 2 = Use your secondary DNS IP
I use USAccess so my numbers are
Primary DNS: 107.20.195.51 Secondary DNS: 107.20.190.171
Hit next and you should see settings saved message.
Click to expand...
Click to collapse
Thanks alot man. Did you have to change your date and time to american? cause when i open netflix i get a -201 error and it says make sure your date and time are correct and youre connected to the internet. I changed it to american date and time but still has same error.
Never had that error.
habskilla said:
Everyone has a different home network setup. So, I'll try to help you out.
Go to:
Settings
Network
Wi-Fi Connected
Pick your current Wi-Fi connection
Status info
Write down the IP address
e.g 192.168.2.23
When you go back to your Advanced settings, use the following:
IP address = IP address you wrote down from above (e.g. 192.168.2.23)
Gateway = You will have to figure out. It is usually the first three sets of numbers from your IP address and .1
So, from my example, Gateway = 192.168.2.1
Network prefix length = 24
DNS 1 = Enter in your DNS IP
DNS 2 = Use your secondary DNS IP
I use USAccess so my numbers are
Primary DNS: 107.20.195.51 Secondary DNS: 107.20.190.171
Hit next and you should see settings saved message.
Click to expand...
Click to collapse
I have done this, tried three different wifi networks, both with and without USAccess. I'm starting to think there is something with Netflix that it just won't work in Sweden.
Hasn't anyone who previously had the -100 error been able to resolve it?
Does anyone know what the netflix app is trying to do when we get the -100 error? I would like to find this out so I can tell my ISP about it as they offer their own DNS redirection service so we can get access to things like netflix in the USA.
I have 8.8.4.4 and 8.8.8.8 redirected to a fake IP so that those addresses timeout at the router, but netflix will still not load unless I put unotelly's DNS directly on the NP. My roku on the other hand works without putting unotelly's DNS settings.

Easy Way of Setting Up PIA on DD-WRT

I see alot of questions about VPN's so I've decided to post an easy way to setup PIA VPN on a router running DD-WRT. I'm currently using a Netgear R8000 as a VPN router. Please note that running a VPN on your router will slow your speeds way down. I'm currently hitting 15-30mbps which is ok to run the firestick. The settings I am posting is what seems to be the fastest and most reliable for me. You can alway change the server you want to use but do not change anything else. Once your done rebooting you can test to make sure you are completely secure on the PIA webpage then go and run your DNS Leak Tests. If you are going to run a double router setup (which I am running) let me know and I'll post the setup for that also.
First you need to login to your router. Normally you would type 192.168.1.1 into the search bar. Default username for Netgear is "admin", password is "password".
In the DD-WRT Control Panel page, navigate to Setup > Basic Setup.
Under Network Address Server Settings (DHCP), set:
Static DNS 1 = 4.2.2.1
Static DNS 2 = 4.2.2.2
Static DNS 3 = 4.2.2.3
Use DNSMasq for DHCP = Checked
Use DNSMasq for DNS = Checked
DHCP-Authoritative = Checked
Save and Apply Settings.
Next navigate to Administration > Commands.
Cut and paste this insert your username and password USERNAME="user-name-here" and PASSWORD="password-here" , click the Save Startup button, then Reboot Router. :
#!/bin/sh
USERNAME="user-name-here"
PASSWORD="password-here"
PROTOCOL="udp"
# Add - delete - edit servers between ##BB## and ##EE##
REMOTE_SERVERS="
##BB##
# US - MIDWEST
remote us-midwest.privateinternetaccess.com 8080
##EE##
"
#### DO NOT CHANGE below this line unless you know exactly what you're doing ####
CA_CRT='-----BEGIN CERTIFICATE-----
MIID2jCCA0OgAwIBAgIJAOtqMkR2JSXrMA0GCSqGSIb3DQEBBQUAMIGlMQswCQYD
VQQGEwJVUzELMAkGA1UECBMCT0gxETAPBgNVBAcTCENvbHVtYnVzMSAwHgYDVQQK
ExdQcml2YXRlIEludGVybmV0IEFjY2VzczEjMCEGA1UEAxMaUHJpdmF0ZSBJbnRl
cm5ldCBBY2Nlc3MgQ0ExLzAtBgkqhkiG9w0BCQEWIHNlY3VyZUBwcml2YXRlaW50
ZXJuZXRhY2Nlc3MuY29tMB4XDTEwMDgyMTE4MjU1NFoXDTIwMDgxODE4MjU1NFow
gaUxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJPSDERMA8GA1UEBxMIQ29sdW1idXMx
IDAeBgNVBAoTF1ByaXZhdGUgSW50ZXJuZXQgQWNjZXNzMSMwIQYDVQQDExpQcml2
YXRlIEludGVybmV0IEFjY2VzcyBDQTEvMC0GCSqGSIb3DQEJARYgc2VjdXJlQHBy
aXZhdGVpbnRlcm5ldGFjY2Vzcy5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ
AoGBAOlVlkHcxfN5HAswpryG7AN9CvcvVzcXvSEo91qAl/IE8H0knKZkIAhe/z3m
hz0t91dBHh5yfqwrXlGiyilplVB9tfZohvcikGF3G6FFC9j40GKP0/d22JfR2vJt
4/5JKRBlQc9wllswHZGmPVidQbU0YgoZl00bAySvkX/u1005AgMBAAGjggEOMIIB
CjAdBgNVHQ4EFgQUl8qwY2t+GN0pa/wfq+YODsxgVQkwgdoGA1UdIwSB0jCBz4AU
l8qwY2t+GN0pa/wfq+YODsxgVQmhgaukgagwgaUxCzAJBgNVBAYTAlVTMQswCQYD
VQQIEwJPSDERMA8GA1UEBxMIQ29sdW1idXMxIDAeBgNVBAoTF1ByaXZhdGUgSW50
ZXJuZXQgQWNjZXNzMSMwIQYDVQQDExpQcml2YXRlIEludGVybmV0IEFjY2VzcyBD
QTEvMC0GCSqGSIb3DQEJARYgc2VjdXJlQHByaXZhdGVpbnRlcm5ldGFjY2Vzcy5j
b22CCQDrajJEdiUl6zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAByH
atXgZzjFO6qctQWwV31P4qLelZzYndoZ7olY8ANPxl7jlP3YmbE1RzSnWtID9Gge
fsKHi1jAS9tNP2E+DCZiWcM/5Y7/XKS/6KvrPQT90nM5klK9LfNvS+kFabMmMBe2
llQlzAzFiIfabACTQn84QLeLOActKhK8hFJy2Gy6
-----END CERTIFICATE-----'
OPVPNENABLE=`nvram get openvpncl_enable | awk '$1 == "0" {print $1}'`
if [ "$OPVPNENABLE" != 0 ]; then
nvram set openvpncl_enable=0
nvram commit
fi
sleep 10
mkdir /tmp/pia; cd /tmp/pia
echo -e "$USERNAME\n$PASSWORD" > userpass.conf
echo "$CA_CRT" > ca.crt
echo "#!/bin/sh
iptables -t nat -I POSTROUTING -o tun0 -j MASQUERADE" > route-up.sh
echo "#!/bin/sh
iptables -t nat -D POSTROUTING -o tun0 -j MASQUERADE" > route-down.sh
chmod 644 ca.crt; chmod 600 userpass.conf; chmod 700 route-up.sh route-down.sh
sleep 10
echo "client
auth-user-pass /tmp/pia/userpass.conf
management 127.0.0.1 5001
management-log-cache 50
dev tun0
proto $PROTOCOL
comp-lzo adaptive
fast-io
script-security 2
mtu-disc yes
verb 4
mute 5
cipher bf-cbc
auth sha1
tun-mtu 1500
resolv-retry infinite
nobind
persist-key
persist-tun
tls-client
remote-cert-tls server
log-append piavpn.log
ca ca.crt
status-version 3
status status
daemon
$REMOTE_SERVERS" > pia.conf
ln -s /tmp/pia/piavpn.log /tmp/piavpn.log
ln -s /tmp/pia/status /tmp/status
(killall openvpn; openvpn --config /tmp/pia/pia.conf --route-up /tmp/pia/route-up.sh --down /tmp/pia/route-down.sh) &
exit 0
This is a really helpful post because not too many people out there are trying to do this exact thing.
I've tried like heck with my Linksys WRT3200ACM running DD-WRT build 2/17/2018. I have a Fire TV that I use mostly for running sideloaded Android apps and playing local network media from my NAS. I wanted to get the Fire TV to go through PIA on my router and allow the rest of my home network traffic to avoid the VPN.
With the easy GUI, I was able to get PIA to show a stable connection on the DD-WRT Status/VPN page, so I think it's working. The problem arose when I reserved an IP for the Fire TV on my router outside the DHCP range and named that IP as the single one to go through the VPN. I'm told, policy based routing switches the router application of the VPN to white listing only named addresses to use the service. That seemed to work, because as soon as I named an IP for policy based routing, all other traffic jumped to full (non-VPN) speed and showed as unprotected at the PIA website.
The problem was, when the Fire connected to the reserved IP, it immediately showed a loss of internet connectivity. No amount of fiddling with settings has brought joy. I suspect that something in my setup is wrong. Is it okay to set the reserved IP on the router via the MAC/host address? Is it okay to leave the wired Fire TV network setting at default, assuming it just joins the IP reserved for it? (I think so, because the reserved IP setup worked as long as I had the OpenVPN settings disabled) Also, since I've had constant trouble with UDP in my PIA settings, is it okay to switch to TCP as I have done?
Anyway, I finally hit the wall and I'm posting to the collective brain of the internet about this. I guess it's all too vague to solve as there are about a hundred moving parts, but I thought I'd give it a shot.
Thanks!

Resources