...
LAN | +-----------+---------+ | | |
| eth0 |
| | | | +---------+-------+ | | | | | |
| | dummy | |
| | | | | | xenbr0 | | | | | | | | vif0.0 vif1.0 | | | | | | | | | +---+---------+---+ | | | | | | +---+---+ +---+---+ | | | | | | | | | | | eth0 | | eth0 | | | | | | | | | | DomU0 | | DomU1 | |
| +-------+ +-------+ | +---------------------+
/etc/network/interfaces example for single MAC address on the LAN. The DomUs are configured to use 192.168.42.100 as default gateway:
...
# Configure netfilter
pre-up iptables-restore < /etc/iptables.conf
...
# dummy0
auto dummy0
iface dummy0 inet manual
# xenbr0
auto xenbr0
iface xenbr0 inet static
bridge_ports dummy0
address 192.168.42.100
broadcast 192.168.42.255
netmask 255.255.255.0
bridge_stp off # Disable Spanning Tree Protocol
bridge_waitport 0 # No delay before a port becomes available
bridge_fd 0 # No forwarding delay
Bridge references
- TLDP's Ethernet Bridge + netfilter Howto (ish, old): http://www.tldp.org/HOWTO/Ethernet-Bridge-netfilter-HOWTO.html
- Xen: Common problems with network bridges: http://www.novell.com/support/kb/doc.php?id=7001989
- Considering the "bridge_stp off" parameter. http://wiki.xen.org/wiki/Xen_Bridge_Loop#Why_STP_is_turned_off.3F
...
On Debian, to set them during boot, put them in /etc/sysctl.conf
TODO: give examples of iptables rules that do routing.
NATting
To set up NATting (example is for eth0):
...
Its format, for use with the xl toolstack, is documented at http://xenbits.xen.org/docs/unstable/man/xl.cfg.5.html./xl.cfg.5.html.
xl shutdown
and reboot
does not effect changed configuration items; a create
is required.
Kernel parameters
Use the extra
configuration item.
Memory
Set by the memory configuration item. Numeric only (no M or G suffix allowed). Units are MB (or MiB?).
vif
vif (Default=[]; Value="type=TYPE, mac=MAC, bridge=BRIDGE, ip=IPADDR, script=SCRIPT," + \ "backend=DOM, vifname=NAME, rate=RATE, model=MODEL, accel=ACCEL" )
...
When creating Debian systems it uses debbootsrap (described above).
Required Debian packages
ntp is required. Ref: http://xen.1045712.n5.nabble.com/keeping-time-in-sync-tp5725115p5725116.html
Controlling DomUs
Start a DomU
...
To shutdown the OS and destroy the DomU: xl shutdown <DomU config path><domain-id>
For example:
cd /etc/xen && xl list
xl shutdown <domain-id> 5
In case the DomU's OS has been stopped (or will not stop!): xl destroy <domain-id>
...
Detach from the console by Ctl+[ ] or, for putty, Ctl+5
Troubleshooting
...
File or directory | Usage | Notes |
---|---|---|
/etc/default/xen | Toolstack selection | |
/etc/default/xend | ||
/etc/default/xendomains | Domain startup and shutdown config | |
/etc/xen/ | ConfigurationConfiguration | |
/etc/xen/*.cfg | Individual DomU configs | |
/etc/xen/scripts/ | Scripts and scrippets | As installed, all bash scripts. More: Xen scripts |
/etc/xen/xend-config.sxp | xend daemon (and xen-tools) configuration | |
/etc/xen/xl | xl defaults config | |
/proc/xen/ | xen-kernel information | |
/var/lib/libvirt/images | File-based images | |
/var/lib/xen/dump/ | Guest core dumps | |
/var/log/xen | Logs |
...