Undesirable
Occasional Visitor
Hi there, I've made a hole in the firewall to open a port for the VPN with this script on firewall-start:
192.168.1.86 is the local address of my NAS where the server software is running. 56211 is the port I need to stay open.
After a certain period of time, the port will become unreachable remotely. It's fine for about 6 hours, but when I come back to check after a further 15 hours (unknown exactly when it occurs) it has closed. The VPN options I changed after uploading a .OVPN file are setting "Accept DNS Configuration" to "Relaxed" and "Redirect Internet traffic" to "Policy Rules" and then assigning my NAS IP as "VPN" and my main computer's IP as "WAN". Also "Block routed clients if tunnel goes down" = "Yes". All other settings are default.
Things I've tried: Restarting the NAS server software when the port becomes unreachable - doesn't fix the issue. Switching VPN off and then back on again - the port becomes reachable again, albeit temporarily.
Code:
#!/bin/sh
iptables -I FORWARD -i tun11 -p udp -d 192.168.1.86 --dport 56211 -j ACCEPT
iptables -I FORWARD -i tun11 -p tcp -d 192.168.1.86 --dport 56211 -j ACCEPT
iptables -t nat -I PREROUTING -i tun11 -p tcp --dport 56211 -j DNAT --to-destination 192.168.1.86
iptables -t nat -I PREROUTING -i tun11 -p udp --dport 56211 -j DNAT --to-destination 192.168.1.86
192.168.1.86 is the local address of my NAS where the server software is running. 56211 is the port I need to stay open.
After a certain period of time, the port will become unreachable remotely. It's fine for about 6 hours, but when I come back to check after a further 15 hours (unknown exactly when it occurs) it has closed. The VPN options I changed after uploading a .OVPN file are setting "Accept DNS Configuration" to "Relaxed" and "Redirect Internet traffic" to "Policy Rules" and then assigning my NAS IP as "VPN" and my main computer's IP as "WAN". Also "Block routed clients if tunnel goes down" = "Yes". All other settings are default.
Things I've tried: Restarting the NAS server software when the port becomes unreachable - doesn't fix the issue. Switching VPN off and then back on again - the port becomes reachable again, albeit temporarily.