Candela Technologies Logo
 
http://www.candelatech.com
sales@candelatech.com
+1 360 380 1618 [PST, GMT -8]
Network Testing and Emulation Solutions

Inspecting Ports (Network Interfaces) using lf_portmod

Goal: You will be able to report and reset ports on your LANforge server.

Port statistics can be programatically monitored using the script lf_portmod.pl. This script can also reset ports, alter WiFi station settings, and pass arbitrary LANforge CLI commands directly to the LANforge manager.

Ports of all kinds can be viewed with the lf_portmod.pl perl script. You can also do some limited manipulation of ports as well.

Listing Ports
You can show statistic on a port with the --show_port argument:
 C:\> perl .\lf_portmod.pl --quiet 1 --manager jedtest --card 1 --port_name eth1 --show_port
You can right-click to paste these commands into your DOS window
Produces:
Listing Port Attributes
Individual port attributes can also be shown, which often makes automating reporting easier.
perl .\lf_portmod.pl --manager jedtest --card 1 --quiet 1 --port_name eth1 --show_port "RxDrop,Rxp,IP"
Produces: Consider that is a lot of text to type. If we want, we can reformat that command.
Long DOS commands and be continued on the next line with the ^ character.
perl .\lf_portmod.pl --manager jedtest ^
 --card 1 --quiet 1 --port_name eth1 ^
 --show_port "RxDrop,Rxp,IP"
Produces the same output:
Loading a test scenario
Saved test scenarios are often referred to as 'databases'
lf_portmod.pl --load day_238
This matches the same database name seen in the Status tab database dropdown.
Admin-down a port
lf_portmod.pl --manager 192.168.1.101 --card 1 --port_name eth2 --set_ifstate down
Resetting a Port
Resetting a port forces a port to unload and reload its configuration.
lf_portmod.pl --manager 192.168.1.101 --card 1 --port_name eth2 --cmd reset
Sending a specific CLI command to the LANforge manager:
It is possible to directly pass a command to the LANforge manager:
lf_portmod.pl --manager 192.168.1.101 --cli_cmd "scan 1 1 sta0"

Candela  Technologies, 2417 Main Street, Suite 201, Ferndale, WA 98248, USA
www.candelatech.com | sales@candelatech.com | +1.360.380.1618
Google+ | Facebook | LinkedIn | Blog