KVM guest routing rule configuration
The KVM guest used here was configured with two virtual interfaces. The first interface (vic_10g_1) was configured with MacVTap and provided the management interface for the test execution automation. This interface was also used to perform MacVTap measurement used to compare with the HiperSockets results. The second interface (vic_10g_2) was configured to the Open vSwitch bridge and was used to route IP traffic across the HiperSockets links.
If your KVM guest only has a single interface, no additional routing configuration should be needed. However, if multiple interfaces are available, it is necessary to tell the KVM guest which local interface should be used to reach the HiperSockets link in the KVM host.
To steer the traffic from the KVM guest across the HiperSockets link in the KVM host, additional routing information was specified in the KVM guest. From our network workload perspective, the KVM guest is the network client, and the other LPAR is the network server. To manually apply the necessary routing information, the following command was used:
[root@kvmguest ~]# route add -net 172.31.56.0 netmask 255.255.255.0 gw 10.131.211.254 dev
vic_10g_2
For longer-term use it was desirable to have the routing information persist across reboot. Most popular Linux® distributions provide a mechanism to define “static routes”. SLES12 SP2 was used in this KVM guest. To configure a static route in SLES12 SP2, an additional network configuration file is needed. This new file is /etc/sysconfig/ifroute-vic_10g_2. The prefix for the file needs to be ifroute- followed by the network interface name that the additional routing rules apply. This file was configured with the following content:
# --- IPv4 routes in CIDR prefix notation:
# Destination [Gateway] DestinationNetmask Interface
#
172.31.56.0 10.131.211.254 255.255.255.0
Since this ifroute-interface file applies to a specific interface, it is not necessary to define the interface in the route file.
The ifroute-interface file is parsed and applied with the ifcfg-interface file when the interface is brought online, either automatically at boot or when done manually.