mercoledì 3 febbraio 2016

pfSense on XenServer: enable VLAN Support for xn ethernet adapter

I was migrating my PfSense boxes from vmware to xenserver and I was disappointed when trying to create a VLAN the XenServer xn interface wasn't listed as capable.

I lurked in forums in search for a solution and found that in stock BSD the xn interface is reported working fine with VLANs, even the vlanmtu is not reported as capable at driver level.

So my idea is to cheat pfsense and report xn network devices as VLAN capable.

Here's the trick:

Go to Diagnostic -> Edit File
Load file /etc/inc/interfaces.inc

Locate the function is_jumbo_capable ( in pfsense 2.2.6 starts at line 5181) end edit as is:

/****f* interfaces/is_jumbo_capable
 * NAME
 *   is_jumbo_capable - Test if interface is jumbo frame capable.  Useful for determining VLAN capability.
 * INPUTS
 *   $int             - string containing interface name
 * RESULT
 *   boolean          - true or false
 ******/
function is_jumbo_capable($iface) {
$iface = trim($iface);
$capable = pfSense_get_interface_addresses($iface);

if (isset($capable['caps']['vlanmtu']))
return true;

// hack for some lagg modes missing vlanmtu, but work fine w/VLANs
if (substr($iface, 0, 4) == "lagg")
return true;

        // hack for XenServer xn interfaces
if (substr($iface, 0, 2) == "xn")
return true;


return false;
}


Then go to Interfaces->Assign->VLAN and create your VLAN interface on your xn network!


Refers To: Pfsense issue 4103

3 commenti:

  1. Hi there, how it's working after changes ? did you find some issue to remark ?

    RispondiElimina
    Risposte
    1. In some case it works fine and in some case there's some issues passing traffic from non tagged lan to tagged ones.
      Needs extensive testing

      Elimina
  2. Questo commento è stato eliminato dall'autore.

    RispondiElimina