how can i route all Traffic trought Proxy? How to make a Killswitch?

Issues related to configuring your network
Post Reply
CNoob
Posts: 28
Joined: 2018/03/17 15:43:08

how can i route all Traffic trought Proxy? How to make a Killswitch?

Post by CNoob » 2018/03/30 06:09:15

i want to route all traffic trought a socks5 proxy (from a provider or a free proxy). How can i do that?

And how can i route all traffic -> VPN (from a provider) -> Proxy -> Internet

I want to cut all connections if the vpn connection disconnects. How can i do that? i want to prevent that my real ip is published if the vpn goes down.

User avatar
fdisk
Posts: 42
Joined: 2017/11/04 00:59:56

Re: how can i route all Traffic trought Proxy? How to make a Killswitch?

Post by fdisk » 2018/03/30 14:30:02

I want to cut all connections if the vpn connection disconnects. How can i do that?
There might be other solutions around but this works for me for ages:
1) delete defaultroute on your vpn client machine
2) add static host routes for every single vpn endpoint
Example:

Code: Select all

ip route add your.vpn.server.ip/32 via ip.of.gate.way dev eth0
3) use vpn providers dns with update-resov-conf script to prevent dns leaks.

Keep in mind that you are not be able to resolve anything unless you are connected to vpn. To get around this you may need to:
- replace fqhn in openvpn configuration by their according IPs
or:
- edit /etc/hosts and add according entry

This way full internet access is only available while vpn is successfully connected. As soon as vpn is off or fails to connect there will be no access (including DNS) but to hosts having host routes (which are required to connect to tunnel).

CNoob
Posts: 28
Joined: 2018/03/17 15:43:08

Re: how can i route all Traffic trought Proxy? How to make a Killswitch?

Post by CNoob » 2018/03/30 16:26:14

please can you explain me this part: via ip.of.gate.way
for what stand ip.of.gate.way
where do i get this?

User avatar
fdisk
Posts: 42
Joined: 2017/11/04 00:59:56

Re: how can i route all Traffic trought Proxy? How to make a Killswitch?

Post by fdisk » 2018/03/30 16:51:15

your previous default gateway IP

CNoob
Posts: 28
Joined: 2018/03/17 15:43:08

Re: how can i route all Traffic trought Proxy? How to make a Killswitch?

Post by CNoob » 2018/04/02 07:02:04

thank you, for VPN it works good.

Now i need the same with Socks5 Proxy. And in combination of vpn and Socks5. vpn -> proxy -> internet
please can anyone help? Thank you.

Post Reply