Skip to content

Quick guide Simple ping check on two machines

Ondrej Lichtner edited this page Sep 23, 2013 · 9 revisions

Test setup

  test machine 1           test machine 2
  --------------           --------------
    eth0  eth1               eth1  eth0
     |     |                  |     |
     |     |    +--------+    |     |
     |     +----| SWITCH |----+     |
     |          +--------+          |
     |                              |
     |          +--------+          |
     +----------| SWITCH |----------+
                +--------+
                    |
                    |
                   eth0
            ------------------
            controller machine
            (e.g. your laptop)

Test goal

We want to ping test machine 2 (eth1) from test machine 1 (eth1).

LNST recipe

Save the following code into file recipe.xml on controller machine.

Modify:

  • hostname inside <params> tag to match the IP addresses or host names of test machine 1 and test machine 2
  • hwaddr inside <eth> tag to match the MAC addresses of the "eth1" interface on test machine 1 and test machine 2
<lnstrecipe>
    <machines>
        <machine id="testmachine1">
            <params>
                <param name="hostname" value="192.168.1.2"/>
            </params>
            <interfaces>
                <eth network="tnet" id="testifc1">
                    <params>
                        <param name="hwaddr" value="52:54:01:00:00:05"/>
                    </params>
                    <addresses>
                         <address value="192.168.200.2/24"/>
                    </addresses>
                </eth>
            </interfaces>
        </machine>

        <machine id="testmachine2">
            <params>
                <param name="hostname" value="192.168.1.3"/>
            </params>
            <interfaces>
                <eth network="tnet" id="testifc2">
                    <params>
                        <param name="hwaddr" value="52:54:01:00:00:06"/>
                    </params>
                    <addresses>
                        <address value="192.168.200.3/24"/>
                    </addresses>
                </eth>
            </interfaces>
        </machine>
    </machines>

    <task>
        <run module="IcmpPing" machine="testmachine1">
            <options>
                <option name="addr" value="{ip(testmachine2,testifc2)}"/>
                <option name="count" value="3"/>
            </options>
        </run>
    </task>
</lnstrecipe>

Running the test

First you need to make sure that the lnst-slave daemon is running on the specified slave machines. To do this you run:

$ systemctl start lnst-slave.service

on all the slave machines. You can learn more about the LNST invocation in LNST Invocation.

After you've made sure that lnst is running on all the slave machines you just need to run the controller. To do this you run:

$ lnst-ctl -c recipe.xml run

on the controller machine.

References