openvswitch-vxlan-(libvirt虚拟机) 配置实例

本文档详细介绍了如何在Ubuntu 13.04环境下,通过OpenvSwitch和libvirt来配置VXLAN隧道,包括主机网络环境设定、编译安装OpenvSwitch和libvirt、配置网桥、创建虚拟机以及VXLAN测试。重点是使用VXLAN连接两个主机上的虚拟机,实现网络互通。
摘要由CSDN通过智能技术生成

一 :测试环境介绍:

host1:  ubuntu13.04  

              (uanme -r )   3.8.0-16-generic

                cat  /etc/network/interfaces

auto eth0
iface eth0  inet static
        address 10.100.5.241
        netmask 255.255.0.0
        broadcast 10.100.255.255
        gateway 10.100.0.254
        dns-nameservers 10.1.0.3


host2: 

ubuntu13.04  

              (uanme -r )   3.8.0-16-generic

                cat  /etc/network/interfaces

               auto  eth0
iface eth0 inet static
        address 10.100.5.247
        netmask 255.255.0.0
        network 10.100.0.0
        broadcast 10.100.255.255
        gateway 10.100.0.254
        dns-nameservers 10.1.0.3


( 二 至五步骤host1  和host2 操作相同。字体有颜色的地方两台机器不同之处)


二: 编译安装openvwitch和libvirt 源码:

1    编译安装openvswitch:  

    (参考: http://networkstatic.net/configuring-vxlan-and-gre-tunnels-on-openvswitch/ )

apt-get update
apt-get install -y git automake autoconf gcc uml-utilities libtool build-essential git pkg-config linux-headers-`uname -r`
wget http://openvswitch.org/releases/openvswitch-1.10.0.tar.gz
tar zxvf openvswitch-1.10.0.tar.gz
cd openvswitch-1.10.0
./boot.sh
./configure --with-linux=/lib/modules/`uname -r`/build
make && make install
make modules_install
insmod datapath/linux/openvswitch.ko
mkdir -p /usr/local/etc/openvswitch
ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema
ovsdb-server -v --remote=punix:/usr/local/var/run/openvswitch/db.sock \
                     --remote=db:Open_vSwitch,manager_options \
                     --private-key=db:SSL,private_key \
                     --certificate=db:SSL,certificate \
                     --pidfile --detach --log-file
ovs-vsctl --no-wait init
ovs-vswitchd --pidfile --detach
ovs-vsctl show

2    编译安装并启动libvirt

      ( 参考: http://blog.csdn.net/u011740215/article/details/10064527  )

三: 配置网桥并设置VXLAN: 

        ovs-vsctl add-br br0
ovs-vsctl add-port br0 eth0

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值