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
Up Script
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
-
- OpenVPN Protagonist
- Posts: 11138
- Joined: Fri Jun 03, 2016 1:17 pm
Re: Up Script
This would indicate that your customised iptables rules are incorrect.stuconners wrote: ↑Wed Jul 25, 2018 6:47 pmThe 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.
However, please post your Openvpn server configuration.