port forwarding through vpn

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
Saaz
DD-WRT Novice


Joined: 07 Feb 2023
Posts: 3

PostPosted: Mon Feb 13, 2023 21:29    Post subject: port forwarding through vpn Reply with quote
Hi everybody. I hope I post this in the right board, if not please redirect me, this is my first post. I'm trying to forward some ports through my vpn tunnel but am only partly successful.

I run version r50927 on an Dlink d-825b.

I have a VPS with openVPN server <-> DDWT with openVPN client <-> LAN.
Under Administration>Commands>firewall I have this saved:

iptables -t nat -I PREROUTING -i tun1 -p tcp --dport 9735 -j DNAT --to 10.10.0.182:9735
iptables -I FORWARD -i tun1 -p tcp -d 10.10.0.182 --dport 9735 -j ACCEPT
iptables -t nat -I PREROUTING -i tun1 -p tcp --dport 19765 -j DNAT --to 10.10.0.2:19765
iptables -I FORWARD -i tun1 -p tcp -d 10.10.0.2 --dport 19765 -j ACCEPT

When I'm on my vps I can run the command:
telnet 10.8.0.2 9735, and connect successful.
telnet 10.8.0.2 19765, I get a timeout.

Perhaps someone can tell me what I'm missing. If you need any additional information please let me know.
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Tue Feb 14, 2023 10:45    Post subject: Reply with quote
You can make a site-to-site setup then you do not need to port forward at all.

See the DDWRT server setup guide.

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Saaz
DD-WRT Novice


Joined: 07 Feb 2023
Posts: 3

PostPosted: Wed Feb 15, 2023 12:23    Post subject: Reply with quote
Thanks for the reply, I'll look into it. I was curious if I made a mistake.
Saaz
DD-WRT Novice


Joined: 07 Feb 2023
Posts: 3

PostPosted: Sun Feb 19, 2023 20:33    Post subject: Reply with quote
For those that care, it was an old firewall rule on 10.10.0.2. It did not allow trafic from outside the lan. I was put on the wrong foot because I could reach that port from the inside.
shb
DD-WRT Novice


Joined: 06 Oct 2013
Posts: 39

PostPosted: Mon Feb 20, 2023 10:38    Post subject: Reply with quote
Hi @Saaz,

I am curious... Where did you find the "old firewall rule" ?? In -t nat ? in FORWARD ? or somewhere else.... and still curious, Very Happy because my problem is similar... what was the exact rule ?
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum