
There is a Wiregurad server that is working perfectly, but we need that Wireguard's server connect to the internet using socks proxy through the second server and ONLY Wireguard, Not other programs and whole server.
Additional Informations:
Server 1 (Wireguard Server) is located in our country but Server 2 is located in another country.
Wireguard protocol has been blocked for outside servers such as Server 2, So I can not config Wireguard on the Server 2 and create a Multihop, I tested before. (and even tested with udp2raw)
We are accessing to the Server 2 using ssh -D $port_number $username@$hostname
.
I don't want to lose the remote connection after setup.
I have some other programs running in the Wireguard server and I don't want to effect them as well.
I have limited knowledge and I'm doing this for freedom of speak for the people, So please give me some commands to copy and paste or guide me step by step, thanks! I'm trying for days and I tested every tutorial and article on the google for different ways of achieving my goal, even different alternatives of Wireguard and nothing worked (because of government limitations), Only ssh tunneling works, finish this nightmare please.
Wireguard server config file wg0.conf
:
[Interface]
Address = 10.200.0.1/24
ListenPort = 5553
PrivateKey = <server_private_key>
PreUp = iptables --table nat --append POSTROUTING --jump MASQUERADE --out-interface eth0
PreDown = iptables --table nat --delete POSTROUTING --jump MASQUERADE --out-interface eth0
MTU = 1500
[Peer]
## Client 1
AllowedIPs = 10.200.0.2/32
PublicKey = <client_public_key>