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

  • 相关阅读:
    leetcode 75 颜色分类 A
    leetcode525连续数组 A
    WCF无身份验证配置
    三读设计模式
    EntityFrameWork+Oracle学习笔记搭配环境(一)
    EntityFrameWork+Oracle学习笔记DBfirst(二)
    用Python解答百度测试开发算法面试题
    Python实现采集wordpress整站数据的爬虫
    吾八哥学Python(六):运算符与表达式
    吾八哥学Python(四):了解Python基础语法(下)
  • 原文地址:https://www.cnblogs.com/BloodAndBone/p/1839360.html
Copyright © 2011-2022 走看看