# Rancher agent on same host as server

**URL:** <https://forums.suse.com/t/rancher-agent-on-same-host-as-server/1872>\
**Category:** RancherOS\
**Created:** [February 27, 2016, 9:39am UTC](https://forums.suse.com/t/rancher-agent-on-same-host-as-server/1872 "2016-02-27T09:39:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![plastik\_man](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@plastik\_man](https://forums.suse.com/u/plastik_man)\
**Post date:** [February 27, 2016, 9:39am UTC](https://forums.suse.com/t/rancher-agent-on-same-host-as-server/1872/1 "2016-02-27T09:39:14Z")

</div>

When I run rancher-agent on the same host as the server is running, the agent won’t show the public IP in the UI. Instead it shows a ip of the subnet that docker uses 172.17.0.0/16 net.

I’m having problem when I try to ping containers that belongs to the managed network, is the cause that the agent use a docker subnet IP instead of the public one?

---

<div class="post-metadata">

**Author:** ![Tom472](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/tom472/32/896_2.png) [@Tom472](https://forums.suse.com/u/Tom472)\
**Post date:** [February 28, 2016, 5:35pm UTC](https://forums.suse.com/t/rancher-agent-on-same-host-as-server/1872/2 "2016-02-28T17:35:39Z")

</div>

Trying to ping them from where?  
From other containers?  
From the host itself?  
From other machines on the host’s network?

---

<div class="post-metadata">

**Author:** ![plastik\_man](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@plastik\_man](https://forums.suse.com/u/plastik_man)\
**Post date:** [February 28, 2016, 10:17pm UTC](https://forums.suse.com/t/rancher-agent-on-same-host-as-server/1872/3 "2016-02-28T22:17:42Z")

</div>

I tried to ping from a container on one host to a container on another host, it didn’t work.

But after reading the docs about adding custom hosts thoroughly, I ran the agent container with the environment variable CATTLE\_AGENT\_IP and the agent container ( which is on the same host as the server ) shows the public IP.

So the containers of different hosts can now ping each other. Problem solved 🙂

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [February 29, 2016, 5:23am UTC](https://forums.suse.com/t/rancher-agent-on-same-host-as-server/1872/4 "2016-02-29T05:23:11Z")

</div>


