Ipatbles not working

bennworah

New Member
Joined
Jul 18, 2020
Messages
29
Reaction score
1
Credits
253
Hello Linux experts,
I have two CentOS 7 machines (hosted on Virtual box), I created a rule to allow port 9200 on both machines as follows:
iptables -I INPUT -p tcp --dport 9200 -j ACCEPT
I can confirm the rule is created on both machines by running:

iptables -L INPUT --line-numbers

But when I tried to telnet from physical computer to these machines on port 9200, only one of the machine seems to allow the connection, while the other machine refuses to accept connection despite having the same iptable rule as shown above.
The funny part is that both machines accept ssh connection from my physical machine. so the issue is not connection from my physical machine to the Virtual machines.

This is very strange to me, because i have good knowledge of iptables, and i have never had issues allowing port on Linux machines. I have stopped/started the iptables using the systemctl stop|start iptables command, also stopped/started the firewalld (systemctl stop|start firewalld), but nothing seems to work

Please assist!
 


Port 9200 - are you trying to setup elasticsearch?
 
Yes. But I am not able to connect even without the installation of elasticsearch(ES) The other machine that works does not have the ES installed. This is weird :(
 
transport.host: localhost
transport.tcp.port: 9300
http.port: 9200
network.host: 0.0.0.0
 
On CentOS, i wouldn't use iptables, I would use firewalld.

firewall-cmd --add-port=9200/tcp --permanent

If you need Kibana...

firewall-cmd --add-port=5601/tcp --permanent

Also SElinux can be problematic.
 
I fixed this by uncommenting the following line in the elasticsearch.yml file:
discovery.seed_hosts: ["host1", "host2"]

Regards,
 

Members online


Top