# jails can't access internet



## graudeejs (Jan 21, 2010)

I've been doing jails for long time, but most of time behind my router, and with aliases in same ip range {for example PC: 192.168.0.2 and jail:192.168.0.3"}

Now I don't understand what am I missing to be able to connect to internet from my jail on server

host /etc/rc.conf relavent part

```
jail_enable="YES"
jail_sysvipc_allow="YES" # For PostgreSQL in jail
jail_list=""

hostname="some.lv"
ifconfig_re0="inet 83.XXX.XXX.XXX netmask 0xffffff00"
defaultrouter="83.XXX.XXX.1

inetd_enable="NO"
inetd_flags="-wW -a 83.XXX.XXX.XXX"
rpcbind_enable="NO"
syslogd_flags="-4ssC"

jail_lighttpd_hostname="lighttpd.some.lv"
jail_lighttpd_rootdir="/jails/host/lighttpd"
jail_lighttpd_fstab="/etc/jails/lighttpd/fstab"
jail_lighttpd_interface="re0"
jail_lighttpd_devfs_enable="YES"
jail_lighttpd_mount_enable="YES"
jail_lighttpd_exec="/bin/sh /etc/rc"
jail_lighttpd_ip="192.168.0.1"
```

Trying to solve for 1-2 hours, obviously I don't see something

jail /etc/rc.conf

```
default[red]_[/red]router="83.XXX.XXX.1"

#sshd_enable="YES"

kern_securelevel=3
kern_securelevel_enable="YES"
```

/etc/resolv.conf are same for host and jail
Any ideas?

EDIT
I think I just found it.... {in red, already fixed}, just after I pushed post. lol

EDIT:
seams there's something more


----------



## SirDice (Jan 22, 2010)

Your jail has an RFC1918 address. Traffic will get routed to the Internet but there's no way for anyone to respond.


----------



## graudeejs (Jan 22, 2010)

yup {I figured that out this morning}, I need natd, right?


----------

