问题原文
原帖链接 · 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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
