Score:0

How to create a openvpn server with port forwarding like portmap.io?

cg flag

I'm currently working on exposing my NAT behind a server to the public using OpenVPN. I've successfully accomplished this by utilizing the portmap.io VPN service, which allows public users to access the NAT resource directly using the OpenVPN server's IP and port, without requiring a VPN client.

However, I'm now attempting to achieve the same outcome with my AWS instance by creating a VPN server and employing iptables for port forwarding and tunneling. Although the VPN connection is established, I'm encountering an issue where requests from the public are not being tunneled to the specific port server on the NAT. I'm wondering if there is a possibility of resolving this situation.

Here are the iptables rules I've implemented so far:

iptables -A FORWARD -i tun0 -o eth0 -p tcp --dport <port> -j ACCEPT
iptables -A FORWARD -i eth0 -o tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -d <aws-instance-public-ip> --dport <port> -j DNAT --to-destination <ipv4-of-vpn-client-adapter:<port>
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Thank you.

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.