# Configuring Jails in 8.1



## stepanovmsu (Sep 26, 2010)

Hi Guys
I'm newbie in FreeBSD.

I have recently setup a couple jails on my 8.1-p1 Release installation, using this guide http://www.freebsd.org/doc/handbook/jails-application.html

All works fine, but jails output ifconfig looks same as host output ifconfig

jail output ifconfig:


```
www-evgeny# ifconfig
re0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3898<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
        ether 90:e6:ba:35:f0:c4
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:27:19:cf:9b:4f
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap>
        status: running
vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=82808<VLAN_MTU,WOL_UCAST,WOL_MAGIC,LINKSTATE>
        ether 00:24:01:00:8a:da
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
pfsync0: flags=0<> metric 0 mtu 1460
        syncpeer: 224.0.0.240 maxupd: 128
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet 192.168.3.5 netmask 0xffffffff
pflog0: flags=141<UP,RUNNING,PROMISC> metric 0 mtu 33152
enc0: flags=0<> metric 0 mtu 1536
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether ee:07:e1:42:b4:fc
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200
        root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
        member: re0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 1 priority 128 path cost 55
        member: wlan0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 10 priority 128 path cost 33333
wlan0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:27:19:cf:9b:4f
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap>
        status: running
        ssid home_wlan1 channel 11 (2462 MHz 11g) bssid 00:27:19:cf:9b:4f
        regdomain NONE country RU indoor ecm authmode WPA privacy MIXED
        deftxkey 2 TKIP 2:128-bit TKIP 3:128-bit txpower 30 scanvalid 60
        protmode CTS wme burst dtimperiod 1 -dfs
ng0: flags=88d1<UP,POINTOPOINT,RUNNING,NOARP,SIMPLEX,MULTICAST> metric 0 mtu 1460
lo1: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet 192.168.3.5 netmask 0xffffffff
www-evgeny#
```

host output ifconfig:


```
evgeny# ifconfig
re0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3898<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
        ether 90:e6:ba:35:f0:c4
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:27:19:cf:9b:4f
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap>
        status: running
vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=82808<VLAN_MTU,WOL_UCAST,WOL_MAGIC,LINKSTATE>
        ether 00:24:01:00:8a:da
        inet 10.198.42.141 netmask 0xfffff800 broadcast 10.198.47.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
pfsync0: flags=0<> metric 0 mtu 1460
        syncpeer: 224.0.0.240 maxupd: 128
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x6
        inet6 ::1 prefixlen 128
        inet 127.0.0.1 netmask 0xff000000
        inet 192.168.3.5 netmask 0xffffffff
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
pflog0: flags=141<UP,RUNNING,PROMISC> metric 0 mtu 33152
enc0: flags=0<> metric 0 mtu 1536
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether ee:07:e1:42:b4:fc
        inet 192.168.1.254 netmask 0xffffff00 broadcast 192.168.1.255
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200
        root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
        member: re0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 1 priority 128 path cost 55
        member: wlan0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 10 priority 128 path cost 33333
wlan0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:27:19:cf:9b:4f
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap>
        status: running
        ssid home_wlan1 channel 11 (2462 MHz 11g) bssid 00:27:19:cf:9b:4f
        regdomain NONE country RU indoor ecm authmode WPA privacy MIXED
        deftxkey 3 TKIP 2:128-bit TKIP 3:128-bit txpower 30 scanvalid 60
        protmode CTS wme burst dtimperiod 1 -dfs
ng0: flags=88d1<UP,POINTOPOINT,RUNNING,NOARP,SIMPLEX,MULTICAST> metric 0 mtu 1460
        inet 95.31.13.241 --> 85.21.0.70 netmask 0xffffffff
lo1: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet 192.168.3.1 netmask 0xffffffff
        inet 192.168.3.2 netmask 0xffffffff
        inet 192.168.3.3 netmask 0xffffffff
        inet 192.168.3.4 netmask 0xffffffff
evgeny#
```

Is it normal? 
May I somehow hide all interfaces except lo1 under jails? 

ps: English isn't my native language. Sorry if I made any mistake


----------



## da1 (Sep 26, 2010)

Hi,

yes it is normal (it means you created a "normal" jail a.k.a without network stack virtualization)

If you want to prevent this, read http://forums.freebsd.org/showthread.php?p=92687 look at "man ifconfig" (search vnet).


----------



## stepanovmsu (Sep 26, 2010)

da1 said:
			
		

> Hi,
> 
> yes it is normal (it means you created a "normal" jail a.k.a without network stack virtualization)
> 
> If you want to prevent this, read http://forums.freebsd.org/showthread.php?p=92687 look at "man ifconfig" (search vnet).



I have amd64 and FreeBSD 8.1-p1. I'm try add "options VIMAGE" and comment "options SCTP"
but I've got kernel panic on boot
Browsing Internet find this:
http://wiki.polymorf.fr/index.php/Howto:FreeBSD_jail_vnet


----------



## da1 (Sep 27, 2010)

I also got several kernel panics and I decided to try VIMAGE alongside SCTP and I was incredibly amazed that it worked.
The "experiment" was on a 8.1 i386 and amd64 on a Lenovo T400.

However, on a 8.0, I couldn't manage to compile VIMAGE in any combination of options (afaik, vimage is still considered experimental and this is confirmed by a dmesg line stating that fact)

Another thing that pops into my head is the date of the kernel source you are using. On the 8.1 system I was using the ones from the CD and not the newest ones.


----------

