Solved FreeBSD 9.3 - LACP, vlan trunking and jails

I have a fresh install HP www development server running FreeBSD 9.3 with a quad port intel gigabit nic in it for a total of 5 NICS. I want to use the onboard nic for server mgmt on vlan1 and setup a 4 port LACP trunk to my core switch. Then I want to run multiple vlans / subnets through the trunk to a couple of jails.

Individually I know how to setup a vlan(4), a jail(8), LACP, etc, but I don't know how to put it all together ie., have each jail route over it's individual VLAN through the trunk. Can anyone advise me or point me to a how to?

Thanks! Rich

One last thing, I don't necessarily want the trunk virtual adapter to have an ip address. I just want it to exist for the purpose of passing VLAN traffic
 
Hi Rich,

I have this on some of my servers, bunch of VLANs belonging to different jails. Mind you I use sysutils/ezjail because managing is very easy.
This is /usr/local/etc/ezjail/dmz_dhcp

Code:
export jail_dmz_dhcp_hostname="dmz_dhcp"
export jail_dmz_dhcp_ip="192.168.120.67, 127.0.1.1"
export jail_dmz_dhcp_rootdir="/usr/jails/dmz_dhcp"
export jail_dmz_dhcp_exec_start="/bin/sh /etc/rc"
export jail_dmz_dhcp_exec_stop=""
export jail_dmz_dhcp_mount_enable="YES"
export jail_dmz_dhcp_devfs_enable="YES"
export jail_dmz_dhcp_devfs_ruleset="devfsrules_jail_dmz_dhcp"
export jail_dmz_dhcp_procfs_enable="YES"
export jail_dmz_dhcp_fdescfs_enable="YES"
export jail_dmz_dhcp_image=""
export jail_dmz_dhcp_imagetype="zfs"
export jail_dmz_dhcp_attachparams=""
export jail_dmz_dhcp_attachblocking=""
export jail_dmz_dhcp_forceblocking=""
export jail_dmz_dhcp_zfs_datasets=""
export jail_dmz_dhcp_cpuset=""
export jail_dmz_dhcp_fib=""
export jail_dmz_dhcp_parentzfs="tank/ezjail"
export jail_dmz_dhcp_parameters=""
export jail_dmz_dhcp_post_start_script=""

Setting up jail in /etc/rc.conf by hand is very similar, commands are same. Notice the IP above, that's the one I have configured on vlan(4) interface. All filtering, i.e. pf(4) is done inside master instance, not jail. If you need any more pointers let me know.


BR
 
Hi Rich,

I have this on some of my servers, bunch of VLANs belonging to different jails. Mind you I use sysutils/ezjail because managing is very easy.
This is /usr/local/etc/ezjail/dmz_dhcp

Code:
export jail_dmz_dhcp_hostname="dmz_dhcp"
export jail_dmz_dhcp_ip="192.168.120.67, 127.0.1.1"
export jail_dmz_dhcp_rootdir="/usr/jails/dmz_dhcp"
export jail_dmz_dhcp_exec_start="/bin/sh /etc/rc"
export jail_dmz_dhcp_exec_stop=""
export jail_dmz_dhcp_mount_enable="YES"
export jail_dmz_dhcp_devfs_enable="YES"
export jail_dmz_dhcp_devfs_ruleset="devfsrules_jail_dmz_dhcp"
export jail_dmz_dhcp_procfs_enable="YES"
export jail_dmz_dhcp_fdescfs_enable="YES"
export jail_dmz_dhcp_image=""
export jail_dmz_dhcp_imagetype="zfs"
export jail_dmz_dhcp_attachparams=""
export jail_dmz_dhcp_attachblocking=""
export jail_dmz_dhcp_forceblocking=""
export jail_dmz_dhcp_zfs_datasets=""
export jail_dmz_dhcp_cpuset=""
export jail_dmz_dhcp_fib=""
export jail_dmz_dhcp_parentzfs="tank/ezjail"
export jail_dmz_dhcp_parameters=""
export jail_dmz_dhcp_post_start_script=""

Setting up jail in /etc/rc.conf by hand is very similar, commands are same. Notice the IP above, that's the one I have configured on vlan(4) interface. All filtering, i.e. pf(4) is done inside master instance, not jail. If you need any more pointers let me know.


BR

Thanks. I plan on using ezjail too so this should be very helpful. Do you have a copy of your rc.conf and possibly /boot/loader.conf you can share? my confusion lies in how do I setup the vlans over the lagg(4) ... for instance, what does your cloned_interfaces line look like? This is mine right now;

Code:
ifconfig_bce0="inet 10.0.1.5 netmask 0xffffff00"
defaultrouter="10.0.1.1"
sshd_enable="YES"
moused_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
#
ifconfig_em0="up"
ifconfig_em1="up"
ifconfig_em2="up"
ifconfig_em3="up"
cloned_interfaces="lagg0"
ifconfig_lagg0="laggproto lacp laggport em0 laggport em1 laggport em2 laggport em3"

Most every blog I've seen about adding vlans to the cloned_interfaces with your lagg (which is a common sense approach considering thats where they go IMHO) brings the lagg down.
 
/etc/rc.conf
Code:
ifconfig_em0="up"
ifconfig_em1="up"
ifconfig_em2="up"
ifconfig_em3="up"
cloned_interfaces="lagg0 vlan100 vlan60"
ifconfig_lagg0="laggproto lacp laggport em0 laggport em1 laggport em2 laggport em3"
ifconfig_vlan100="vlan 100 vlandev lagg0"
ifconfig_vlan60="vlan 60 vlandev lagg0"

This appears to be working (I previously assigned IP's to the vlans and ping tested) - am now trying to integrate them with setfib and some jails - will post the results and mark the thread as solved if / when I get it working
 
Back
Top