vimage stuff
Hell0
I'm testing your vimage script,
- I have a problem with routing from the jail
- I wonder what's missing
- Maybe you can see it?
Best regards
Casper Andersen (Casan on irc(freenode))
think# uname -a
FreeBSD host.domain.tld 8.2-RELEASE FreeBSD 8.2-RELEASE #1: Wed Sep 28 15:30:38 CEST 2011
me@host.domain.tld:/usr/obj/usr/src/sys/VIMAGE2KERNEL amd64
------------------------------
host# cat /usr/src/sys/amd64/conf/VIMAGE2KERNEL
include GENERIC
cpu HAMMER
ident VIMAGE2KERNEL
# Virtual networking for jail
nooptions SCTP
options VIMAGE
# The nullFS to mount local directory
options NULLFS
------------------------------
host# cat /boot/loader.conf
#legal.intel_iwn.license_ack=1 # seems not to be strictly required
if_iwn_load="YES" # IS strictly required
#iwn5150fw_load="YES" # seems not to be strictly required
ng_bridge_load="YES"
ng_eiface_load="YES"
ng_ether_load="YES"
ng_socket_load="YES"
------------------------------
host# cat /etc/rc.conf
hostname="host.domain.tld"
network_interfaces="em0 iwn0"
ifconfig_em0="DHCP"
wlans_iwn0="wlan0"
ifconfig_wlan0="DHCP"
sshd_enable="YES"
keymap="danish.cp865"
dbus_enable="YES"
gnome_enable="YES"
gateway_enable="YES"
ipv6_gateway_enable="YES"
# vimage global
vimage_enable="YES"
vimage_parallel_start="NO"
vimage_list="example"
vimage_set_hostname_allow="YES"
vimage_socket_unixiproute_only="NO"
vimage_sysvipc_allow="YES"
# vimage jail
vimage_example_rootdir="/usr/jail/example"
vimage_example_hostname="example.domain.tld"
vimage_example_bridges="em0 wlan0"
vimage_example_vnets=""
vimage_example_exec_start="/bin/sh /etc/rc"
vimage_example_services="sshd"
vimage_example_exec_afterstart0=""
vimage_example_exec_stop="/bin/sh /etc/rc.shutdown"
vimage_example_devfs="YES"
vimage_example_devfs_ruleset="devfsrules_jail"
vimage_example_fdescfs_enable="YES"
vimage_example_procfs_enable="YES"
vimage_example_mount_enable="YES"
vimage_example_fstab="/etc/jails/fstabs/example"
vimage_example_flags="-l -U root"
------------------------------
host# cat /etc/jails/fstabs/example
/usr/src /usr/jail/example/usr/src nullfs ro 0 0
/usr/ports /usr/jail/example/usr/ports nullfs ro 0 0
=============================================
example# cat /etc/rc.conf
hostname="example.domain.tld"
network_interfaces="ng0_example"
ifconfig_ng0_example="inet 192.168.11.100/24"
sshd_enable="YES"
------------------------------
example# cat /etc/resolv.conf
search home
nameserver 192.168.1.1
nameserver 192.168.1.1
example# /etc/rc.d/sshd start
ps: empty file: Invalid argument
PRNG is not seeded
PRNG is not seeded
PRNG is not seeded
/etc/rc.d/sshd: WARNING: failed precmd routine for sshd
...............................
example# ping freebsd.org
PING freebsd.org (69.147.83.40): 56 data bytes
ping: sendto: No route to host
example# ping 69.147.83.40 (ip of a freebsd.org server)
PING 69.147.83.40 (69.147.83.40): 56 data bytes
ping: sendto: No route to host
example# ping 192.168.1.38 (ip of the host on the home network)
PING 192.168.1.38 (192.168.1.38): 56 data bytes
64 bytes from 192.168.1.38: icmp_seq=0 ttl=64 time=0.064 ms
example# ping 192.168.1.1 (ip of the home router)
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=1.514 ms
example# ssh 192.168.1.38
PRNG is not seeded
example# traceroute 192.168.1.38
traceroute to 192.168.1.38 (192.168.1.38), 64 hops max, 52 byte packets
1 192.168.1.38 (192.168.1.38) 0.056 ms 0.046 ms 0.021 ms
example# traceroute 192.168.1.1
traceroute to 192.168.1.1 (192.168.1.1), 64 hops max, 52 byte packets
1 192.168.1.1 (192.168.1.1) 1.443 ms 1.270 ms 1.242 ms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My Aim
------
- a virtual network on my laptop
- with jails for development & test servers
- jails needs must be accessible from the laptop
- user in jails must be able to ping traceroute connect to
- other jails if they have servers running
- the host if it has servers running
- other servers through the host as a gateway
- when connected to other networks, eg the internet
- the host and jails must be able to access each other
- when the host has a DHCP internet connection
- when the host does not have an internet connection
# Environment: thinkpad x200 laptop
- work
- wifi
- dhcp connection, ip 10.x.x.x
- need to authorize on a website to get internet access
- home
- wifi
- dhcp connection (I control the router) dynamic ip
- cat5 physical ethernet cable connection
- dhcp connection
- elsewhere
- wifi
- dhcp
- no internet