# Is it possible to run the same app on the same ports in jails?



## pathiaki (Feb 8, 2013)

Hi,

I like jails a lot.  However, I can't seem to find a document either in advanced networking or jails that tells me whether this can be done.  I would think that it could given the advances in network stack virtualization that FreeBSD has done.

For example, I want to create two jails on re0.  Re0 has 192.168.0.10 as an address and it handles it's own apps.  I alias re0 to have alias0 at 192.168.0.80 and alias1 at 192.168.0.81.  I want them both to run web servers on port 80.

Do I need a bridge?
Do I need taps on a bridge?

Please don't go down the road of just put the web server on a different port.  That is not the question I am asking.  The question is whether there can be a separate network stack and the same available ports on the two jails on the same physical card.

I always see ezjail popping up stuff when I create a jail saying certain ports are already in use and to be aware of them.

The idea is that I have a very powerful server and, when I want to expand, just pick up the jail environment and put it onto separate hardware when I, finally, need more horsepower.

Has anyone done this?
Is there a doc?

Thank you,

Paul Pathiakis


----------



## SirDice (Feb 8, 2013)

They can be on the same port. Just make sure to bind the service to the specific jail IP address(es). There's no need for anything special, it should work out of the box.


----------

