How do I get Nomad agents to pick ip the IP of a specific network interface v1.0.1

I am using vagrant to set up my lab and vagrant assigns to eth0 on all three of my VMs. When I go into the Nomad GUI I see the job and click the link but it is not the host IP but rather the above address and the link does not work. Currently my IP addresses go from Below are my configs for the single server and the two agents. I am a novice in Vagrant and Nomad so I need someone to break it down Barney style please.

Server: ip
datacenter = "dc1"
data_dir = "/opt/nomad"

server {
  enabled = true
  bootstrap_expect = 1
advertise {
  http = ""
  rpc  = ""
  serf = ""

datacenter = "dc1"
data_dir = "/opt/nomad"
bind_addr = ""

client {
  enabled = true
  servers = [""]

The job that I ran is the example from you guys.

<code>job "docs" {
  datacenters = ["dc1"]

  group "example" {
    task "server" {
      driver = "docker"

      config {
        image = "hashicorp/http-echo"

        args = [
          "hello world",

      resources {
        network {
          mbits = 10

          port "http" {
            static = "5678"

This is working for Consul and should work for Nomad, too.

"{{ GetInterfaceIP \"eth0\" }}" 

Replacing eth0 with your interface name.

does that go into the /etc/nomad.d/client.hcl?

I only knew it from there. For the job file there should be an equivalent.

I put this into one of my clients in the nomad.hcl file

bind_addr = "{{ GetInterfaceIP \"eth1\" }}" 

I left the other client with a hard coded IP address. In the GUI they both have their respective IP addresses, all good. But when I go to create a job and add

constraint {
           attribute = "${attr.nomad.advertise.address}"
           value = "IP ADDRESS FOR NODE WITH ABOVE GO template"

It does not schedule it on that client. If I change the address to the hardcoded client, it schedules it on that client no problem.

Have you tried using



Shameless plug: :grinning_face_with_smiling_eyes:

checkout the following:

you will have to fill in values marked inside @@...@@ with your own values depending on your server/client configuration.