# Nomad, WSL and bridge networking

**URL:** <https://discuss.hashicorp.com/t/nomad-wsl-and-bridge-networking/54156>\
**Category:** Nomad\
**Created:** [May 24, 2023, 2:20pm UTC](https://discuss.hashicorp.com/t/nomad-wsl-and-bridge-networking/54156 "2023-05-24T14:20:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeteve](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jeteve/32/35877_2.png) [@jeteve](https://discuss.hashicorp.com/u/jeteve)\
**Post date:** [May 24, 2023, 2:20pm UTC](https://discuss.hashicorp.com/t/nomad-wsl-and-bridge-networking/54156/1 "2023-05-24T14:20:52Z")

</div>

Hi all,

I’m running the vanilla ubuntu nomad from the online tutorial and I’m running into network issue.

Specifically, docker backed services gets bound to the 127.0.0.1 IP, which makes them un-accessible from other service containers.

As mentioned in other posts ([Nomad service address resolves to localhost](https://discuss.hashicorp.com/t/nomad-service-address-resolves-to-localhost/51030) ) , I’ve tried using the `bridge` network type with the `address_mode = alloc` setting, but no joy.

I think I traced it down to the fact that the bridge network mode gets disabled in nomad due to:

```auto

2023-05-24T13:10:35.635+0100 [DEBUG] client.fingerprint_mgr: built-in fingerprints: fingerprinters=["arch", "bridge", "cgroup", "cni", "consul", "cpu", "host", "landlock", "memory", "network", "nomad", "plugins_cni", "signal", "storage", "vault", "env_aws", "env_gce", "env_azure", "env_digitalocean"]
   2023-05-24T13:10:35.636+0100 [WARN] client.fingerprint_mgr: failed to detect bridge kernel module, bridge network mode disabled:
error=
| 3 errors occurred:
| \t* module bridge not in /proc/modules
| \t* failed to open /lib/modules/5.15.90.1-microsoft-standard-WSL2/modules.builtin: open /lib/modules/5.15.90.1-microsoft-standard-WSL2/modules.builtin: no such file or directory
| \t* failed to open /lib/modules/5.15.90.1-microsoft-standard-WSL2/modules.dep: open /lib/modules/5.15.90.1-microsoft-standard-WSL2/modules.dep: no such file or directory
|

```

On a side node, bridge networks work just fine using docker-compose, so I assume nomad’s bridge network is something more general as it covers more than just docker containers.

Is there a way to setup nomad so it activates bridge networking on WSL?

Thanks!

---

<div class="post-metadata">

**Author:** ![hardkeo](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/hardkeo/32/35910_2.png) [@hardkeo](https://discuss.hashicorp.com/u/hardkeo)\
**Post date:** [May 30, 2023, 10:54pm UTC](https://discuss.hashicorp.com/t/nomad-wsl-and-bridge-networking/54156/2 "2023-05-30T22:54:46Z")

</div>

Hello @jeteve!

I had replied to you in this [post](https://github.com/hashicorp/nomad/issues/17305#issuecomment-1563238130).

All steps are better explained in my [git repository](https://github.com/hardkeo/bridge-support-on-wsl2)

After applying the steps, you can optionally install **bridge-utils** to be able to see which virtual interfaces are associated with a bridge:

`sudo apt install bridge-utils`  
`brctl show`

_before_

 ![nomad_bridge_wsl2_001](https://global.discourse-cdn.com/hashicorp/original/3X/d/0/d009b4b1b78f5a50a4bd148357b7f86ac854b9ce.png)

_deploying service mesh demo and show new interfaces_

 ![nomad_bridge_wsl2_002](https://global.discourse-cdn.com/hashicorp/original/3X/b/a/babd3b383900b23176d4557453c83cf498c0a5ce.png)

_show bridges_

 ![nomad_bridge_wsl2_003](https://global.discourse-cdn.com/hashicorp/original/3X/e/0/e032789cdf48c52c0f8e7864fa282bc995e1c18f.png)

_service mesh working_

 ![nomad_bridge_wsl2_004](https://global.discourse-cdn.com/hashicorp/original/3X/c/c/cc2d33d2c07982151d2cb987a1287aa8e32b9679.png)

_services in consul_

 ![nomad_bridge_wsl2_005](https://global.discourse-cdn.com/hashicorp/original/3X/c/b/cb6ab5732ece3867f7190d5618a64b69d0547d3e.png)

Have fun!

---

<div class="post-metadata">

**Author:** ![jeteve](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jeteve/32/35877_2.png) [@jeteve](https://discuss.hashicorp.com/u/jeteve)\
**Post date:** [May 31, 2023, 7:47am UTC](https://discuss.hashicorp.com/t/nomad-wsl-and-bridge-networking/54156/3 "2023-05-31T07:47:48Z")

</div>

Thanks! I managed to get bridge mode working on WSL. From my findings, I think my issue is that nomad assigns the loopback IP for services, which doesn’t allow other containers (from other jobs) to access such services.

This doesn’t seem to be the case when nomad runs on an actual Linux machine (virtual or not).

---

<div class="post-metadata">

**Author:** ![jeteve](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jeteve/32/35877_2.png) [@jeteve](https://discuss.hashicorp.com/u/jeteve)\
**Post date:** [May 31, 2023, 8:42am UTC](https://discuss.hashicorp.com/t/nomad-wsl-and-bridge-networking/54156/4 "2023-05-31T08:42:31Z")

</div>

I think I found a solution.

In my WSL, I now have:

 ![image](https://global.discourse-cdn.com/hashicorp/original/3X/1/7/17e1bfc2d6e5bb8262b5662863e915fdb0cdabdd.png)
