You get a bonus - 1 coin for daily activity. Now you have 1 coin

Xen and multiple network cards

Practice



By default, the Xen configuration scripts and its settings file specify a setup for a single network card. It also says that if you have more than one card in the system, you should write the bring-up scripts yourself.

Let's look at a situation where our server has 2 network cards installed and we need both of them to be available to guest virtual machines via bridges.

So,

1) Go to /etc/xen/scripts and create a file network-bridge-wrapper with the following content:

#!/bin/sh

/etc/xen/scripts/network-bridge "$@" netdev=eth0
/etc/xen/scripts/network-bridge "$@" netdev=eth1


2) Make it executable

# chmod +x network-bridge-wrapper


3) In the Xen configuration file we specify that we need to use this file to set up the bridge:

...

# It is possible to use the network-bridge script in more complicated
# scenarios, such as having two outgoing interfaces, with two bridges, and
# two fake interfaces per guest domain. To do things like this, write
# yourself a wrapper script, and call network-bridge from it, as appropriate.
#
(network-script network-bridge-wrapper)

...

Make sure that the other network scripts (network script), including the standard network-bridge, are commented out, so as not to create an "oops" in the configuration. That is, we need only our network-bridge-wrapper script to be active, the rest must be commented out.


Restart the Xen hypervisor and enjoy your two bridges (eth0, eth1).

You can configure an even larger number of interfaces and/or other types in exactly the same way.

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Computer networks"

Terms: Computer networks