FreeBSD Netgraph Interface Bonding

From NSMWiki

Jump to: navigation, search

The following is used on FreeBSD to combine two physical interfaces (fxp1, fxp2) into a single virtual interface (ngeth0). This method allows one to take the feeds from a traditional two-output tap and present a single virtual interface to NSM applications.

#!/bin/sh
kldload ng_ether
ifconfig fxp1 promisc -arp up
ifconfig fxp2 promisc -arp up

ngctl mkpeer . eiface hook ether
ngctl mkpeer ngeth0: one2many lower one
ngctl connect fxp1: ngeth0:lower lower many0
ngctl connect fxp2: ngeth0:lower lower many1

ifconfig ngeth0 -arp up

Remember to replace fxp1 and fxp2 with the interfaces on your FreeBSD system (e.g., em0, em1, etc.).

References

ngctl(8)
I believe I first heard of this technique here.

Personal tools