1

OS: ubuntu Everything runns in containers (run via docker stack deploy) 2 servers running separate swarm

  1. server - running grafana + prometheus (ip 1.1.1.1)
  2. server - running node_exporter + cadvisor (ip 2.2.2.2)

Need to setup IPTABLES:

On 1st server:

iptables -I FORWARD -p tcp --dport 9100 -j DROP
iptables -I FORWARD -s 2.2.2.2. -p tcp --dport 9100 -j ACCEPT 

(9100 is node_exporter port)

When node_exporter iptables are setup as above everything looks just ok and I am happy. So I want to setup the same for cadvisor.

iptables -I FORWARD -p tcp --dport 8080 -j DROP
iptables -I FORWARD -s 2.2.2.2. -p tcp --dport 8080 -j ACCEPT 

(8080 is cadvisor port)

When its setup iptables for cadvisor as posted above it does not work.

When I set it up again as:

iptables -I FORWARD -p tcp --dport 8080 -j ACCEPT 

everything works fine - but I do not want the port to be exposed to the world.

Please help

Leo
  • 1,833
  • 8
  • 17
Palino1611
  • 11
  • 3

0 Answers0