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
su
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
iptables -A FORWARD -i wg0 -o cisc0 -j ACCEPT
iptables -A FORWARD -d 10.7.0.0/24 -m state --state ESTABLISHED,RELATED -j ACCEPT
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)
ip route add default via 10.10.51.198 table 120
ip rule add from 10.7.0.0/24 table 120