What iptalbes rule is needed for "Cause 2: JIRA Applications with port forwarding configured"

Andy Airey May 23, 2016

This question is in reference to Atlassian Documentation: How to fix gadget titles showing as __MSG_gadget

The KB specifies to add a rule for localhost.

I already have the following rules:

Table: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination         
1    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:161 
2    ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:161 
3    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:8081 
4    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:8080 
5    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80 
6    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 
7    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           
8    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           
9    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22 
10   REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 
Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination         
1    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 
Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination         
Table: nat
Chain PREROUTING (policy ACCEPT)
num  target     prot opt source               destination         
1    REDIRECT   tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80 redir ports 8080 
Chain POSTROUTING (policy ACCEPT)
num  target     prot opt source               destination         
Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination         
1    REDIRECT   tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80 redir ports 8080

1 answer

1 accepted

1 vote
Answer accepted
Andy Airey May 23, 2016

You need to add a REDIRECT rule on the OUTPUT table for localhost because connections to localhost do not pass through the PREROUTING table.

iptables -t nat -I OUTPUT -p tcp -o lo --dport 80 -j REDIRECT --to-ports 8080
service iptables save

Suggest an answer

Log in or Sign up to answer