Tydyn Rain St. Clair
Occasional Visitor
Hello all,
I rarely make posts asking for help or suggestions, as I tend to figure most things out myself via lots and lots of web searches, testing, experimenting, and the like. In this case, however, I think I will ask for help, as the complexity of this issue has my brain hurting.
Here's my situation, in simplified form. I have an OpenVPN server running on my RT-68R router running the latest version of Merlin's firmware (380.59). My laptop has various programs and services that need open ports to function, and for which I've created various port forwarding rules via the Virtual Server / Port Forwarding tab of the router configuration page. I also have my laptop's MAC address bound to a particular internal IP address. Obviously when I'm on my network the port forwarding works just fine. It's only, of course, when I'm not on my home network with my laptop and connect to my router via my OpenVPN tunnel, that these ports are no longer forwarded.
I've been doing a hell of a lot of searching and experimenting to try to be able to get these ports forwarded again while connected via the OpenVPN tunnel, and all to no avail up to this point. I created a nat-start script in my /jffs/scripts folder, and have been testing various iptables forwarding rules, which so far have not worked correctly. In one such attempt I actually made my router unable to connect to the internet. After having removed the lines in the nat-start script which caused that problem, I decided to finally ask for assistance.
So basically, I'm trying to either be able to use the port forwarding rules already in place on my router's Virtual Server / Port Forwarding tab, or to remove those and create successful port forwarding rules via /jffs/scripts/nat-start that will function correctly whether I am on my network or tunneling in via OpenVPN.
This is what I have in my nat-start script as of this moment:
The 192.168.3.71 IP address is the MAC-bound IP that I have attached to my laptop when on my network. The 10.69.69.0/24 is for my OpenVPN network, of course. The only reason I have 'br0' at the bottom is because in looking through my system logs, the 'br0' interface is often used for outgoing traffic it seems. In doing my reasearch it seems that the 'br0' interface is used for bridges, which only makes me more confused, as I have no bridges operating.
I don't understand iptables rules sufficiently well to create this myself yet, so I've been using rules that others have posted and adjusting the IP addresses and ports. This is not working incredibly well, so if anyone knows how to do this, and would be open to helping me, I would be ridiculously grateful.
I wasn't sure whether to post this question here or in the ASUS-Merlin sub-forum, so for the moment I posted in both to get as many perspectives as possible.
Thank you.
I rarely make posts asking for help or suggestions, as I tend to figure most things out myself via lots and lots of web searches, testing, experimenting, and the like. In this case, however, I think I will ask for help, as the complexity of this issue has my brain hurting.
Here's my situation, in simplified form. I have an OpenVPN server running on my RT-68R router running the latest version of Merlin's firmware (380.59). My laptop has various programs and services that need open ports to function, and for which I've created various port forwarding rules via the Virtual Server / Port Forwarding tab of the router configuration page. I also have my laptop's MAC address bound to a particular internal IP address. Obviously when I'm on my network the port forwarding works just fine. It's only, of course, when I'm not on my home network with my laptop and connect to my router via my OpenVPN tunnel, that these ports are no longer forwarded.
I've been doing a hell of a lot of searching and experimenting to try to be able to get these ports forwarded again while connected via the OpenVPN tunnel, and all to no avail up to this point. I created a nat-start script in my /jffs/scripts folder, and have been testing various iptables forwarding rules, which so far have not worked correctly. In one such attempt I actually made my router unable to connect to the internet. After having removed the lines in the nat-start script which caused that problem, I decided to finally ask for assistance.
So basically, I'm trying to either be able to use the port forwarding rules already in place on my router's Virtual Server / Port Forwarding tab, or to remove those and create successful port forwarding rules via /jffs/scripts/nat-start that will function correctly whether I am on my network or tunneling in via OpenVPN.
This is what I have in my nat-start script as of this moment:
Code:
#!/bin/sh
echo "*" >>/tmp/000nat-start
logger "nat" "I'm working!"
iptables -I FORWARD -i tun21 -p udp -d 192.168.3.71 --match multiport
--dports 3690,6346,21028,33682,3673,36275,3194,123 -j ACCEPT
iptables -I FORWARD -i tun21 -p tcp -d 192.168.3.71 --match multiport
--dports 3690,6346,444,81,22001 -j ACCEPT
iptables -t nat -I PREROUTING -i tun21 -p tcp --match multiport --dports
3690,6346,444,81,22001 -j DNAT --to-destination 192.168.3.71
iptables -t nat -I PREROUTING -i tun21 -p udp --match multiport --dports
3690,6346,21028,33682,3673,36275,3194,123 -j DNAT --to-destination
192.168.3.71
iptables -t nat -A POSTROUTING -s 10.69.69.0/24 -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.69.69.0/24 -o br0 -j MASQUERADE
The 192.168.3.71 IP address is the MAC-bound IP that I have attached to my laptop when on my network. The 10.69.69.0/24 is for my OpenVPN network, of course. The only reason I have 'br0' at the bottom is because in looking through my system logs, the 'br0' interface is often used for outgoing traffic it seems. In doing my reasearch it seems that the 'br0' interface is used for bridges, which only makes me more confused, as I have no bridges operating.
I don't understand iptables rules sufficiently well to create this myself yet, so I've been using rules that others have posted and adjusting the IP addresses and ports. This is not working incredibly well, so if anyone knows how to do this, and would be open to helping me, I would be ridiculously grateful.
I wasn't sure whether to post this question here or in the ASUS-Merlin sub-forum, so for the moment I posted in both to get as many perspectives as possible.
Thank you.
Last edited: