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

  • 相关阅读:
    Less学习笔记
    如何在网页启动Windows服务
    让VS2010记住TFS的登陆用户名和密码
    调式WP程序报0x80131500错误的解决办法
    FizzBuzzWhizz是算法题吗?我从设计的角度去解决的。
    基于Roslyn的远程任务平台
    优雅就一个字——设计模式之数据上传接口
    关于反射优化的疑问,单次调用时直接反射要快于委托调用反射?
    用VC++11中编译libthrift项目
    grunt初体验
  • 原文地址:https://www.cnblogs.com/BloodAndBone/p/1839360.html
Copyright © 2020-2023  润新知