Freenas / FreeBSD: Bridge 2 NICs Together with 1 IP Address for Use with ISCSI

I was having issues getting this working initially. I came to find out that the Mellanox ConnectX-3 adapter I was using had a driver fault that made this not work. I got a CHELSIO CC2-N320E-SR instead and it worked fine. If this does not work, it might be a driver issue. This post is more of a PSA than a how-to, as its pretty easy.

 

Save the following (but replace the adapter names and IP with what you want) to somewhere as a .sh file

#!/bin/sh
ifconfig bridge create
sleep 1
ifconfig bridge0 addm nic1 addm nic2 up
ifconfig nic1 up
ifconfig nic2 up
ifconfig bridge0 inet ipaddress/cidr
ifconfig nic1 mtu 9000
ifconfig nic2 mtu 9000
ifconfig bridge0 mtu 9000
sleep 5 
service ctld stop 
sleep 1
service ctld reload
sleep 1
service ctld start

On the FreeNAS web interface, go to tasks > init/shutdown scripts and click add.

Set the type as command, the command to “sh /path/to/your/script.sh”, and when to post init.

 

Now it will boot and run the script to setup the bridge and start ISCSI.

About: Ryan Parker

Professionally im a Infrastructure Security Specialist. I current maintain a homelab with about 3TB of RAM, 240+ TB of storage, tons of CPU cores, and 100gbit networking backbone in the garage running up my electricity bill.


Leave a Reply

Your email address will not be published. Required fields are marked *