How to set up rancher with public and private hosts?

I have set up a rancher server with several hots in a private network ( i.e with private IP addresses ) and now I want to add a host “in the cloud” (i.e. with a public IP address)

I have replaced the private IP of my server with a public one, in the command to start the rancher agent on my new host, but the private IP ( 10.165.110.5 ) is still used later on during registration ( as show in error message below ).

I can’t change the IP address of my server in the admin settings because my existing hosts with private IP won’t work any longer I suppose … Any idea about I could manage this ?

Thx,
François

[root@mmtt-web01 ~]# sudo docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.2 http://**RANCHER_PUBLIC_IP**:8080/v1/scripts/7C88A891B13D848C8103:1483142400000:7t5AAeQLecpX6Lb7NvBGLFt5BI

...

INFO: Running Agent Registration Process, CATTLE_URL=http://**RANCHER_PUBLIC_IP:8080**/v1
INFO: Attempting to connect to: http://**RANCHER_PUBLIC_IP**:8080/v1
INFO: http://**RANCHER_PUBLIC_IP**:8080/v1 is accessible
INFO: Inspecting host capabilities
INFO: Boot2Docker: false
INFO: Host writable: true
INFO: Token: xxxxxxxx
INFO: Running registration

  ...

  File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 487, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='**10.165.110.5**', port=8080): Max retries exceeded with url: /v1 (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f172de79810>: Failed to establish a new connection: [Errno 110] Connection timed out',))

I