title: Nomad Hashicorp basic networking beetween tasks
body: <p>I'm starting to do some tests with nomad and I could use a bit on help on the easiest way to add networking to a group task. Basically my questions are:</p>
  <p>Which is the easiest way to add internal networking between tasks?
  and
  Shouldn't the tasks on the same group have default access to each other? Or there is something I'm doing wrong?</p>
  <p>I have this configuration:</p>
  <pre><code>job &quot;job&quot; {
      datacenters = [ &quot;dc1&quot; ]
      type = &quot;service&quot;
      group &quot;group&quot; {
        count = 1
          task &quot;db&quot; {
              kill_timeout = &quot;120s&quot;
              driver = &quot;docker&quot;
              config {
                  image = &quot;dbimage&quot;
                  port_map {
                    db = 3306
                  }
              }
              env {
                  MYSQL_DATABASE = &quot;db&quot;
                  MYSQL_ROOT_PASSWORD = &quot;pass&quot;
              }
              
              service {
                  name = &quot;db&quot;
                  port = &quot;db&quot;
              }
              resources {
                  memory = 256
                  network {
                      mode = &quot;host&quot;
                      port &quot;db&quot; {}
                  }
              }
          }
          task &quot;app1&quot; {
              driver = &quot;docker&quot;
              kill_timeout = &quot;120s&quot;
              config {
                  image = &quot;app1&quot;
                  port_map {
                    app1 = 5000
                  }
              }
              service {
                  name = &quot;app1&quot;
                  port = &quot;app1&quot;
              }
              resources {
                  memory = 128
                  network {
                      mode = &quot;host&quot;
                      port &quot;app1&quot; {}
                  }
              }
          }
          task &quot;app2&quot; {
              driver = &quot;docker&quot;
              kill_timeout = &quot;120s&quot;
              config {
                  image = &quot;app2:image&quot;
                  port_map {
                    app2 = 4000
                  }
              }
              env {
                  .....
              }
              service {
                  name = &quot;app2&quot;
                  port = &quot;app2&quot;
              }
              resources {
                  memory = 256
                  network {
                      mode = &quot;host&quot;
                      port &quot;app2&quot; {}
                  }
              }
          }
      }
  }
  </code></pre>
  <p>and I would like that my app1 and app2 could talk internally to each other and to the db. I have read about the the nomad ADDRESS variables that are passed to each container and I tried to reach connectivity but I get connection refused.
  Is the only way to accomplish this behaviour with connect ? Or there is a simpler way? Appreciate the help :)</p>