# Rancher LB port range mapping

**URL:** <https://forums.suse.com/t/rancher-lb-port-range-mapping/12425>\
**Category:** Rancher 1.x\
**Created:** [November 19, 2018, 4:35pm UTC](https://forums.suse.com/t/rancher-lb-port-range-mapping/12425 "2018-11-19T16:35:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anthony\_Browne](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/anthony_browne/32/4634_2.png) [@Anthony\_Browne](https://forums.suse.com/u/Anthony_Browne)\
**Post date:** [November 19, 2018, 4:35pm UTC](https://forums.suse.com/t/rancher-lb-port-range-mapping/12425/1 "2018-11-19T16:35:11Z")

</div>

So I found this question: [Rancher LB port range](http://forums.suse.com/t/rancher-lb-port-range/9606)

One of the comment replies reads _“You can do --net=host and then the server container can listen on whatever it wants… But not with a load balancer container.”_

My setup is. I have a Host which consists of multiple stacks that runs a loadbalancer.

![Capture](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/7/7121371fea7899f245c59f680bedad2e34241126.png)

So requests get into my VM (where the host is running) via their networking, I accept connects through a port, direct them to a port on my app. The LB then listens to that port and directs to the correct container. Works fine.

Now, I’m trying to add a new container, that can handle multiple ssh sessions across a range of ports.

Locally in the docker-compose file I can do

```
ports:
    - 4000-4050:4000-4050

```

which will open up a range of 50 ports and map them from my host to my container and works fine.

I’m unsure how I can achieve this in Rancher. I’ve read you can achieve it by using the network\_mode: host in the docker-compose file.

However, i’m unsure how this actually works and even though i can open up those ports/port-ranges on the networking side of my VM. The container that I want to direct to is still within the host/stack that the LB sits in.

Does anyone have any experience/knowledge that could point me in the right direction?
