My test development environment is on a remote Ubuntu server. Ionic and ionic serve runs fine, but I cant access :8100 from a remote browser after running ionic serve
(I get a connection refused error in Chrome).
I have iptables set up as following:
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -s 127.0.0.0/8 ! -i lo -j REJECT --reject-with icmp-port-unreachable
-A INPUT -p icmp -m state --state NEW -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -m state --state NEW -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables_INPUT_denied: " --log-level 7
-A INPUT -j REJECT --reject-with icmp-port-unreachable
-A INPUT -p tcp -m tcp --dport 8100 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 8100 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
-A FORWARD -m limit --limit 5/min -j LOG --log-prefix "iptables_FORWARD_denied: " --log-level 7
-A FORWARD -j REJECT --reject-with icmp-port-unreachable
-A OUTPUT -p tcp -m tcp --sport 8100 -m state --state NEW -j ACCEPT
-A OUTPUT -p tcp -m tcp --sport 8100 -m conntrack --ctstate ESTABLISHED -j ACCEPT
After this didn’t work, I tried to add rules with UFW:
Status: active
To Action From
-- ------ ----
8100 ALLOW Anywhere
8100/tcp ALLOW Anywhere
8100 (v6) ALLOW Anywhere (v6)
8100/tcp (v6) ALLOW Anywhere (v6)
I still get ERR_CONNECTION_REFUSED when I try to access this port from a remote browser. Port 80 and 22 work as normal.
As the for the service itself on port 8100, I have tried have it listen as follows:
dev server running: http://localhost:8100/
and:
dev server running: http://<my server's IP>:8100/
Which also results in ERR_CONNECTION_REFUSED in the remote browser.