mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
conf: allow setting peer address in <ip> element of <interface>
The peer attribute is used to set the property of the same name in the
interface IP info:
<interface type='ethernet'>
...
<ip family='ipv4' address='192.168.122.5'
prefix='32' peer='192.168.122.6'/>
...
</interface>
Note that this element is used to set the IP information on the
*guest* side interface, not the host side interface - that will be
supported in an upcoming patch.
(This is an updated *re*-commit of commit 690969af, which was
subsequently reverted in commit 1d14b13f).
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
Signed-off-by: Laine Stump <laine@laine.org>
This commit is contained in:
committed by
Laine Stump
parent
f1e0d0da11
commit
93135abf14
@@ -4967,6 +4967,7 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
<source network='default'/>
|
||||
<target dev='vnet0'/>
|
||||
<b><ip address='192.168.122.5' prefix='24'/></b>
|
||||
<b><ip address='192.168.122.5' prefix='24' peer='10.0.0.10'/></b>
|
||||
<b><route family='ipv4' address='192.168.122.0' prefix='24' gateway='192.168.122.1'/></b>
|
||||
<b><route family='ipv4' address='192.168.122.8' gateway='192.168.122.1'/></b>
|
||||
</interface>
|
||||
@@ -4985,21 +4986,30 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
<span class="since">Since 1.2.12</span> the network devices and host devices
|
||||
with network capabilities can be provided zero or more IP addresses to set
|
||||
on the target device. Note that some hypervisors or network device types
|
||||
will simply ignore them or only use the first one. The <code>family</code>
|
||||
attribute can be set to either <code>ipv4</code> or <code>ipv6</code>, the
|
||||
<code>address</code> attribute holds the IP address. The <code>prefix</code>
|
||||
is not mandatory since some hypervisors do not handle it.
|
||||
<span class="since">Since 1.2.12</span> network devices and
|
||||
hostdev devices with network capabilities can optionally be provided
|
||||
one or more IP addresses to set on the network device in the
|
||||
guest. Note that some hypervisors or network device types will
|
||||
simply ignore them or only use the first one.
|
||||
The <code>family</code> attribute can be set to
|
||||
either <code>ipv4</code> or <code>ipv6</code>, and the
|
||||
<code>address</code> attribute contains the IP address. The
|
||||
optional <code>prefix</code> is the number of 1 bits in the
|
||||
netmask, and will be automatically set if not specified - for
|
||||
IPv4 the default prefix is determined according to the network
|
||||
"class" (A, B, or C - see RFC870), and for IPv6 the default
|
||||
prefix is 64. The optional <code>peer</code> attribute holds the
|
||||
IP address of the other end of a point-to-point network
|
||||
device <span class="since">(since 2.0.0)</span>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<span class="since">Since 1.2.12</span> route elements can also be added
|
||||
to define the network routes to use for the network device. The attributes
|
||||
of this element are described in the documentation for the <code>route</code>
|
||||
element in <a href="formatnetwork.html#elementsStaticroute">network definitions</a>.
|
||||
This is only used by the LXC driver.
|
||||
<span class="since">Since 1.2.12</span> route elements can also be
|
||||
added to define IP routes to add in the guest. The attributes of
|
||||
this element are described in the documentation for
|
||||
the <code>route</code> element
|
||||
in <a href="formatnetwork.html#elementsStaticroute">network
|
||||
definitions</a>. This is used by the LXC driver.
|
||||
</p>
|
||||
|
||||
<h5><a name="elementVhostuser">vhost-user interface</a></h5>
|
||||
|
||||
@@ -2629,6 +2629,11 @@
|
||||
<ref name="ipPrefix"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="peer">
|
||||
<ref name="ipAddr"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<empty/>
|
||||
</element>
|
||||
</zeroOrMore>
|
||||
|
||||
Reference in New Issue
Block a user