Re: Redirecting port 8080 to port 80 - how to add in /etc/sysconfig/iptables file?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Mon, Jun 20, 2016 at 10:01 PM, Alexander Farber
<alexander.farber@xxxxxxxxx> wrote:
 <cut>
>
> However I actually need my Jetty program to run at port 80 - so that users
> behind corporate firewalls can connect too.
>
> The Jetty doc at
> https://www.eclipse.org/jetty/documentation/current/setting-port80-access.html
> suggests to run the command
>
> # iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
>
> but I can not figure out the corresponding line for the
> /etc/sysconfig/iptables
>
> I have tried running the above command and then "iptables -S" to see the
> added rule, but that didn't really work.
>
> Thank you
> Alex

Hi,

you can add the rule and then run "service iptables save" - it will
save the current rules in /etc/sysconfig/iptables

when you run "iptables" or "iptables -S", it prints only the filter
chain by default. Try "iptables-save" - it prints all rules. The other
option is "iptables -t nat -L -n" or "iptables -t nat -S"

Hope it helps.

Regards,
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux