# jails, multiple ip and outgoing connections.



## wonslung (Jun 19, 2009)

I have my jails set up with 2 ips...i noticed earlier it worked fine but now it seems that it might be trying to use the wrong ip for ftp connections...this has caused me not to be able to download any packages or ports.

can you force a jail to use a specific ip for outgoing traffic?


----------



## vivek (Jun 19, 2009)

You've problem with NAT firewall rules for sure if you are using NAT with private IP. Do you have public IP for each jail?


----------



## wonslung (Jun 19, 2009)

it was a routing problem but it's DAMN weird.

i have a pfsense router.  I use the "static dhcp" setting for most of my stuff, but because i wanted to have multiple ip's for the jail i decided to go with normal static ip's

What's odd is this:

if i set up rc.conf to say this:

```
ifconfig_re0="DHCP"
```
 set up static dhcp to give ip 192.168.1.14 to the machine
and then manually add alias ip's they all work fine.

If i change it to this:

```
ifconfig_re0="inet 192.168.1.14 netmask 255.255.255.0
ifconfig_re0_alias0="inet 192.168.1.16 netmask 255.255.255.0"
ifconfig_re0_alias1="inet 192.168.1.17 netmask 255.255.255.0"
```

then not only does ftp not work, but i can't connect to that machine from the wifi subnet 

BUT it DOES allow the host os to connect and allow me to connect via the lan....it's VERY odd

what i ended up having to is set up dhcp and then add the alias lines....it works but i'm still not sure why i can't just set it up to work static....i'm asking in the pfsense forums now


----------

