Page 1 of 1

Up Script

Posted: Wed Jul 25, 2018 6:47 pm
by stuconners
Im running openVPN on Libreelec, which uses up and down scripts. My setup allows connections from LAN but not any external connections. How would I allow traffic from the internet into port 8080. There is a webserver on kodi which uses port 8080 with I need to be able to access even if the VPN is up or not. If the VPN is switched off, traffic to port 8080 as expected.

Here is the default up.sh:

#!/bin/bash
iptables -F
iptables -A INPUT -i tun0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i tun0 -j DROP

Ive changed mine to:

#!/bin/bash
iptables -F
iptables -A INPUT -i tun0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -I PREROUTING -p tcp -i eth0 --dport 8080 -j DNAT --to 192.168.1.133:8080
iptables -I FORWARD -p tcp -d 192.168.1.133 --dport 8080 -j ACCEPT
iptables -A INPUT -i tun0 -j DROP

Can anyone point out where im going wrong with this? My IP address of my libreelec box is 192.168.1.133 and i have port forwarding on my router. The end result should allow me to use my external IP address and port to get me to the kodi webserver. PUBLICIP:8080, this works great when the VPN is off. Any help would be great

Re: Up Script

Posted: Fri Jul 27, 2018 12:14 pm
by TinCanTech
stuconners wrote:
Wed Jul 25, 2018 6:47 pm
The end result should allow me to use my external IP address and port to get me to the kodi webserver. PUBLICIP:8080, this works great when the VPN is off.
This would indicate that your customised iptables rules are incorrect.

However, please post your Openvpn server configuration.