Menu Close

Mobile Blocking Setup

This setup will take you through setting up your devices (laptops, mobile phones, tablets etc) to block ads & tracking while not connected to your home Wi-FI.  This process is more involved than the out of the box setup for home only blocking and should only be attempted by confident users.  If something goes wrong you may need help from an advanced user or computer professional!

When you have completed this setup adverts and tracking will also be blocked when you’re connected to another Wi-Fi network (work, free public Wi-Fi) or your mobile provider.  This works is by creating a VPN (Virtual Private Network) between your device and your Raspberry Pi plugged in to the router at home.  VPNs also provide you security when using the internet and prevent your mobile provider and public Wi-Fi providers from snooping on your internet traffic or capturing your login details (e.g. for your internet banking or email).

1. Set-up DDNS & Port Forwarding
2. Install software
3. Generate Certificates
4. Update mobile devices
1. Set-up DDNS & Port Forwarding

First we need to setup a DDNS (Dynamic DNS) name so that if your home IP address changes you can still connect to the VPN we will set-up.

  1. Go to https://noip.com and sign up for a free account
    • You will need to choose a hostname for your home internet eg myhomeinternet.hopto.org. You will need to remember the hostname you have chosen later on in the Install Software step
    • Don't forget to activate your noip.com account by clicking the link in the activation email

Next we will setup port forwarding on your router so your devices can connect back to your Raspberry Pi. Set-up of port forwarding will vary between routers and may involve one step set-up or two step set-up.

 

One Step Set-up

  1. Open a web browser and enter the IP address of your router and press Enter. Your router IP address is usually one of the following
    192.168.0.1192.168.1.0192.168.1.1192.168.1.254
    • If none of the above bring up your router admin page follow these steps to find your routers IP address
  2. You will need to log in to your router
    • This may be prompted when you first access it in step one or when you click one of the options  
    • If you don't know the admin login details then do a quick web search for <ISP name> router login details or visit https://portforward.com/router-password/ and search for your router make & model.  Alternatively you can call your ISP and ask for the router login details
  3. Within your router's admin panel find the option called Port Forwarding. this will most likely be under Advanced
  4. Add a new rule with the following settings
  5. OptionSetting
    NamePiVPNAdblocker
    Type/ProtocolUDP
    Start Port (both internal and external if listed)1194
    End Port (both internal and external if listed)1194
    IP address (this might be listed as Device to forward to)Select or enter 192.168.0.110
    (This is the preconfigured IP address of your Raspberry Pi)
  6. Make sure to save your settings/add the rule

If you have successfully completed the One Step Setup then you do not need to perform the Two Step Setup below. Instead go to the 2. Install Software tab above


Two Step Setup

  1. Open a web browser and enter the IP address of your router and press Enter. Your router IP address is usually one of the following
    192.168.0.1192.168.1.0192.168.1.1192.168.1.254
    • If none of the above bring up your router admin page follow these steps to find your routers IP address
  2. You will need to log in to your router
    • This may be prompted when you first access it in step one or when you click one of the options  
    • If you don't know the admin login details then do a quick web search for <ISP name> router login details or visit https://portforward.com/router-password/ and search for your router make & model.  Alternatively you can call your ISP and ask for the router login details
  3. Within your router's admin panel find the option called Services (this will most likely be under Security or Advanced)
  4. Add a new service with the following settings
  5. OptionSetting
    NamePiVPNAdblocker
    Type/ProtocolUDP
    Start Port1194
    End Port1194
  6. Save the service
  7. Find the option called Firewall Rules (this will most likely be under Security or Advanced)
  8. Under Inbound Services add a new rule with the following settings
  9. OptionSetting
    ServicePiVPNAdblocker (this is the name you created in the previous step)
    ActionAllow Always
    Destination IPv4 LAN AddressSelect or enter 192.168.0.110
    (This is the preconfigured IP address of your Raspberry PI)
  10. Make sure to save or apply your settings
2. Install software

There are two pieces of software we need to install on your Raspberry Pi.  To do this you will need to access your Raspberry Pi remotely. 

 

Please select Mac or Windows below depending on what computer you will be using.

Mac
Windows
Mac
  1. Open Terminal (Applications -> Utilities -> Terminal or via a Spotlight search for Terminal)
  2. Type SSH pi@raspberrypi.local and press Enter (Show me)
    • If this doesn't work you can use the pre-configured IP address instead by typing SSH pi@192.168.0.110 and pressing Enter
  3. Enter the password 3asyAdB1ock3r and press Enter (Show me)
    • If you have changed the password previously then enter the password you changed it to
