Hello,
I setup a N300 router to connect as a client to my VPS with wireguard. I’m able to connect N300 router to my wireguard vpn server but when I try to open a port and add a port forwarding rules to open a port, port is still closed …
vpn tunnel is up and running, client connected to N300 router get internet and get the external Ip from my VPS. Only port forwarding is not working.
On the vps I forward the port with iptables
indent preformatted text by 4 spaces
PostUp = iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1240
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostUp = iptables -A FORWARD -i eth0 -o wg0 -p tcp --syn --dport 44158 -m conntrack --ctstate NEW -j ACCEPT
PostUp = iptables -A FORWARD -i eth0 -o wg0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
PostUp = iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 44158 -j DNAT --to-destination 192.168.12.2
192.168.12.2 is the N300 ip address from Wireguard client
any suggestions ?
regards