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

How virbr0-nic is created?

· 52CE 我爱测

How can I create a virtual network interface like virbr0-nic ? I am trying to find a way to create a NIC like virbr0-nic but everything which I can find on the Internet is how to create an interface attached to the physical inter…

问题原文

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

How can I create a virtual network interface like virbr0-nic? I am trying to find a way to create a NIC like virbr0-nic but everything which I can find on the Internet is how to create an interface attached to the physical interface like eth0:0. When I write

# brctl show
bridge name bridge id       STP enabled interfaces
virbr0      8000.525400e0af01   yes virbr0-nic
virbr1      8000.525400e8a6b1   yes virbr1-nic
                            vnet1

So virbr0 is the bridge to which virbr0-nic is attached. So how are virbr0-nic and vnet1 created?

社区高分解答

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

These are dummy devices. You can run

modprobe dummy

To create a network interface called dummy0.

If you want more than one device, you can create say 5 with

modprobe dummy numdummies=5

You can then control these devices like any other network device.

Give it a MAC address with

ip link set dummy0 address aa:aa:aa:bb:bb:bb

Give it an IP address with

ip addr add 10.0.0.1/24 dev dummy0

Add it to your existing bridge with

brctl addif virbr0 dummy0

Set it up, set it down, NAT off it, and so on.

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

资料来源与适用范围

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

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

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