TrueNAS SCALE: LAGG, VLAN and Bridge Interfaces - 夜莺博客

TrueNAS SCALE: LAGG, VLAN and Bridge Interfaces

A TrueNAS box is rarely on one flat network. Block storage wants a dedicated VLAN with jumbo frames, VM traffic wants a bridge so guests share the host subnet, and management should survive a single NIC failure. TrueNAS SCALE models all three as virtual interface types -- LAGG, VLAN and bridge -- created from System > Network and added on top of physical NICs. This guide covers the working configuration and the constraints that surprise people.

Pick the right type for the job

  • LAGG (bond) - combines several NICs into one logical link. Use LACP when the switch supports active LACP; use failover where it does not; loadbalance balances flows without LACP but uses no other aggregation settings. LACP adds bandwidth and redundancy for many clients, it does not load balance a single TCP stream.
  • VLAN - segments one physical link into multiple isolated networks. The parent interface is usually a physical NIC attached to a switch port configured as trunk.
  • Bridge - lets VMs sit on the host's network instead of a private internal segment; required if guests must be reachable from the LAN.

The same bonding choices on a plain Linux host are covered in Linux Bonding 802.3ad: LACP Rate and Hash Policy if you need to compare behaviour before committing.

Building the stack in the right order

  1. Create the LAGG first (for example bond0, LACP, two members). Nothing above it can exist while the members are still plain interfaces.
  2. Create the VLAN on top of the LAGG - parent bond0, tag 20 - and give it the IP address for the storage network.
  3. If VMs need the same link, create a bridge and attach the VLAN (or a spare NIC) as its member, then select that bridge in the VM's NIC settings.

Naming is fixed by type: bondX, vlanX, brX. The interface type cannot be changed after saving, and the name cannot be changed after applying, so plan the layout before you start clicking.

Jumbo frames for iSCSI and NFS

# on TrueNAS: set MTU 9000 on the storage VLAN interface
# on the switch: MTU 9216 on the access port / trunk
# on the initiator: verify end to end
ping -M do -s 8972 10.20.30.10

MTU 9000 only helps if every hop agrees. Raise the switch and initiator MTU first, then the NAS interface -- and never raise MTU on a LAGG member before its switch port-channel, or traffic silently fragments.

Do not lock yourself out

  • Multiple interfaces on one subnet are rejected by design; use a LAGG or aliases instead of two NICs in the same range.
  • When you edit the interface carrying the web UI, TrueNAS asks you to confirm the change within a countdown. Keep a console session open; if you do not confirm, the change rolls back automatically.
  • New link aggregations are not available until the system restarts, so schedule interface work in a maintenance window.
  • IPMI is separate from the OS interfaces and is your out-of-band fallback if the network configuration goes wrong.

Once the storage VLAN is up, verify from the initiator side: multipath should show one path per controller with MPIO in the running state, as covered in Synology iSCSI LUN for VMware ESXi Datastores with MPIO. If the array presents LUNs but the host sees one path only, the problem is almost always the LAGG not being in LACP or the switch not having a matching port-channel.

原文链接:https://truenas.com/docs/scale/scaletutorials/network/interfaces