Simple iptables rule to masqarade all traffic from its tun0 interface to external vpn server's tun1 interface so we can go out to the internet using vpn tunnel of that external vpn server,when we connect to vps server's openvpn server and get a ip from the tun0 adapter RX bytes:0 (0.0 B) TX bytes:0 (0.0 iptables -A POSTROUTING -t nat -s 10.8.0.0/8 -o tun1 -j MASQUERADE TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:578 errors:0 dropped:0 overruns:0 carrier:0 RX packets:578 errors:0 dropped:0 overruns:0 frame:0 TX packets:8841 errors:0 dropped:0 overruns:0 carrier:0 RX packets:9763 errors:0 dropped:0 overruns:0 frame:0 RX bytes:635287 (635.2 KB) TX bytes:2218229 (2.2 openvpn -config /home/eminem/oki.ovpnĬonnecting to an external vpnserver in your case your vpn service from your vps server ifconfig TX packets:3052 errors:0 dropped:0 overruns:0 carrier:0 RX packets:3225 errors:0 dropped:0 overruns:0 frame:0 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 TX packets:568 errors:0 dropped:0 overruns:0 carrier:0 RX packets:568 errors:0 dropped:0 overruns:0 frame:0 TX packets:8638 errors:0 dropped:0 overruns:0 carrier:0
![set up mguard for vpn tunnel set up mguard for vpn tunnel](https://cdn.comparitech.com/wp-content/uploads/2020/04/VPN-Tunnel.jpg)
RX packets:9484 errors:0 dropped:0 overruns:0 frame:0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Trust me it works i just confirmed using my virtual machines and an public vpn server. Why cant you connect to the vpn service you brought from the vps ?, setup a openvpn server on the vps and connect to your vps's openvpn server from your client computer.
#SET UP MGUARD FOR VPN TUNNEL HOW TO#
I guess I may need to set-up some virtual network-device on my laptop (which ends on the VPS), and connect VPN through it - but how to do this, sadly goes over my head.Ĭan i propose an easy solution just dont vote me down im a total novice SSH-tunneling seemed promising, but since I don't have/know an exact domain and port for my VPN, I couldn't figure out how to use it. I have been googling and looking at various answers on the StackExchange-network, but not seems to be exactly what I'm after. so please spoonfeed me (using small words and colorful pictures -) While I have been using Linux for a while, I'm a novice when it comes to setting-up virtual network-devices, advanced routing, and so on. The reason I wish to do so, is that a place I often work blocks my VPN-service, but not my SSHing to my VPS.
![set up mguard for vpn tunnel set up mguard for vpn tunnel](https://i0.wp.com/uploads.thegioifirewall.com/image-4605.png)
I was wondering how I can set-up a SSH-tunnel or something similar, from my laptop to the VPS I'm renting, so I then can run VPN (from my laptop) "through" it (to the VPS), to the VPN-server. I've bought a paid VPN-service, which I use on my laptop.