cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Etc


Reference














.

middleware:virtualization:xen:network_xenbr_hostbonding.html



Xen Networking

Xen:Networking:xenbrX, multi interface

Check Configuration

# grep -Ev "^#|^$" /etc/xen/xend-config.sxp | grep network-script
(network-script network-bridge)
#


Configuration

# cd /etc/xen/scripts
# mv network-bridge network-bridge.core


ex1) host bonding (recommend)

/etc/xen/scripts/network-bridge

#!/bin/sh
# Exit if anything goes wrong
set -e
 
# First arg is operation.
OP=$1
shift
 
script=/etc/xen/scripts/network-bridge.core
 
exec_operation()
{
  $script $1 vifnum=0 bridge=xenbr0 netdev=bond0
  $script $1 vifnum=1 bridge=xenbr1 netdev=bond1
}
 
case ${OP} in
  start)
    exec_operation $OP
    ;;
 
  stop)
    exec_operation $OP
    ;;
 
  status)
    exec_operation $OP
    ;;
 
  *)
    echo 'Unknown command: ' ${OP}
    echo 'Valid commands are: start, stop, status'
    exit 1
esac


ex2) guest bonding

/etc/xen/scripts/network-bridge

#!/bin/sh
# Exit if anything goes wrong
set -e
 
# First arg is operation.
OP=$1
shift
 
script=/etc/xen/scripts/network-bridge
 
 
exec_operation()
{
  $script $1 vifnum=0 brdige=xenbr0 netdev=eth0
  $script $1 vifnum=1 bridge=xenbr1 netdev=eth1
  $script $1 vifnum=2 bridge=xenbr2 netdev=eth2
  $script $1 vifnum=3 bridge=xenbr3 netdev=eth3
}
 
case ${OP} in
  start)
    exec_operation $OP
    ;;
 
  stop)
    exec_operation $OP
    ;;
 
  status)
    exec_operation $OP
    ;;
 
  *)
    echo 'Unknown command: ' ${OP}
    echo 'Valid commands are: start, stop, status'
    exit 1
esac


# chmod 755 /etc/xen/scripts/network-bridge
# reboot


Check

checking xenbr0, xenbr1

# ifconfig

# brctl show



middleware/virtualization/xen/network_xenbr_hostbonding.html.txt ยท Last modified: 2017/05/06 by admin

Page Tools