mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-08 22:39:56 +00:00
40961978ee
The macTableManager attribute of a network's bridge subelement tells libvirt how the bridge's MAC address table (used to determine the egress port for packets) is managed. In the default mode, "kernel", management is left to the kernel, which usually determines entries in part by turning on promiscuous mode on all ports of the bridge, flooding packets to all ports when the correct destination is unknown, and adding/removing entries to the fdb as it sees incoming traffic from particular MAC addresses. In "libvirt" mode, libvirt turns off learning and flooding on all the bridge ports connected to guest domain interfaces, and adds/removes entries according to the MAC addresses in the domain interface configurations. A side effect of turning off learning and unicast_flood on the ports of a bridge is that (with Linux kernel 3.17 and newer), the kernel can automatically turn off promiscuous mode on one or more of the bridge's ports (usually only the one interface that is used to connect the bridge to the physical network). The result is better performance (because packets aren't being flooded to all ports, and can be dropped earlier when they are of no interest) and slightly better security (a guest can still send out packets with a spoofed source MAC address, but will only receive traffic intended for the guest interface's configured MAC address). The attribute looks like this in the configuration: <network> <name>test</name> <bridge name='br0' macTableManager='libvirt'/> ... This patch only adds the config knob, documentation, and test cases. The functionality behind this knob is added in later patches.
22 lines
758 B
XML
22 lines
758 B
XML
<network>
|
|
<name>default</name>
|
|
<uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
|
|
<bridge name="virbr0" macTableManager="kernel"/>
|
|
<forward mode="nat" dev="eth1"/>
|
|
<ip address="192.168.122.1" netmask="255.255.255.0">
|
|
<dhcp>
|
|
<range start="192.168.122.2" end="192.168.122.254"/>
|
|
<host mac="00:16:3e:77:e2:ed" name="a.example.com" ip="192.168.122.10"/>
|
|
<host mac="00:16:3e:3e:a9:1a" name="b.example.com" ip="192.168.122.11"/>
|
|
</dhcp>
|
|
</ip>
|
|
<ip family="ipv4" address="192.168.123.1" netmask="255.255.255.0">
|
|
</ip>
|
|
<ip family="ipv6" address="2001:db8:ac10:fe01::1" prefix="64">
|
|
</ip>
|
|
<ip family="ipv6" address="2001:db8:ac10:fd01::1" prefix="64">
|
|
</ip>
|
|
<ip family="ipv4" address="10.24.10.1">
|
|
</ip>
|
|
</network>
|