1

I tried to use the following code:

iptables -A INPUT -m state --state NEW -m tcp -p tcp \
  --dport 8161 -j ACCEPT -m comment \
  --comment "ActiveMq Server port"

Still I was unable to access it remotely.

The process is running locally, ss -tulpan | grep 8161 shows:

tcp LISTEN 0 50 :::8161 :::* users:(("java",8261,131))

Current iptables rules are:

# iptables -nvL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination                                                                             
 7773 9649K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0                                                                                                                                                                        state RELATED,ESTABLISHED
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0                                                                                                                                                                
    9   540 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0                                                                                                                                                                
    2   828 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0                                                                                                                                                                        state NEW tcp dpt:22
  503 44938 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0                                                                                                                                                                        reject-with icmp-host-prohibited
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0                                                                                                                                                                        state NEW tcp dpt:8161 /* ActiveMq Server port */

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination                                                                                                                                                              
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0                                                                                                                                                                        reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT 4856 packets, 760K bytes)
 pkts bytes target     prot opt in     out     source               destination
dawud
  • 15,096
  • 3
  • 42
  • 61
MahuLovzYou
  • 121
  • 1
  • 1
  • 6
  • 1
    is the process running locally? which interface is it listening on? (`ss -tulpan | grep 8161`) – dawud Jun 19 '15 at 14:19
  • tcp LISTEN 0 50 :::8161 :::* users:(("java",8261,131)) – MahuLovzYou Jun 19 '15 at 14:32
  • Yes it is running locally. – MahuLovzYou Jun 19 '15 at 14:32
  • Please add to the body of your question (not as a comment), your `iptables` ruleset. You can dump it using `iptables -nvL` – dawud Jun 19 '15 at 14:36
  • Still showing "This webpage is not available ERR_CONNECTION_TIMED_OUT" – MahuLovzYou Jun 19 '15 at 14:41
  • As requested by @dawud you should include the output of iptables as probably there's another rule applied by default. When you run iptables -A you add the rule after the last one (which by default is `REJECT all -- anywhere anywhere reject-with icmp-host-prohibited `. So a solution probably would be to add at the beginning, but you need to provide the info of your current rules. – Pablo Martinez Jun 19 '15 at 16:00
  • Hello Pablo, I added the rules to my question. – MahuLovzYou Jun 19 '15 at 19:44

0 Answers0