veth pair
来源:互联网 发布:淘宝上的依视路假货 编辑:程序博客网 时间:2024/05/16 07:31
http://heychenbin.github.io/post/veth-pair/
Virtual Ethernet Pair简称veth pair,是一个成对的端口,所有从这对端口一 端进入的数据包都将从另一端出来,反之也是一样.
下面用例子说明veth pair的创建和使用:
现在有这样一个环境,两个网桥,一个是Linux内核网桥br1,另一个是ovs网桥 br-eth1,现在想把两个网桥连接起来,就可以用veth pair.
+------------------+ +------------------+| | | || ovs bridge | | Linux bridge || br-eth1 | | br1 || | | |+------------------+ +------------------+
首先创建一对veth pair:
[root@compute-195 ~]# ip link add eth1-br1 type veth peer name phy-br1[root@compute-195 ~]# ip link list...25: phy-br1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000 link/ether 22:83:01:db:37:b4 brd ff:ff:ff:ff:ff:ff26: eth1-br1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000 link/ether 32:b2:aa:1a:8a:13 brd ff:ff:ff:ff:ff:ff
创建成功后,可以通过ip link看到一对端口,可以通过ethtool查看他们是否成 对:
[root@compute-195 ~]# ethtool -S phy-br1NIC statistics: peer_ifindex: 26
创建成功后,就可以分别将两个端口添加到不同的网桥上:
Linux网桥
[root@compute-195 ~]# brctl addif br1 phy-br1[root@compute-195 ~]# brctl showbridge name bridge id STP enabled interfacesbr0 8000.e41f136dc9f0 no enp11s0f0 vnet0 vnet2 vnet3br1 8000.deef26d9c76a no phy-br1 vnet1 vnet4
可以看到phy-br1添加到了br1网桥上.
ovs网桥
[root@compute-195 ~]# ovs-vsctl add-port br-eth1 eth1-br1[root@compute-195 ~]# ovs-vsctl showe61b93e6-a701-4b6e-86c2-05f883885ab8 Bridge br-int fail_mode: secure Port "qvof01b51bf-71" tag: 1 Interface "qvof01b51bf-71" Port "int-br-eth1" Interface "int-br-eth1" Port br-int Interface br-int type: internal Bridge "br-eth1" Port "eth1-br1" Interface "eth1-br1" Port "eth1" Interface "eth1" Port "phy-br-eth1" Interface "phy-br-eth1" Port "br-eth1" Interface "br-eth1" type: internal ovs_version: "2.3.0"
可以看到eth1-br1也添加到了br-eth1网桥上了.这样整个网络就完成了网桥的 连接:
+------------------+ +------------------+| ovs bridge | | Linux bridge || br-eth1 | | br1 || +----------+ +----------+ || | eth1-br1 +--------------+ phy-br1 | |+-------+----------+ +----------+-------+
0 0
- veth pair
- veth pair
- network namespace与veth pair
- network namespace 与veth pair
- neutron(1)veth pair
- Linux-虚拟网络设备-veth pair
- network namespace与veth pair
- Neutron OVS Bridge 连接方式 (veth pair / ovs peer) 的选型和性能测试
- (3) Linux Switching – Interconnecting Namespaces – brctl – ovs-vsctl – veth pair
- pair
- pair
- Pair
- Pair
- pair
- 从veth看虚拟网络设备的qdisc
- 如何判读linux veth-peer是否成对
- 从veth看虚拟网络设备的qdisc
- 从veth看虚拟网络设备的qdisc
- spark2.0 部署到clouderamanager5.7 以上
- 垂直下拉菜单
- php 中curl采集应用于简介
- CREELINKS平台_处理器CeCcp资源使用说明(CeCcp的配置与使用)
- js简单工厂模式
- veth pair
- 菜鸟编程遇到的报错整理和疑问
- jdk环境变量
- MySQL之——SQL按照汉字首字母进行搜索排序
- css3.flex项目属性
- C++Primer第五版 第七章习题答案(41~50)
- httpclient
- CImage的使用
- 第一节课内容投票