You are reading a single comment by @NotThamesWater and its replies. Click here to read the full conversation.
  • Not sure if this is for this thread or the Raspberry thread

    I have set up a pihole (so inside my network) as a recursive DNS server

    I'd like to set up a perm VPN for all external traffic on the network (rather than per device) as i would like things like the tv and so on to use it too.

    I have managed to install ExpressVPN on the pi, but im assuming its now acting on behalf the pi rather than the whole network?

    How do i get all the traffic to route through the pi vpn but also to use the pihole ? is there an easy way? Does it open the pi to online threats? Do i need to secure it?

  • If you want to route through the pi, you'd have to set it up as a router, I'd have thought. Openwrt or similar.

    Or you could set up your clients to tunnel to the Pi acting as a NPN server, and the Pi forwards the traffic as a VPN client. Ick.

    Currently, your clients are sending port 53 traffic to the Pi, (or your router is redirecting all requests. Or it should be.), and probably little else.

    A router that could forward all traffic would be probably be the best setup.

    Obvs I'm waybout of my depth here.

  • you can make a linux machine route, just easier to use a pre-rolled image

    # Enable IP Forwarding
    echo -e '\n#Enable IP Routing\nnet.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.conf
    sudo sysctl -p
    
    # NET for VPN Tunnel
    sudo iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
    sudo iptables -A FORWARD -i tun0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
    sudo iptables -A FORWARD -i eth0 -o tun0 -j ACCEPT
    
    systemctl enable netfilter-persistent
    
    

    is what I used in my ubuntu os above.

    note: there's probably a billion times better way to do this, I was just fucking around when I made htis thing.

About