| 1 |
=encoding utf8 |
| 2 |
|
| 3 |
=head1 NAME |
| 4 |
|
| 5 |
xl-network-configuration - XL Network Configuration Syntax |
| 6 |
|
| 7 |
|
| 8 |
=head1 SYNTAX |
| 9 |
|
| 10 |
This document specifies the xl config file format vif configuration |
| 11 |
option. It has the following form: |
| 12 |
|
| 13 |
vif = [ '<vifspec>', '<vifspec>', ... ] |
| 14 |
|
| 15 |
where each vifspec is in this form: |
| 16 |
|
| 17 |
[<key>=<value>|<flag>,] |
| 18 |
|
| 19 |
For example: |
| 20 |
|
| 21 |
'mac=00:16:3E:74:3d:76,model=rtl8139,bridge=xenbr0' |
| 22 |
'mac=00:16:3E:74:34:32' |
| 23 |
'' # The empty string |
| 24 |
|
| 25 |
These might be specified in the domain config file like this: |
| 26 |
|
| 27 |
vif = [ 'mac=00:16:3E:74:34:32', 'mac=00:16:3e:5f:48:e4,bridge=xenbr1' ] |
| 28 |
|
| 29 |
More formally, the string is a series of comma-separated keyword/value |
| 30 |
pairs. All keywords are optional. |
| 31 |
|
| 32 |
Each device has a C<DEVID> which is its index within the vif list, starting from 0. |
| 33 |
|
| 34 |
|
| 35 |
=head1 Keywords |
| 36 |
|
| 37 |
|
| 38 |
=head2 mac |
| 39 |
|
| 40 |
If specified then this option specifies the MAC address inside the |
| 41 |
guest of this VIF device. The value is a 48-bit number represented as |
| 42 |
six groups of two hexadecimal digits, separated by colons (:). |
| 43 |
|
| 44 |
The default if this keyword is not specified is to be automatically |
| 45 |
generate a MAC address inside the space assigned to Xen's |
| 46 |
L<Organizationally Unique Identifier|https://en.wikipedia.org/wiki/Organizationally_Unique_Identifier> (00:16:3e). |
| 47 |
|
| 48 |
If you are choosing a MAC address then it is strongly recommend to |
| 49 |
follow one of the following strategies: |
| 50 |
|
| 51 |
=over |
| 52 |
|
| 53 |
=item * |
| 54 |
|
| 55 |
Generate a random sequence of 6 byte, set the locally administered |
| 56 |
bit (bit 2 of the first byte) and clear the multicast bit (bit 1 |
| 57 |
of the first byte). In other words the first byte should have the |
| 58 |
bit pattern xxxxxx10 (where x is a randomly generated bit) and the |
| 59 |
remaining 5 bytes are randomly generated See |
| 60 |
[https://en.wikipedia.org/wiki/MAC_address] for more details the |
| 61 |
structure of a MAC address. |
| 62 |
|
| 63 |
|
| 64 |
=item * |
| 65 |
|
| 66 |
Allocate an address from within the space defined by your |
| 67 |
organization's OUI (if you have one) following your organization's |
| 68 |
procedures for doing so. |
| 69 |
|
| 70 |
|
| 71 |
=item * |
| 72 |
|
| 73 |
Allocate an address from within the space defined by Xen's OUI |
| 74 |
(00:16:3e). Taking care not to clash with other users of the |
| 75 |
physical network segment where this VIF will reside. |
| 76 |
|
| 77 |
|
| 78 |
=back |
| 79 |
|
| 80 |
If you have an OUI for your own use then that is the preferred |
| 81 |
strategy. Otherwise in general you should prefer to generate a random |
| 82 |
MAC and set the locally administered bit since this allows for more |
| 83 |
bits of randomness than using the Xen OUI. |
| 84 |
|
| 85 |
|
| 86 |
=head2 bridge |
| 87 |
|
| 88 |
Specifies the name of the network bridge which this VIF should be |
| 89 |
added to. The default is C<xenbr0>. The bridge must be configured using |
| 90 |
your distribution's network configuration tools. See the L<wiki|https://wiki.xenproject.org/wiki/Network_Configuration_Examples_(Xen_4.1%2B)> |
| 91 |
for guidance and examples. |
| 92 |
|
| 93 |
|
| 94 |
=head2 gatewaydev |
| 95 |
|
| 96 |
Specifies the name of the network interface which has an IP and which |
| 97 |
is in the network the VIF should communicate with. This is used in the host |
| 98 |
by the vif-route hotplug script. See L<wiki|https://wiki.xenproject.org/wiki/Vif-route> for guidance and |
| 99 |
examples. |
| 100 |
|
| 101 |
NOTE: netdev is a deprecated alias of this option. |
| 102 |
|
| 103 |
|
| 104 |
=head2 type |
| 105 |
|
| 106 |
This keyword is valid for HVM guests only. |
| 107 |
|
| 108 |
Specifies the type of device to valid values are: |
| 109 |
|
| 110 |
=over |
| 111 |
|
| 112 |
=item * |
| 113 |
|
| 114 |
C<ioemu> (default) -- this device will be provided as an emulate |
| 115 |
device to the guest and also as a paravirtualised device which the |
| 116 |
guest may choose to use instead if it has suitable drivers |
| 117 |
available. |
| 118 |
|
| 119 |
|
| 120 |
=item * |
| 121 |
|
| 122 |
C<vif> -- this device will be provided as a paravirtualised device |
| 123 |
only. |
| 124 |
|
| 125 |
|
| 126 |
=back |
| 127 |
|
| 128 |
|
| 129 |
=head2 model |
| 130 |
|
| 131 |
This keyword is valid for HVM guest devices with C<type=ioemu> only. |
| 132 |
|
| 133 |
Specifies the type device to emulated for this guest. Valid values |
| 134 |
are: |
| 135 |
|
| 136 |
=over |
| 137 |
|
| 138 |
=item * |
| 139 |
|
| 140 |
C<rtl8139> (default) -- Realtek RTL8139 |
| 141 |
|
| 142 |
|
| 143 |
=item * |
| 144 |
|
| 145 |
C<e1000> -- Intel E1000 |
| 146 |
|
| 147 |
|
| 148 |
=item * |
| 149 |
|
| 150 |
in principle any device supported by your device model |
| 151 |
|
| 152 |
|
| 153 |
=back |
| 154 |
|
| 155 |
|
| 156 |
=head2 vifname |
| 157 |
|
| 158 |
Specifies the backend device name for the virtual device. |
| 159 |
|
| 160 |
If the domain is an HVM domain then the associated emulated (tap) |
| 161 |
device will have a "-emu" suffice added. |
| 162 |
|
| 163 |
The default name for the virtual device is C<vifDOMID.DEVID> where |
| 164 |
C<DOMID> is the guest domain ID and C<DEVID> is the device |
| 165 |
number. Likewise the default tap name is C<vifDOMID.DEVID-emu>. |
| 166 |
|
| 167 |
|
| 168 |
=head2 script |
| 169 |
|
| 170 |
Specifies the hotplug script to run to configure this device (e.g. to |
| 171 |
add it to the relevant bridge). Defaults to |
| 172 |
C<@XEN_SCRIPT_DIR@/vif-bridge> but can be set to any script. Some example |
| 173 |
scripts are installed in C<@XEN_SCRIPT_DIR@>. |
| 174 |
|
| 175 |
Note on NetBSD HVM guests will ignore the script option for tap |
| 176 |
(emulated) interfaces and always use |
| 177 |
C<XEN_SCRIPT_DIR/qemu-ifup> to configure the interface in bridged mode. |
| 178 |
|
| 179 |
=head2 ip |
| 180 |
|
| 181 |
Specifies the IP address for the device, the default is not to |
| 182 |
specify an IP address. |
| 183 |
|
| 184 |
What, if any, effect this has depends on the hotplug script which is |
| 185 |
configured. A typically behaviour (exhibited by the example hotplug |
| 186 |
scripts) if set might be to configure firewall rules to allow only the |
| 187 |
specified IP address to be used by the guest (blocking all others). |
| 188 |
|
| 189 |
|
| 190 |
=head2 backend |
| 191 |
|
| 192 |
Specifies the backend domain which this device should attach to. This |
| 193 |
defaults to domain 0. Specifying another domain requires setting up a |
| 194 |
driver domain which is outside the scope of this document. |
| 195 |
|
| 196 |
|
| 197 |
=head2 rate |
| 198 |
|
| 199 |
Specifies the rate at which the outgoing traffic will be limited to. |
| 200 |
The default if this keyword is not specified is unlimited. |
| 201 |
|
| 202 |
The rate may be specified as "/s" or optionally "/s@". |
| 203 |
|
| 204 |
=over |
| 205 |
|
| 206 |
=item * |
| 207 |
|
| 208 |
C<RATE> is in bytes and can accept suffixes: |
| 209 |
|
| 210 |
=over |
| 211 |
|
| 212 |
=item * |
| 213 |
|
| 214 |
GB, MB, KB, B for bytes. |
| 215 |
|
| 216 |
|
| 217 |
=item * |
| 218 |
|
| 219 |
Gb, Mb, Kb, b for bits. |
| 220 |
|
| 221 |
|
| 222 |
=back |
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
=item * |
| 227 |
|
| 228 |
C<INTERVAL> is in microseconds and can accept suffixes: ms, us, s. |
| 229 |
It determines the frequency at which the vif transmission credit |
| 230 |
is replenished. The default is 50ms. |
| 231 |
|
| 232 |
|
| 233 |
=back |
| 234 |
|
| 235 |
Vif rate limiting is credit-based. It means that for "1MB/s@20ms", the |
| 236 |
available credit will be equivalent of the traffic you would have done |
| 237 |
at "1MB/s" during 20ms. This will results in a credit of 20,000 bytes |
| 238 |
replenished every 20,000 us. |
| 239 |
|
| 240 |
For example: |
| 241 |
|
| 242 |
'rate=10Mb/s' -- meaning up to 10 megabits every second |
| 243 |
'rate=250KB/s' -- meaning up to 250 kilobytes every second |
| 244 |
'rate=1MB/s@20ms' -- meaning 20,000 bytes in every 20 millisecond period |
| 245 |
|
| 246 |
NOTE: The actual underlying limits of rate limiting are dependent |
| 247 |
on the underlying netback implementation. |
| 248 |
|
| 249 |
|
| 250 |
=head2 devid |
| 251 |
|
| 252 |
Specifies the devid manually instead of letting xl choose the lowest index available. |
| 253 |
|
| 254 |
NOTE: This should not be set unless you have a reason to. |
| 255 |
|
| 256 |
=head2 mtu |
| 257 |
|
| 258 |
Specifies the MTU (i.e. the maximum size of an IP payload, exclusing headers). The |
| 259 |
default value is 1500 but, if the VIF is attached to a bridge, it will be set to match |
| 260 |
unless overridden by this parameter. |
| 261 |
|
| 262 |
=head2 vlan |
| 263 |
|
| 264 |
Specifies the VLAN configuration. The format of this parameter is one or more |
| 265 |
VLAN IDs or ranges separated by forward slashes. Each term can be: |
| 266 |
|
| 267 |
=over |
| 268 |
|
| 269 |
=item * |
| 270 |
|
| 271 |
B<vlan> - a single VLAN ID in the range 1 to 4094. This can optionally followed |
| 272 |
by a B<p> to indicate the PVID or by a B<u> to indicate an untagged VLAN. C<p> |
| 273 |
implies B<u>. |
| 274 |
|
| 275 |
=item * |
| 276 |
|
| 277 |
B<vlan1>-B<vlan2> - a range of VLAN IDs from B<vlan1> to B<vlan2>, both between |
| 278 |
1 and 4094 and B<vlan1> being less than or equal to B<vlan2>. This can be |
| 279 |
optionally followed by a B<u> to indicate that the range of VLANs are untagged. |
| 280 |
|
| 281 |
=item * |
| 282 |
|
| 283 |
B<vlan>+B<offset>xB<count> - describing a range of VLAN IDs starting at B<vlan> |
| 284 |
with B<count> additional entries, each incremented by B<offset>. This can be |
| 285 |
optionally followed by a B<u> to indicate that the range of VLANs are untagged. |
| 286 |
|
| 287 |
=back |
| 288 |
|
| 289 |
Note, one VLAN ID must be marked as the PVID. In the case of a vlan |
| 290 |
specification consisting of a single VLAN ID (e.g. C<vlan=10>), the B<p> suffix |
| 291 |
may be omitted. Specifying more than one untagged VLAN ID is an advanced |
| 292 |
configuration - use with caution. |
| 293 |
|
| 294 |
For example: |
| 295 |
|
| 296 |
'vlan=10' -- meaning a single VLAN that is the PVID. |
| 297 |
'vlan=10p/20' -- VLAN 10 is the PVID and VLAN 20 is tagged. |
| 298 |
'vlan=10p/100+10x4' -- VLANs 10, 100, 110, 120, 130, 140, 150. |
| 299 |
|
| 300 |
=head2 trusted / untrusted |
| 301 |
|
| 302 |
An advisory setting for the frontend driver on whether the backend should be |
| 303 |
trusted. The frontend should deploy whatever protections it has available to |
| 304 |
prevent an untrusted backend from accessing guest data not related to the I/O |
| 305 |
processing or causing malfunction to the frontend or the whole domain. |
| 306 |
|
| 307 |
Note frontends can ignore such recommendation. |