Windows
  1. Download and install PuTTY for Windows https://www.putty.org/
  2. Start PuTTY (you'll find it in your Start menu)
  3. Enter the below details and click Open (Show me)
    • Host Name - pi@192.168.X.110 (where X is the same number as your router - see here for more information)
    • Port - 22
    • Connection type - SSH
  4. When prompted with PuTTY Security Alert click Yes (Show me)
  5. Enter the password 3asyAdB1ock3r and press Enter (Show me)
    • If you have changed the password previously then enter the password you changed it to

 


The first piece of software we need to install in the noip.com DDNS update client.  This ensures that if your home IP address changes noip.com is notified and you can still access your Raspberry Pi on the move.  These instructions have been taken from the noip.com website

  1. Type mkdir /home/pi/noip and press Enter
  2. Type cd /home/pi/noip and press Enter
  3. Type wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz and press Enter
  4. Type tar vzxf noip-duc-linux.tar.gz and press Enter
  5. Type cd noip-2.1.9-1 and press Enter
  6. Type sudo make and press Enter
  7. Type sudo make install and press Enter
  8. Select eth0 when prompted and press Enter
  9. Enter your noip.com user login or email address when prompted and press Enter
  10. Enter your noip.com password when prompted and press Enter
  11. Enter 5 when prompted to enter and update interval and press Enter
  12. Press N when prompted about running something for successful update
  13. Type sudo chmod 600 /usr/local/etc/no-ip2.conf and press Enter
  14. Type sudo chown root:root /usr/local/etc/no-ip2.conf and press Enter
  15. Type sudo /usr/local/bin/noip2 and press Enter
  16. Type sudo nano /etc/rc.local and press Enter
  17. Insert a line above the exit 0 line (the last line in the file) with sudo /usr/local/bin/noip2
  18. Press Ctrlx then and Enter to save

Now we will install and configure the PiVPN software.  This allows you to create a connection back to your Raspberry Pi securely which is required in order to utilise the ad blocking software.

  1. Type curl -L https://install.pivpn.io | bash and press Enter (Show me)
  2. When prompted press Enter twice (Show me)
     2.2
  3. Select eth0 by pressing the space bar and then press Enter (Show me)
  4. Press Enter twice to accept the Static IP address settings (Show me)
     5.2
  5. Press Enter twice more to accept the user settings (Show me)
     6.2
  6. Press Enter twice more to accept unattended upgrades (Show me)
     7.2
  7. Select UDP by using the arrow keys and pressing space bar and then press Enter (Show me)
  8. Press Enter twice to accept the default UDP port value of 1194 (Show me)
     9.2
  9. Select 2048 or 4096 using the space bar and press Enter (Show me)
  10. Press Enter on Server information box (Show me)
  11. Select Yes to Version 2.4 improvements and press Enter (Show me)
  12. Select DNS Entry using the arrow keys and space bar and press Enter (Show me)
  13. Enter the hostname you set-up in the Dynamic DNS step eg myhomeinternet.hopto.org and press Enter twice (Show me)
  14. Select Custom DNS provider and press Enter (Show me)
  15. Enter 192.168.0.110 (the default IP of your Raspberry Pi) and press Enter twice (Show me)
  16. Press Enter on Installation Complete! box (Show me)
  17. Select No on the Reboot screen and press Enter (Show me)
  18. Type sudo nano /etc/dnsmasq.d/03-pivpn.conf and press Enter
  19. Type interface=tun0
  20. Press Ctrl + x and then and then Enter to save

In the next step we need to generate certificates for each of the devices you want to block ads and trackers on while not connected to your home Wi-Fi

3. Generate Certificates

First we need to generate the certificates for each device. While you are still connected to the Raspberry Pi from the previous step perform the follow actions.

  1. Type pivpn -a and press Enter (Show me)
  2. Enter the name of the device that you will put the certificate on eg myiPhone (Show me)
  3. Enter a password that you will use to secure the certificate. You will need to enter this twice pressing Enter after each time (Show me)
     3.2
  4. Repeat steps 1-3 for each device that needs a certificate. 
    • Each device must have it's own certificate 

Now we need to transfer the certificates from the Raspberry Pi to the devices. The first step is to transfer them from the Raspberry Pi.

 

  1. Copy the certificates to your computer or laptop
    Mac
    Windows
    Mac
    1. Create a folder on your desktop called Certs
    2. Open a new Terminal tab (CMD T)
    3. Type scp pi@raspberrypi.local:/home/pi/ovpns/* /Users/<username>/Desktop/Certs/ and press Enter (Show me)
      • <username> is your own username
    4. Enter the password to your Raspberry Pi and press (Show me)
       4.2
      • If you haven't changed this then the default is 3asyAdB1ock3r
    5. Close the tab you just opened in step 1 by pressing CMD W
    Windows
    1. Create a new folder called Certs
      • The best place to create this folder would be under c:\\\\
    2. Download and install (using all default options) WinSCP https://winscp.net/
    3. Start WinSCP (you'll find it in your Start menu)
    4. Enter the following details and click Login (Show me)
      • Host name - 192.168.X.110 (where X is the same number as your router - see here for more information)
      • User name - pi
      • Password - Enter the password 3asyAdB1ock3r
        • If you have changed the password previously then enter the password you changed it to
      • File Protocol - Ensure this is set to SCP
    5. When prompted wth a warning click Yes (Show me)
    6. On the left hand side navigate to where you created the Certs folder eg c:\\\\certs (Show me)
    7. Double click the ovpns folder on the right hand side of the screen (Show me)
    8. Highlight and drag all of the ovpn files from the right side of the screen to the left side and press Enter when prompted (Show me)
       8.2
    9. Close WinSCP

 

  1. Reboot the Raspberry Pi by typing sudo reboot and pressing Enter
    • This will close your connection to the Raspberry Pi

 

 

4. Update mobile devices

Now we will install the certificate on the device you want to block ads on while on the move. First you need to transfer the certificate to that device (if it's not the device you just transferred it to in the previous steps).  The easiest way to do this is to email it to yourself and then access your email on the device.  If you do email it to yourself make sure you delete the email from your inbox, sent items and deleted items when you have completed the below steps.

 

Android
iOS
Mac
Windows
Android
  1. Install OpenVPN Connect from the Play store
  2. Open the email where you have emailed the certificate to yourself
  3. Download and open the certificate
  4. Tap Ok when prompted to import the certificate (Show me)
  5. Tap Save Private Key Password, enter the certificate password you created in the previous step and tap Return (Show me)
  6. Tap to toggle the VPN on (Show me)
  7. Tap Ok when prompted on Connection Request (Show me)

Thats it!  When you're out and about you can simply open the OpenVPN Connect app and tap the profile to connect. When you are connected a VPN symbol will appear at the top of the screen.

iOS
  1. Download OpenVPN Connect from the App store
  2. Open the email where you have emailed the certificate to yourself
  3. Tap on the ovpn attachment and select Copy to OpenVPN Connect (Show me)
  4. Tap the green + symbol when OpenVPN Connect opens (Show me)
  5. Tap Allow when prompted and enter your iOS passcode or use touchid (Show me)
  6. Enter the certificate password you created in the previous steps (Show me)
  7. Ensure Save is selected so you don't have to enter the password each time you connect (Show me)
  8. Tap Return on the keyboard (Show me)
  9. Tap Yes when prompted to enable VPN connection (Show me)

Thats it!  When you're out and about you can simply open the OpenVPN Connect app and tap the profile to connect. When you are connected a VPN symbol will appear at the top of the screen.

Mac
  1. Download and install Tunnelblick https://tunnelblick.net/
  2. Open Tunnelblick if it hasn't opened after installation (Applications -> Tunnelblick)
  3. Locate the certificate file you have saved on your Mac and drag it to the Tunnelblick window
  4. Select either All Users or Only Me when prompted
  5. Enter your login password if prompted

That's it.  Now you can click Connect when you are out and about and have ads and tracking blocked.  Tunnelblick will also appear in the menu bar at the top of the screen where you can also click Connect.  

The first time you connect you will be asked for the password you created when you generated the certificate.  If you save this in your keychain then you won't have to enter this each time you connect.

Windows
  1. Download and install OpenVPN GUI https://openvpn.net/index.php/open-source/downloads.html
  2. From the Start menu open OpenVPN GUI
  3. Click Ok when prompted (Show me)
  4. Locate the OpenVPN icon in the system tray and right click it (Show me)
  5. Left click on Import File (Show me)
  6. Locate the certificate you saved in the previous step and click Open (Show me)
  7. Click Ok on the import notification (Show me)

Thats it! Now you can right click on the OpenVPN GUI icon in the system tray and left click Connect when you're out and about to have ads and tracking blocked. If OpenVPN GUI is not showing in the system tray simply open it again from the Start menu.

The first time you connect you will be asked for the password you created when you generated the certificate.  If you save this then you won't have to enter it each time you connect.

You do not need to be connected to the VPN when you are on your home Wi-Fi.

 

Existing stopAds.co.uk customers can still find Help & Support and Setup on this site.

Setup

Help & Support