# Make two network cards act as one



## idaho-axe (Jun 8, 2013)

*H*ow is this done with freebsd FreeBSD? *I*n *L*inux you create a bond0 adn and two salve files*,* 1 one for each nice (whatever --mod), and then add a bonding.conf file to /etc/modprobe.d/*.*

*D*if*f*erent policies of active passive or active active make network*s* more tolerant of failure*.*

*H*ow do you configure that in fbsd FreeBSD?


----------



## Anonymous (Jun 8, 2013)

You would use the network bridge device if_bridge(4)() for this.

Assuming your NICs are em0 and em1, placing something like the following in /etc/rc.conf would suffice to bring-up both NICs into bridged mode on restart, having the one common (bridged) network address. 


```
cloned_interfaces="bridge0"
ifconfig_em0="up"
ifconfig_em1="up"
ifconfig_bridge0="inet 192.168.0.1/24 addm em0 addm em1"
```

This is not limited to two NICs.


----------



## marwis (Jun 8, 2013)

Have a look at lagg(4) ("Link Aggregation and Failover" in the FreeBSD Handbook).


----------



## idaho-axe (Jun 8, 2013)

*V*ery cool, thx thanks*.*

Is this covered in the handbook or elsewhere?


----------



## Anonymous (Jun 8, 2013)

Network-Bridging is covered here: 32.5. Bridging


----------



## idaho-axe (Jun 8, 2013)

I need an example of lagg done not by hand but with configuration files, and not bridging.


----------



## idaho-axe (Jun 8, 2013)

*lagg cloned interfaces example*

http://www.freebsd.org/cgi/man.cgi?query=lagg&sektion=4

What I want is: two network cards share 1 one *IP*. *U*nplug 1 one. *T*he second keeps working*.* I think this is called cloned interface in freebsd FreeBSD. I can't find an example of setting this in rc.conf. *C*an someone provide an example?


----------



## idaho-axe (Jun 9, 2013)

idaho-axe said:
			
		

> http://www.freebsd.org/cgi/man.cgi?query=lagg&sektion=4
> 
> What I want is: two network cards share 1 one *IP*. *U*nplug 1 one. *T*he second keeps working*.* I think this is called cloned interface in freebsd FreeBSD. I can't find an example of setting this in rc.conf. *C*an someone provide an example?



*T*here is no example of the config files for a cloned interface*.*

*S*igh*,* who keeps rewriting my posts and getting them mixed up???


----------



## fonz (Jun 9, 2013)

idaho-axe said:
			
		

> Sigh, who keeps rewriting my posts and getting them mixed up?


Sigh, since you appear to entirely ignore every notice or warning sent to you via PM, I'll have one shot (and no more) at answering this.

Your posts are edited by moderators because, despite several warnings, you still refuse to write properly. You don't format your posts at all, you put pretty much every sentence in it's own paragraph, you don't start sentences with capital letters, you don't terminate sentences with punctuation, you consistently refuse to properly spell FreeBSD, you keep sprinkling Twitter/IM/SMS lingo through your posts, etc.

Please note that moderation issues are not normally discussed in public. For more information, I suggest you start reading the PMs that were sent to you.


----------



## fonz (Jun 9, 2013)

Oh, and to actually answer your question:


			
				idaho-axe said:
			
		

> What I want is: two network cards share one IP. Unplug one. The second keeps working. I think this is called cloned interface in FreeBSD. I can't find an example of setting this in rc.conf. Can someone provide an example?


More precisely, it's "network aggregation in failover mode". For examples, see this section of the FreeBSD Handbook. You'll probably want examples 32.2 and/or 32.3.


----------



## Crest (Jun 9, 2013)

This is an example rc.conf snippet:

```
ifconfig_ix0="up"
ifconfig_ix1="up"
cloned_interfaces="$cloned_interfaces lagg0"
ifconfig_lagg0="laggproto failover laggport ix0 laggport ix1 10.0.0.2/24"
```


----------



## mmoll (Jun 9, 2013)

idaho-axe said:
			
		

> I need an example of lagg done not by hand but with configuration files, and not bridging.



I'm using the following in /etc/rc.conf:

```
cloned_interfaces="lagg0"
ifconfig_bge0="up"
ifconfig_bge1="up"
ifconfig_lagg0="up laggproto failover laggport bge0 laggport bge1 1.2.3.4/24"
```


----------

