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,然后二个虚拟网桥都可以正常工作了。

  • 相关阅读:
    TP3.2框架,实现空模块、空控制器、空操作的页面404替换||同步实现apache报错404页面替换
    调用支付宝PHP接口API实现在线即时支付功能(UTF-8编码)
    JQuery实现的 checkbox 全选;<select>下拉框功能
    使用PHP做移动端 api接口开发方法(适用于TP框架)
    Eclipse jvm启动参数在哪设置
    对 META标签 的一点点了解
    Java反射在整个程序运行中的位置
    Java 为什么要使用反射(通俗易懂的举例)
    粗略介绍Java AQS的实现原理
    Java并发包中线程池的种类和特点介绍
  • 原文地址:https://www.cnblogs.com/BloodAndBone/p/1839360.html
Copyright © 2011-2022 走看看