link aggregation via command line

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 08-06-2014 11:19 AM
Scripting question: I'm trying to bond network ports together on our mac mini servers. I can do it very successfully in the GUI but every attempt i've made at scripting this, creates the bond but fails to add the interfaces to it. Has anyone managed this through terminal?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 08-07-2014 05:56 AM
What have you tried? Maybe something like this would work?
sudo ifconfig bridge0 create
sudo ifconfig bridge0 addm en0 addm en1
sudo ifconfig bridge0 up

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 08-07-2014 06:34 AM
I got as far as the following:
eth=$( networksetup -listallhardwareports | grep -A 1 "Hardware Port: Ethernet" | grep "Device: " | cut -c 9- )
teth=$( networksetup -listallhardwareports | grep -A 1 "Hardware Port: Thunderbolt Ethernet" | grep "Device: " | cut -c 9- )
networksetup -createBond bond0 $eth $teth
This creates the bond but doesn't attach the network ports to that bond. On 10.9.2 server at least.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 10-26-2014 09:52 AM
@franton have you tried to add
networksetup -addDeviceToBond <device name> <bond name>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 10-27-2014 09:00 AM
I'll have another go once i've recovered from the JNUC induced jet lag!
