# Multiple lagg interfaces



## s0ke (Jun 15, 2015)

Is it possible to slice up a box with four NIC ports into two separate lagg interfaces? So for example if I wanted port 1,2 to be a lagg0 interface for management network. And port 3,4 to be another lagg1 interface for iSCSI traffic. The only issue is that they would be on the same subnet? I created the following in my /etc/rc.conf:
	
	



```
ifconfig_em0="up"
ifconfig_em1="up"
cloned_interfaces="lagg0"
ifconfig_lagg0="laggproto lacp laggport em0 laggport em1"
ipv4_addrs_lagg0="10.0.0.5/24"
defaultrouter="10.0.0.1"

ifconfig_em2="up"
ifconfig_em3="up"
cloned_interfaces="lagg1"
ifconfig_lagg1="laggproto lacp laggport em2 laggport em3"
ipv4_addrs_lagg1="10.0.0.6/24"
defaultrouter="10.0.0.1"
```
lagg1 is the only one that came up.


----------



## phoenix (Jun 15, 2015)

Yeah, makes sense.

rc.conf is basically a sh(1) script.  Which means, if you put the same variable in multiple times (*defaultrouter*, *cloned_interfaces*), then the last entry takes precedence.  Instead of listing it twice, you list it once, with two values:


```
cloned_interfaces="lagg0 lagg1"
```


----------



## SirDice (Jun 15, 2015)

Having two interfaces on the same subnet is going to cause problems. Regardless if they are 'physical' interfaces like em(4) or 'virtual' ones like lagg(4).


----------



## s0ke (Jun 15, 2015)

Brilliant.  Thank you.


----------



## s0ke (Jun 15, 2015)

lagg1 will be on a separate VLAN from lagg0.


----------



## kpa (Jun 15, 2015)

s0ke said:


> lagg1 will be on a separate VLAN from lagg0.



Yes but you'll still have a routing issue with two separate interfaces sharing the same subnet and that's not going to work on FreeBSD. What is the problem you're trying to solve with such configuration?


----------



## s0ke (Jun 15, 2015)

We are using FreeBSD as a ZFS SAN.  We were trying to separate the 4 nics into 2 separate port channels.   Ideally one for mgmt and one for iscsi traffic.  But yes seeing that they are the same subnet it does make sense to just use the one bond.


----------



## gkontos (Jun 15, 2015)

I have 2 different LAGG interfaces, working without any problems:

```
ifconfig_igb1="up"
ifconfig_igb3="up"
ifconfig_ix0="up"
ifconfig_ix1="up"

cloned_interfaces="lagg0 lagg1"

ifconfig_lagg0="laggproto lacp laggport igb1 laggport igb3 192.168.10.32/24"
ifconfig_lagg1="laggproto lacp laggport ix0 laggport ix1 192.168.10.33/24"
```


----------



## s0ke (Jun 19, 2015)

So to revisit this.  I have been reading and since I am going full iSCSI should I not bond the interfaces?  And use multipathing instead?

Currently:

Host1
Int2 [iscsi Vlan40] <--------> Switch 1 <-----------> ZFS SAN Int 2-3 LACP Bond

Int3 [iscsi Vlan40] <--------> Switch 2 <-----------> ZFS SAN Int 2-3 LACP Bond

Is it better to split the interfaces up on the SAN each with its own IP and then set up multipathing on our host box?

Thanks


----------

