I want to set up my Raspberry pi as a proxy server for one pc on my network.

This is the scenario:

I have a virgin media superhub (UK), I want any device that can connect to this with the wifi to have a normal connection not through the proxy.

From the hub, I have a switch which extends a wired connection to one pc running ubuntu.

I want the user of this pc to have root access and be able to change anything on their computer, but I want any web connection to go through a raspberry pi. This raspbery pi would then block access to certain websites.

Complications. The pc is used as a webserver and I want to make sure people can access that computer through ssh and things like teamviewer from external sites.

How do I physically set up the network? I need to make sure that the ubuntu pc cant just change a setting to directly access the internet through the router. So I am assuming that just plugging the pi into the switch might not work.

Once the network is physically set up, what would be the software configuration to enable this?

I realize this will not be completely secure because the user of the pc could use a vpn to tunnel their connection past the proxy, but I want to ignore this possibility at the moment.

  • Is this a home network? Home networking is off-topic here... – Craig Constantine Jul 21 '15 at 14:02
  • no it is not a home network – user27815 Jul 21 '15 at 14:07
  • You could set the Rasp Pi as the DNS server of the local PC, and then have the Rasp Pi perform the recursive DNS looks and filter based on DNS. Not ideal but this question seems to be a cross between networking and application diciplines. – jwbensley Jul 22 '15 at 20:59

Go to your edge-router/firewall. Block the Ubuntu system from having access to TCP 80 and 443. Permit the proxy server to access TCP 80 and 443. Then the Ubuntu system will only work when it access the proxy. The admin can of course change the config, but then they get NO web access.

Setup up the rest (access to the web server, sshd etc on the Ubuntu) system as usual for exposing internal services.

Also, you can block outgoing VPN tunneling on your edge to stop that too.


If all your trying to do is block certain websites you can do that much easier with a Host file.

I would recommend a pc instead of a pi but here is the gist of things.

Take your pi and get a wifi card. Connect the pi to the wifi and make sure it has internetz. Then attach your ubuntu pc to the pi using a ethernet cable. Install and setup a transparent proxy on your pi. That's about it really.

  • Your welcome, I didn't find any specific pi distributions that had a transparent proxy with an easy to configure web interface, but many are available for the PC – Levi Jul 21 '15 at 15:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.