大网数据广告活动
服务器运维问答

Direct Veth Pair vs Linux Bridge

· 52CE 我爱测

I'm trying different network configurations between LXC containers to learn something and have fun. I've just found out that two containers can communicate with just a veth pair, so I'd like to know from experts why all the tutor…

问题原文

原帖链接 · JumpAlways · CC BY-SA 3.0

I'm trying different network configurations between LXC containers to learn something and have fun.

I've just found out that two containers can communicate with just a veth pair, so I'd like to know from experts why all the tutorials show procedures that include a bridge in the host conected to the veth ends.

I though a simple veth pair could easily replace a MACvlan bridge mode where the host can't communicate with the containers.
Are there some security implications?

Whare are the real advantages of Linux Bridges and Open vSwitches with this configuration (only two namespaces)?

已采纳解答

原帖链接 · Spooler · CC BY-SA 3.0

This isn't normally done because connecting only two instances directly together with a veth pair isn't very useful. We use bridging as a virtual switch so that we can reasonably connect many instances to the same external and host-only networks. Even in cases where you're only running two containers, it's typical to have to expand real-world implementations at some point.

There aren't many security implications with what you describe, at least no more than when connecting your veth pair to a bridge.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-02-13)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。