Candela Technologies Logo
Network Testing and Emulation Solutions

Learn CLI commands used create Generic endpoints.

Goal: Compare and learn script and CLI commands used when creating and operating Generic endpoints.

Similar to the Layer3 perl script,, the script has been enhanced to use curl or other commands with parameter expansions. The script is a helper script that wraps curl commands and reports success or failure.

Introduced in LANforge 5.3.8.

Example Commands

  1. Creating ports and MAC VLANs
  2. Creating ping endpoints
  3. Creating curl endpoints
  4. Using parameters for endpoint options
  5. Using the lf_curl.shscript

Setting for Examples

Generic endpoints are effectively one-legged connections. You can ping an IP or use curl to download web content. Both of these types of connections can be pointed back at the LANforge itself. We can operate these connections from redirect interfaces. The same techniques can apply to WiFi stations, of course.

Create Redirects

  1. Create a bridge br0 including eth1
  2. In Netsmith, select br0→Modify and enable DHCP
  3. Create a redirect r1a, r1b
  4. Add r1a to br0
  5. Create 10 MAC VLANs based off r1b with DHCP enabled
  6. After the MAC VLAN ports have addresses, you can verify that you can ping and download pages from LANforge webserver:
    1. In a terminal, begin by sourcing lanforge.profile:
      /home/lanforge$ . lanforge.profile
    2. Ping the bridge from a MAC VLAN:
      /home/lanforge$ ping -I
    3. Grab the web page. (Apache is listening on all ports by default.)
      /home/lanforge$ curl -sq --interface

Creating ping endpoints

In the /home/lanforge/scripts directory, the script creates a wrapped ping command by default. There is another script, lfping, that reports ping results to LANforge. Here is an example of creating 1 ping endpoint:

/home/lanforge/scripts$ ./ --mgr localhost --resource 1 \
     --dest --interface r1b#0 --name pingtest

Create a ping endpoint for every MAC VLAN parented by r1b:

 $ ./ --mgr localhost --resource 1 \
     --dest --parent r1b

Create a ping endpoint for every virtual station parented by wiphy0:

 $ ./ --mgr localhost --resource 1 \
     --dest --radio wiphy0

Create a ping endpoint for every MAC VLAN beginning with r1b#1 (r1b#1, r1b#10):

 $ ./ --mgr localhost --resource 1 \
     --dest --match 'r1b#1'

Creating curl endpoints

To use other commands with the script, you can create a --cmd parameter. You can use curl directly if desired, but curl's output is not formatted well for LANforge to understand. By default, commands do not understand what port or IP they should be interacting as. We need to provide special parameters to help.

Parameter expansion

The script will look for these tokens in the --cmd parameter:

The curl wrapper script

The scripts/ script is a wrapper for curl that detects success or failure, and an operate the request in a loop. Expandable parameters are expanded by, not

You can use from the command line to test it out:

 $ ./ -i -p r1b#1 -o /tmp/output -d


curl -sqLk --interface -o /tmp/output_r1b#1

So it is best used from to construct commands referencing this script:

./ --mgr localhost --resource 1 \
     --name curl_ex_ --match 'r1b#'  --dest \
     --cmd ' -o /tmp/curl_%p.out -i %i -d %d -p %p'

Candela  Technologies, 2417 Main Street, Suite 201, Ferndale, WA 98248, USA | | +1.360.380.1618
Facebook | LinkedIn | Blog