<div dir="ltr"><div><br></div><div>On my server, I am redirecting incoming port 80 to port 7778 via iptables, but I'm unsure how to block connects directly to port 7778 from the outside. I've hit a brick wall in my understanding of pre and post routing.</div><div><br></div><div>I could use a little wisdom here. Thanks. :)<br></div><div><br></div><div><font face="monospace, monospace">#<span style="color:rgb(0,0,0)">/etc/sysconfig/iptables</span></font></div><div><div><font face="monospace, monospace"><span style="color:rgb(0,0,0)">*nat
</span><br>:PREROUTING ACCEPT [15:1051]
<br>:POSTROUTING ACCEPT [63:4394]
<br>:OUTPUT ACCEPT [63:4394]
<br>-A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 7778
<br>COMMIT
<br>*filter
<br>:INPUT ACCEPT [0:0]
<br>:FORWARD ACCEPT [0:0]
<br>:OUTPUT ACCEPT [1661:376223]
<br>-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
<br>-A INPUT -p icmp -j ACCEPT
<br>-A INPUT -i lo -j ACCEPT
<br>-A INPUT -p tcp -m state --state NEW -m tcp --dport 7778 -j ACCEPT
<br>-A INPUT -j REJECT --reject-with icmp-host-prohibited
<br>-A FORWARD -j REJECT --reject-with icmp-host-prohibited
<br>COMMIT<br></font></div></div><div><br></div><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><b style="font-size:12.8px">Daniel P. Stasinski</b><br><a href="mailto:daniel@GenericInbox.com" target="_blank">daniel@GenericInbox.com</a><br></div><font size="4">I</font> 💛<font size="4">✞</font></div></div></div></div></div></div></div></div></div></div></div>
</div>