Hello,
I'm new to work with jail. I try this example:
FreeBSD jails: a complete example
I've created the jail from another example - copied some files from the host - did a bit configuration - and it works: I can start it and connect in it with 'tcsh' command.
With the example above I try to establish an internet connection to the jail and like to install a webserver from the ports. But the fetch command hangs.
What is configured from the example above:
in host:rc.conf
in host:/etc/jails.conf
In the example he's using a pf firewall, but I use ipfw - so I search around and find that downstairs, what should be the same like it was described in pf
in host:/etc/ipfw.rule
his example for pf:
First: Are my translation from pf to ipfw rules ok, or is still there something missing?
Can this example work with the different netmask's /32 /29 and /24 ?
It's been told that computer without a router can only reach an other within the same netmask range.
In the jail, jail:sockstat or jail:netstat shows nothing, but sure yet there is no service running.
Installing some, inside the jail from the ports (ports tree is nullfs mounted from the host, as discribed in the example) the command
Can anyone give help?
I'm new to work with jail. I try this example:
FreeBSD jails: a complete example
I've created the jail from another example - copied some files from the host - did a bit configuration - and it works: I can start it and connect in it with 'tcsh' command.
With the example above I try to establish an internet connection to the jail and like to install a webserver from the ports. But the fetch command hangs.
What is configured from the example above:
in host:rc.conf
Code:
# NETZWERK Virtual IP's for Jails
cloned_interfaces="lo1"
ifconfig_lo1_aliases="inet 172.17.2.1/32 \
inet 172.17.2.2/32"
# for jails with NAT
firewall_nat_enable="YES"
gateway_enable=YES
jail_devfs_enable="YES"
jail_devfs_ruleset="devfsrules_for_jails" #from /etc/devs.rules
in host:/etc/jails.conf
Code:
...
ip4.addr = 172.17.2.1/24;
in host:/etc/ipfw.rule
Code:
cmd="ipfw -q add"
$cmd 00410 nat 1 ip from any to me in via $nwinterface
#
# Example told: "I’ve enabled NAT for an entire /29, which gives us 14 IP addresses to play with (172.17.2.1-14)."
$cmd 00420 nat 1 ip from 172.17.2.0/29 to any out via $nwinterface
#
ipfw nat 1 config if $nwinterface redirect_port tcp 172.17.2.1:80 80
ipfw nat 2 config if $nwinterface redirect_port tcp 172.17.2.1:443 443
Code:
if = "igb0"
extip = "198.51.100.156"
jailnet = "172.17.2.0/29"
nat pass on $if from $jailnet to any -> $extip
#and
jailwww = "172.17.2.1"
wwwports = "{ 80 443 }"
rdr pass on $if proto tcp from any to $extip port $wwwports -> $jailwww
pass quick from $jailwww to $jailwww
Can this example work with the different netmask's /32 /29 and /24 ?
It's been told that computer without a router can only reach an other within the same netmask range.
In the jail, jail:sockstat or jail:netstat shows nothing, but sure yet there is no service running.
ifconfig
on the host shows the both defined IPs 172.17.2.1 172.17.2.2 within the interface lo1, so they are there.Installing some, inside the jail from the ports (ports tree is nullfs mounted from the host, as discribed in the example) the command
make build
hangs, because 'fetch' hangs - it cannot fetch anything. So the network configuration for the jail is not working.Can anyone give help?
Last edited by a moderator: