zoukankan      html  css  js  c++  java
  • Xen下配置多个虚拟网桥以使用多块网卡(转)

    Xen下配置多个虚拟网桥以使用多块网卡

    来源地址: http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Virtual...

    Process to setup multiple Red Hat Virtualization bridges:

    1. Configure another network interface using either the system-config-network application. Alternatively, create a new configuration file named ifcfg-ethX in the /etc/sysconfig/network-scripts/ directory where X is any number not already in use. Below is an example configuration file for a second network interface called eth1
            $ cat /etc/sysconfig/network-scripts/ifcfg-eth1
            DEVICE=eth1
            BOOTPROTO=static
            ONBOOT=yes
            USERCTL=no
            IPV6INIT=no
            PEERDNS=yes
            TYPE=Ethernet
            NETMASK=255.255.255.0
            IPADDR=10.1.1.1
            GATEWAY=10.1.1.254
            ARP=yes
    2. Copy the file, /etc/xen/scripts/network-bridge, to /etc/xen/scripts/network-bridge.xen.
    3. Comment out any existing network scripts in /etc/xen/xend-config.sxp and add the line network-xen-multi-bridge.
    4. Create a custom script to create multiple Red Hat Virtualization network bridges. A sample scripts is below, this example script will create two Red Hat Virtualization bridges (xenbr0 and xenbr1) one will be attached to eth1 and the other one to eth0. If you want to create additional bridges just follow the example in the script and copy/paste the lines accordingly:
            #!/bin/sh
            # network-xen-multi-bridge
            # Exit if anything goes wrong.
            set -e
            # First arg is the operation.
            OP=$1
            shift
            script=/etc/xen/scripts/network-bridge.xen
            case ${OP} in
            start)
            $script start vifnum=1 bridge=xenbr1 netdev=eth1
            $script start vifnum=0 bridge=xenbr0 netdev=eth0
            ;;
            stop)
            $script stop vifnum=1 bridge=xenbr1 netdev=eth1
            $script stop vifnum=0 bridge=xenbr0 netdev=eth0
            ;;
            status)
            $script status vifnum=1 bridge=xenbr1 netdev=eth1
            $script status vifnum=0 bridge=xenbr0 netdev=eth0
            ;;
            *)
            echo 'Unknown command: ' ${OP}
            echo 'Valid commands are: start, stop, status'
            exit 1
            esac

    我理解其中第3步就是将xend-config.sxp配置文件中的(network-script network-bridge)替换为(network-script network-xen-multi-bridge),假定将第4步创建的脚本命名为network-xen-multi-bridge。
    我在修改配置时,没有写前面的network-script,在重新启动后一个虚拟网桥都没有找到,因为服务器正在使用中,不能频繁重新启动,所以尝试手工执行/etc/xen/scripts/network-xen-multi-bridge start,然后二个虚拟网桥都可以正常工作了。

  • 相关阅读:
    网易举办首届云创大会,优云软件助力司南战略
    优云软件助阵ArchSummit全球架构师峰会
    优云软件闪耀中国双态运维大会·乌镇峰会
    优云亮相GOPS2017全球运维大会 “黑科技”获全场最高关注
    用Monitor简单3步监控中间件ActiveMQ
    优云软件应邀出席 ITSS 数据中心运营管理工作组 2017 年春季研讨会
    机器人运维时代已来临?这是真的......
    automation轻松“一点”,搞定裸机安装系统
    SEL Event Records
    工作摘要
  • 原文地址:https://www.cnblogs.com/BloodAndBone/p/1839360.html
Copyright © 2011-2022 走看看