Skip to content

Instantly share code, notes, and snippets.

@scottslowe
Created January 22, 2014 23:14
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottslowe/8569424 to your computer and use it in GitHub Desktop.
Save scottslowe/8569424 to your computer and use it in GitHub Desktop.
This script can be used to automatically attach LXC instances to Open vSwitch (OVS) on startup. You'll need to call this script from the container's configuration using the "lxc.network.script.up" configuration parameter.
#!/bin/bash
BRIDGE="br-int"
ovs-vsctl --may-exist add-br $BRIDGE
ovs-vsctl --if-exists del-port $BRIDGE $5
ovs-vsctl --may-exist add-port $BRIDGE $5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment