title: Alertmnager: Difference between cluster listen address and advertise address
body: <p>I have alertmanager running on two different host machines as docker containers and both should be running as cluster. Both the machines are inside a same vpc and communicate with private ip addresses.</p>
  <p>I need to know what is the difference between --cluster.listen-address and --cluster.advertise-address.<br />
  Correct me if I'm wrong, Specifying <code>cluster.listen-address=:9094</code> means that the alertmanager will listen for cluster connections on all interfaces on port 9094. Therefore, all other alertmanager nodes on different host machine can connect to this alertmanager's ip address at port 9094 by setting <code>cluster.peer=&lt;ip&gt;:9094</code>.<br />
  But then, I do not understand what is the use of cluster.advertise-address.</p>
  <p>The <a href="https://github.com/prometheus/alertmanager#high-availability" rel="nofollow noreferrer">documentation</a> doesn't give much idea about the use case of advertise and listen address.</p>
  <blockquote>
  <p>The chosen port in the cluster.listen-address flag is the port that needs to be specified in the cluster.peer flag of the other peers.<br />
  The cluster.advertise-address flag is required if the instance doesn't have an IP address that is part of RFC 6980 with a default route.</p>
  </blockquote>
  <p>Can someone help me know the difference between the two?</p>