0

Hello guys i have a linux vps and I it made a VPn with wireguard (and openvpn before that) I can connect to it with out any problem , and I have a commercial vpn that work on my vps (its use cisco client ) and connect my vps to vpn ez but I want to be able to connect to my vps and automaticly get connected to the commercial vpn trough my vps ( client--->my vps--->c vpn---->internet) I tried to use nat iptables as blow but as soon as I start commercial vpn on my vps the client cant connect to my vps wireguard anymore

this is what I did to try nat in iptables

  1. su

  2. iptables -t nat -D POSTROUTING -s 10.7.0.0/24 ! -d 10.7.0.0/24 -j SNAT --to-source I_wrot_my_vps_ip

    2.iptables -A FORWARD -i cisc0 -o wg0 -j ACCEPT

  3. iptables -A FORWARD -i wg0 -o cisc0 -j ACCEPT

  4. iptables -A FORWARD -d 10.7.0.0/24 -m state --state ESTABLISHED,RELATED -j ACCEPT

  5. iptables -t nat -A POSTROUTING -s 10.7.0.0/24 -j SNAT --to-source 10.10.51.198(this ip i got it from ifconfig under cisc0 section inet)

  6. ip route add default via 10.10.51.198 table 120

  7. ip rule add from 10.7.0.0/24 table 120

alireza
  • 1
  • 1
  • please ask the IT Department if allowed to. It mostly breaks the rules of most companies – djdomi Sep 28 '22 at 17:26
  • @djdomi Hello tnx for your coment I want to know if I made a mistake in my proces??is it possible that they did something to block vpn chaining??+Im not trying to trick them to have unlimited user the company I bought it from is already unlimited and u sacrifice your speed.my problem is in my country they restrict the Internet and I cant get connected to my vpn provider when they do **full** restriction but my vps always have semi restriction and I can connect to vpn from my vps . the question is :am I doing something wrong in iptables or...so I cant connect or they did something to stop it?? – alireza Sep 28 '22 at 18:37

0 Answers0