# Jails with DHCP



## adripillo (Jun 11, 2013)

Hello, if I have set DHCP on in my server, can I use a jail with a static IP to run Samba and other services? Thanks in advance.


----------



## fonz (Jun 11, 2013)

You can give the jail a static non-routable IP (e.g. in the 192.168.0.0/16 range) that can be reached from your local network, if that's what you mean.


----------



## adripillo (Jun 11, 2013)

fonz said:
			
		

> You can give the jail a static non-routable IP (e.g. in the 192.168.0.0/16 range) that can be reached from your local network, if that's what you mean.



Yes, so I can use Internet on the server and set a Jail static IP that can be reached on my local network to run services like Samba. Thanks.


----------



## fonz (Jun 11, 2013)

That should be possible, although the exact procedure may depend on your setup.

You'll probably have one of the following:

You have a modem/router that obtains an external IP address from your ISP. The machines in your LAN, including the host, are connected to the modem/router (either directly or via a hub/switch) and obtain a local IP address (usually in the 192.168.0.0/16 range) from the modem/router.
You have a non-routing modem that doesn't keep the external IP address for itself, but merely acts as a bridge. Your host has two NICs. One is connected to the modem and obtains the external IP address from your ISP. The other is connected to your LAN, most likely via a hub/switch.
Something else.
Please let me know what your setup is. Most importantly, does the intended host have a *static* IP address *on the LAN* (typically in the aforementioned range)?


----------



## adripillo (Jun 13, 2013)

fonz said:
			
		

> That should be possible, although the exact procedure may depend on your setup.
> 
> You'll probably have one of the following:
> 
> ...




I have a small WiFi router on one building that gives Internet to it. So almost all computers are with dynamic IP, I mean in automatic for the DHCP. I will use a jail to run a Samba service so that way the server can have Internet and at same time run Samba.

I wonder when I set up the jail with a static IP if the computers that have automatic IP will be able to see the shared folders on the server?


----------



## SirDice (Jun 13, 2013)

adripillo said:
			
		

> I wonder when I set up the Jail with a static IP if the computers that have automatic IP will be able to see the shared folders on the server?


Static or dynamic is irrelevant in that case. As long as the IP addresses are in the same network segment and/or routing works correctly on your network it doesn't matter.


----------



## fonz (Jun 13, 2013)

SirDice said:
			
		

> Static or dynamic is irrelevant in that case. As long as the IP addresses are in the same network segment and/or routing works correctly on your network it doesn't matter.


Also, it _should_ mean you don't need to run a firewall (forwarding traffic on certain ports to the jail) on the host in this case, which makes things a little easier.


----------



## adripillo (Jun 13, 2013)

Ok, thanks a lot to both.


----------

