Pegasi Wiki

This wiki acts as a memo for our own work so why not share them? Feel free to browse and use out notes and leave a note while at it.

Deployment of virtual template to server

Copy image

Copy image from start template to the new guest disk.

Find out the right disk LUN from NAS and copy (replace NN with LUN):

dd if=/dev/disk/by-path/ip-\\:ts-459uplus\:iscsi.pegasi.cf8790-lun-15 of=/dev/disk/by-path/ip-\\:ts-459uplus\:iscsi.pegasi.cf8790-lun-NN bs=128k

Copy configuration

virsh dumpxml >

Edit the file and change:

  • name
  • uuid
  • source dev
  • mac address x 2
  • channel name start → <virtual host name>
virsh define

(ip and mac)

Edit guest OS

virsh start --console

Log in to the guest and change

  • /etc/hostname
  • /etc/hosts
  • /etc/sysconfig/network
  • /etc/sysconfig/network-scripts/ifcfg-eth0 (ip and mac)
  • /etc/sysconfig/network-scripts/ifcfg-eth1 (ip and mac)
  • /etc/sysconfig/network-scripts/route-eth0
  • /etc/sysconfig/network-scripts/route-eth1
  • /etc/sysconfig/network-scripts/rule-eth0
  • /etc/sysconfig/network-scripts/rule-eth1

Ping ip address to check it is not taken.

Route tables

Add internal and external to /etc/iproute2/rt_tables

1       internal
2       public

Add internal and external routes to /etc/sysconfig/network-scripts/route-ethN

$NETWORK dev $DEVICE src $IPADDRESS table public
default via $DEFAULT_GW dev $DEVICE table public
$NETWORK dev $DEVICE src $IPADDRESS table internal
default via $DEFAULT_GW dev $DEVICE table internal

Add internal and external rules to /etc/sysconfig/network-scripts/route-ethN

from $IPADDRESS table internal

Add a bridged interface to guest

A configured and working bridge device must exist to do this.

Bring the interface down

ifdown xxx

Add a bridge to the host

Edit the interface ifcfg init file:

cd /etc/sysconfig/network-scripts
cp -a ifcfg-xxx /root/
vim ifcfg-xxx

Remove lines:


Add lines to the end of the file:


Add a new configuration file for the bridge

vim ifcfg-brN

Add lines (copy the IP address and mask from the original)


Set selinux context

First check the current contexts and copy the right one from there

ls -alZ

Then set it

chcon system_u:object_r:net_conf_t:s0 ifcfg-brN 

Fire up the interface and the bridge

I think you only need to fire up the bridge but I did both

ifup brN
ifup xxx

Add the interface to guest

List existing network devices of a domain first

virsh domiflist <domain>

From there copy the correct values and add an existing bridge to a domain

virsh attach-interface bridge br3 --mac 52:54:00:87:75:04 --model rtl8139 --live --config

Leave a comment

Enter your comment:

  //check if we are running within the DokuWiki environment if (!defined("DOKU_INC")){ die(); } //place the needed HTML source codes BELOW this line