# Dynamically capturing Rancher LB Ports

**URL:** <https://forums.suse.com/t/dynamically-capturing-rancher-lb-ports/4299>\
**Category:** General\
**Created:** [October 13, 2016, 2:04pm UTC](https://forums.suse.com/t/dynamically-capturing-rancher-lb-ports/4299 "2016-10-13T14:04:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phooper0001](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@phooper0001](https://forums.suse.com/u/phooper0001)\
**Post date:** [October 13, 2016, 2:04pm UTC](https://forums.suse.com/t/dynamically-capturing-rancher-lb-ports/4299/1 "2016-10-13T14:04:52Z")

</div>

Hi,

I have a rancher environment stack setup. It’s a typical 3 tier infrastructure. I have Rancher LB’s fronting the containers at each level in the stack. The containers are connected using --links.

I have 2 questions .

1. For the frontend rancher LB, I’ve exposed a host port - how to I dynamically allocate that to an AWS ELB ?
2. For the internal Rancher LBs I need to programmatically return the dynamic port that has been assigned for communication within the stack

i.e

```
         Rancher LB ( Fixed port exposed to host - this will be assigned to an AWS ELB ) 
                |
      Presentation Layer
                | 
    Business Layer Rancher LB ( Dynamic Port exposed to host; how does the presentation layer know which 
                                                port to use )
                | 
     Business Layer
                | 
    Data Tier Rancher LB ( Dynamic Port exposed to host; how does the Business layer know which 
                                                port to use )
                | 
     Data Layer

```

Thanks in advance

Paul  
[phooper0001@yahoo.com](mailto:phooper0001@yahoo.com) - if it’s easier 🙂
