Skip to main content
Question

link aggregation via command line


Forum|alt.badge.img+23
  • Esteemed Contributor
  • 850 replies

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?

4 replies

Forum|alt.badge.img+13

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

Forum|alt.badge.img+23
  • Author
  • Esteemed Contributor
  • 850 replies
  • August 7, 2014

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.


Forum|alt.badge.img+9
  • Contributor
  • 116 replies
  • October 26, 2014

@franton have you tried to add

networksetup -addDeviceToBond <device name> <bond name>

Forum|alt.badge.img+23
  • Author
  • Esteemed Contributor
  • 850 replies
  • October 27, 2014

I'll have another go once i've recovered from the JNUC induced jet lag!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings