• 容器网络(八)准备 macvlan 环境【49】


    (七)准备 macvlan 环境

    ​ 除了 overlay,docker 还开发了另一个支持跨主机容器网络的 driver:macvlan。macvlan 本身是 linxu kernel 模块,其功能是允许在同一个物理网卡上配置多个 MAC 地址,即多个 interface,每个 interface 可以配置自己的 IP。macvlan 本质上是一种网卡虚拟化技术,Docker 用 macvlan 实现容器网络就不奇怪了。macvlan 的最大优点是性能极好,相比其他实现,macvlan 不需要创建 Linux bridge,而是直接通过以太 interface 连接到物理网络。下面我们就来创建一个 macvlan 网络。

    (1)准备实验环境

    ​ 我们会使用 host1 和 host2 上单独的网卡 enp0s9 创建 macvlan。为保证多个 MAC 地址的网络包都可以从 enp0s9 通过,我们需要打开网卡的混杂模式。

    我们会使用 host1 和 host2 上单独的网卡 enp0s9 创建 macvlan。为保证多个 MAC 地址的网络包都可以从 enp0s9 通过,我们需要打开网卡的混杂模式。

    ip link set enp0s9 promisc on
    root@host1:~# ip link show enp0s9
    3: enp0s9: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
        link/ether 00:0c:29:65:18:67 brd ff:ff:ff:ff:ff:ff
    root@host1:~# 
    
    

    确保 enp0s9 状态 UP 并且 promisc 模式已经生效。

    当前实验环境如图所示:

  • 相关阅读:
    理解HashSet及使用
    Java 集合类详解
    Java-泛型编程-使用通配符? extends 和 ? super
    回调函数及其用法
    log4j.properties 详解与配置步骤
    约瑟夫环
    泛型的约束与局限性
    把代码字体加大的办法
    System.arraycopy方法
    泛型数组列表与反射
  • 原文地址:https://www.cnblogs.com/cuiyongchao007/p/14098838.html
Copyright © 2020-2023  润新知