<div dir="ltr">Right after I posted, I figured out a solution.<div><br></div><div>I just added redirect from 7778 to 80. Since 80 is not active, it drops it</div><div><br></div><div><span style="font-family:monospace,monospace;font-size:12.8px">A PREROUTING -p tcp -m tcp --dport 7778-j REDIRECT --to-ports 80</span><br></div><div><span style="font-family:monospace,monospace;font-size:12.8px"><br></span></div><div><b style="font-size:12.8px">Daniel P. Stasinski</b><br></div><div class="gmail_extra"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><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>
<br><div class="gmail_quote">On Sun, Sep 17, 2017 at 8:24 PM, Daniel Stasinski <span dir="ltr"><<a href="mailto:daniel@genericinbox.com" target="_blank">daniel@genericinbox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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="m_8966898144488848888gmail_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>
</blockquote></div><br></div></div>