Score:1

forward openconnect to internal proxy port by iptables

pr flag

In my country sometimes government decides to limit access to the international internet. we only have access to sites and IPs inside the country, but data centers have more access to the internet.

I need to, at first, make a VPN connection from my home internet to a data center server inside the country, then from that server create a connection to an external server to have full access like in other countries (Instagram, facebook, ...).

In the server inside of the country, I have set up openconnect on port 443 via TCP and UDP protocol, and I also made an internal socks5 proxy to an external server via SSH dynamic port forwarding via this command:

ssh -D 127.0.0.1:1888 -f -q -C -N root@remoteIp

I need to tunnel all traffic from port 443 openconnect service to 1888 socks5 proxy.

I also tried these iptables rules, but it doesn't work. I have only access to websites located in my country. It doesn't forward traffic to the created proxy.

iptables -t nat -A PREROUTING -s 127.0.0.1 -p tcp --dport 443 -j REDIRECT --to 1888
iptables -t nat -A OUTPUT -s 127.0.0.1 -p tcp --dport 443 -j REDIRECT --to 1888

I want to know if my approach is ok, and how to do that.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.