# Rancher Server and hosts on AWS - cannot create host

**URL:** <https://forums.suse.com/t/rancher-server-and-hosts-on-aws-cannot-create-host/7055>\
**Category:** Rancher 1.x\
**Created:** [August 8, 2017, 9:29pm UTC](https://forums.suse.com/t/rancher-server-and-hosts-on-aws-cannot-create-host/7055 "2017-08-08T21:29:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![flantel](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/flantel/32/5095_2.png) [@flantel](https://forums.suse.com/u/flantel)\
**Post date:** [August 8, 2017, 9:29pm UTC](https://forums.suse.com/t/rancher-server-and-hosts-on-aws-cannot-create-host/7055/1 "2017-08-08T21:29:45Z")

</div>

Hi

Running both rancher-server and hosts on AWS. I am trying to add a new host using the EC2 machine driver. However, it always fails at “waiting for SSH” unless I select “Use Only Private IP”, However, if I do select that then the ec2 instance is created without public IP.

The reason for this I think is that rancher-server is trying to use the public IP address to ssh in to configure the new host. However, on EC2 this is not possible - you can’t access private IPs from within a VPC you have to use the private IPs.

Is there some way of getting around this? Should docker-machine perhaps be using the hostname rather than the IP, as this will resolve correctly?

Thanks

---

<div class="post-metadata">

**Author:** ![flantel](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/flantel/32/5095_2.png) [@flantel](https://forums.suse.com/u/flantel)\
**Post date:** [August 9, 2017, 3:38pm UTC](https://forums.suse.com/t/rancher-server-and-hosts-on-aws-cannot-create-host/7055/2 "2017-08-09T15:38:06Z")

</div>

Hi

Following up on my own post, I can see that it is indeed the case that rancher-server is trying to ssh to the public IP address of the host it has just created, and thus failing

`tcp 0 1 172.17.0.2:47272 52.212.84.27:22 SYN_SENT`

This would seem to be a change from v 1.4.X because with that version I was able to create hosts within EC2

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [August 9, 2017, 3:57pm UTC](https://forums.suse.com/t/rancher-server-and-hosts-on-aws-cannot-create-host/7055/3 "2017-08-09T15:57:24Z")

</div>

All we are really doing is running docker-machine inside the server container. The machine driver creates the instance and decides what IP to connect to. AWS instances have always defaulted to having a public IP and using that for SSH AFAIK. So it seems more likely your network configuration changed.

---

<div class="post-metadata">

**Author:** ![flantel](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/flantel/32/5095_2.png) [@flantel](https://forums.suse.com/u/flantel)\
**Post date:** [August 9, 2017, 4:26pm UTC](https://forums.suse.com/t/rancher-server-and-hosts-on-aws-cannot-create-host/7055/4 "2017-08-09T16:26:07Z")

</div>

Hi Vincent,

Thanks for the response. However, It has never been possible to access an AWS public IP from within the same VPC as far as I know.

---

<div class="post-metadata">

**Author:** ![flantel](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/flantel/32/5095_2.png) [@flantel](https://forums.suse.com/u/flantel)\
**Post date:** [August 10, 2017, 12:18pm UTC](https://forums.suse.com/t/rancher-server-and-hosts-on-aws-cannot-create-host/7055/5 "2017-08-10T12:18:02Z")

</div>

Ignore this. I am a muppet. Allowing ssh access from the Rancher Server’s public IP fixed it.

---

<div class="post-metadata">

**Author:** ![leodotcloud](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/leodotcloud/32/3103_2.png) [@leodotcloud](https://forums.suse.com/u/leodotcloud)\
**Post date:** [August 10, 2017, 6:48pm UTC](https://forums.suse.com/t/rancher-server-and-hosts-on-aws-cannot-create-host/7055/6 "2017-08-10T18:48:01Z")

</div>

Closed on August 10, 2017, 6:48pm UTC


