This section describes a configuration setup example for the following network configuration.
1) Setting up the network on the host OS
1-1) Define the IP addresses and host names you use in the /etc/hosts file.
192.168.80.1 hosta # virtual IP address of the host OS 192.168.80.100 swhub1 # IP address of the primary monitoring destination's HUB 192.168.80.101 swhub2 # IP address of the secondary monitoring destination's HUB |
1-2) Edit /etc/sysconfig/network-scripts/ifcfg-ethX (X is 0,1) file as follows.
Contents of /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 BOOTPROTO=static HWADDR=XX:XX:XX:XX:XX:XX HOTPLUG=no ONBOOT=yes DEVICETYPE=hanet |
Contents of /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1 BOOTPROTO=static HWADDR=XX:XX:XX:XX:XX:XX HOTPLUG=no ONBOOT=yes DEVICETYPE=hanet |
1-3) Configure the /etc/sysconfig/network file to enable the network setting.
NETWORKING=yes |
2) Setting the redundant line switching mode
2-1) Setting the virtual interface
/opt/FJSVhanet/usr/sbin/hanetconfig create -n sha0 -m v -t eth0,eth1
2-2) Setting an IP address and a subnet mask
Define an IP address or a subnet mask in /etc/sysconfig/network-scripts/ifcfg-sha0 file.
Contents of /etc/sysconfig/network-scripts/ifcfg-sha0
DEVICE=sha0 IPADDR=192.168.80.1 NETMASK=255.255.255.0 BOOTPROTO=static ONBOOT=yes DEVICETYPE=sha |
2-3) Setting the network monitoring function
/opt/FJSVhanet/usr/sbin/hanetpathmon target -n sha0 -p 192.168.80.100,192.168.80.101
3) Setting up the virtual network
3-1) Define the virtual bridge (xenbr0). For details, see the RHEL manuals.
Contents of /etc/xen/scripts/network-bridge-gls
#!/bin/sh # # Sample of Create/Delete virtual bridge # # $1 start : Create virtual bridge # stop : Delete virtual bridge # status: Display virtual bridge information # Exit if anything goes wrong #set -e command=$1 xenscript=/etc/xen/scripts/network-bridge # op_start:subscript for start operation # op_start () { $xenscript $command vifnum=0 netdev=sha0 } # op_stop:subscript for stop operation # op_stop () { # same operation as start op_start } case "$command" in start) # Create your virtual bridge op_start ;; stop) # Delete virtual bridge op_stop ;; status) # display virtual bridge information $xenscript status ;; *) echo "Unknown command: $command" >&2 echo 'Valid commands are: start, stop, status' >&2 exit 1 esac |
3-2) Save the created script in "/etc/xen/scripts".
# cp network-bridge-gls /etc/xen/scripts # cd /etc/xen/scripts # chmod +x network-bridge-gls |
3-3) Register with the xend service
Contents of /etc/xen/xend-config.sxp
# Your default ethernet device is used as the outgoing interface, by default.
# To use a different one (e.g. eth1) use
#
(omitted)
#
(network-script network-bridge-gls) |
3-4) Edit the domain configuration file
The network interface for the guest OS should be connected to the primary virtual bridge (xenbr0) that you set in "3-1)". The following shows an example of the domain configuration file. Set the virtual bridge name in the "vif" parameter. For details on the domain configuration file, see the RHEL manuals.
Contents of /etc/xen/domain name (domain configuration file)
vif=["mac=XX:XX:XX:XX:XX:XX,bridge=xenbr0"] |
3-5) Reboot
To enable the network settings for Domain-0, execute the following command and reboot the system. After rebooting the system, use the ifconfig command to check that sha0 is activated.
/sbin/shutdown -r now
4) Setting up a guest OS
Set up an IP address. Edit the "/etc/sysconfig/network-scripts/ifcfg-ethX" file as you would for the host OS.