title: Difference between Consul Service definition Address and Service Address
body: <p>Consul service definition json is as follows</p>
  
  <pre><code>{
      "Address": "192.168.10.10",
      "TaggedAddresses": {
        "lan": "192.168.10.10",
        "wan": "10.0.10.10"
      },
      "CreateIndex": 51,
      "ModifyIndex": 51,
      "Node": "foobar",
      "ServiceAddress": "172.17.0.3",
      "ServiceEnableTagOverride": false,
      "ServiceID": "32a2a47f7992:nodea:5000",
      "ServiceName": "foobar",
      "ServicePort": 5000,
      "ServiceTags": [
        "tacos"
      ]
  }
  </code></pre>
  
  <p>Now as per the documentation provided at <a href="https://www.consul.io/docs/agent/http/catalog.html#catalog_service" rel="noreferrer">https://www.consul.io/docs/agent/http/catalog.html#catalog_service</a></p>
  
  <p>the definition of address and service address is as follows:</p>
  
  <ol>
  <li><strong>Address</strong>: IP address of the Consul node on which the service is
  registered</li>
  <li><strong>ServiceAddress</strong>: IP address of the service host — if empty, node
  address should be used</li>
  </ol>
  
  <p>A. Does this mean Address is the address of consul server node and service address is address of the node where service resides?</p>
  
  <p><strong>OR</strong></p>
  
  <p>B. Does this mean Address is the address of consul agent residing with the service. If this is the case does this mean address and service address are same?</p>
  
  <p>which of the above is correct?</p>