-1

i need to create a bridge with public ip for assigning public ip to VM. But how can i create a Network bridge,as there is a default "xenbr0" bridge exists.

Editing Xenbr0 is not permanent,how can i make it persistent against service restarts?

2
  • Are you using Citrix XenServer, XCP, or something you built yourself? Aug 6, 2012 at 10:47
  • XCP Xen Cloud platform Aug 6, 2012 at 12:58

1 Answer 1

1

So, in XCP (and XenServer), bridges are made for each one of your physical NICs (pnic). These start at xenbr0 for the first NIC and are numbered upwards from there. In the current version of XCP modifications to OVS bridges are not persisted across restarts - you will have to make your own init script to apply your modifications that is run on each restart.

This can be very simple - you just need to implement start() - stop() and restart() can just report that they are unsupported, and then use chkconfig --add my_init_script to get it integrated into the boot process. I've pasted an example init script below (which sets an openflow controller, which is probably not what you want, but you can simply replace the start() method with the commands you need:

#!/bin/bash
#
# Init file for OpenFlow configuration
#
# chkconfig: 2345 21 78
# description: OpenFlow bridge configuration
#

# source function library
. /etc/rc.d/init.d/functions

VSCTL=/usr/bin/ovs-vsctl

controller_ip=192.168.0.200

start() {
  $VSCTL set-controller xenbr0 tcp:$controller_ip:6633
}

stop() {
        echo -n $"Action not supported"
        failure $"Action not supported"
        echo
        return 1;
}

restart() {
        echo -n $"Action not supported"
        failure $"Action not supported"
        echo
        return 1;
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
esac
2
  • I need to create virtual bridge with out connecting to the actual interface.Using this bridge i wish to create an internal ip for every VM. Aug 7, 2012 at 4:33
  • 1
    @KevinParker: That is done in XenCenter (or XAPI) by creating a server-only private Network, and then attaching each VM to it. Aug 7, 2012 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.