# Does torch.distributed support the ipv6 address?

**URL:** <https://discuss.pytorch.org/t/does-torch-distributed-support-the-ipv6-address/85143>\
**Category:** Uncategorized\
**Created:** [June 12, 2020, 3:24am UTC](https://discuss.pytorch.org/t/does-torch-distributed-support-the-ipv6-address/85143 "2020-06-12T03:24:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![khalil](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/k/bc8723/32.png) [@khalil](https://discuss.pytorch.org/u/khalil)\
**Post date:** [June 12, 2020, 3:24am UTC](https://discuss.pytorch.org/t/does-torch-distributed-support-the-ipv6-address/85143/1 "2020-06-12T03:24:14Z")

</div>

Hi All,  
Now I import the torch.distributed package to train my model in some nodes. And I want to use the CPU to train it so I use gloo as the backend.

When I use this package to do distributed training, I should set some Common environment variables like **GLOO\_SOCKET\_IFNAME** and **MASTER\_ADDR**.I use the ifconfig command to print the interface, it just like this.  
 ![image](https://discuss.pytorch.org/uploads/default/original/3X/4/9/490eedb93e6a52261d358cafaa19eb50503b9168.png)

I want to know how to set these environment variables to running python -m torch.distributed.launch correctly.Thanks!!!

---

<div class="post-metadata">

**Author:** ![mrshenli](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/mrshenli/32/12220_2.png) [@mrshenli](https://discuss.pytorch.org/u/mrshenli)\
**Post date:** [June 12, 2020, 2:48pm UTC](https://discuss.pytorch.org/t/does-torch-distributed-support-the-ipv6-address/85143/2 "2020-06-12T14:48:28Z")

</div>

I haven’t tried myself, but I think it should work as the code does seem to handle ipv6:

> <https://github.com/pytorch/pytorch/blob/db81e13d6b061fe7b219a6ef4d05e8b4223dd0c3/torch/lib/c10d/Utils.cpp#L205>

Can you try setting `GLOO_SOCKET_IFNAME` to `eth0`, `MASTER_ADDR` to its inet6 string, and `MASTER_PORT` to, say, 23456?

---

<div class="post-metadata">

**Author:** ![khalil](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/k/bc8723/32.png) [@khalil](https://discuss.pytorch.org/u/khalil)\
**Post date:** [June 13, 2020, 2:17am UTC](https://discuss.pytorch.org/t/does-torch-distributed-support-the-ipv6-address/85143/3 "2020-06-13T02:17:03Z")

</div>

Thank you, mrshenli. I tried setting CLOO\_SOCKET\_IFNAME to eth0 and MASTER\_ADDR to inet6 string, it returned a connection error(Timeout). Then I found gn0 might be an Infiniband Interface, so I set CLOO\_SOCKET\_IFNAME to gn0 and MASTER\_ADDR to ipv4 address.

From the code, I think the MASTER\_ADDR can be set to ipv6, thanks for your help!
