Various Techniques Cookbooks
The Various Techniques Cookbooks provide miscellaneous examples of how to
perform various network configuration tasks. Each is a set
of step-by-step instructions intended to help build your familiarity with
network configuration in Linux and Windows.
Please contact us at
support@candelatech.com if you have any questions.
All Network Configuration Cookbook Examples
- Server Install Script lf_kinstall.pl
- Configure Auxiliary Management
- Find Windows IP Addresses
- Find Windows MAC Addresses
- Custom DOS Window Settings
- Quickly Inspect Your DOS PATH Variable
- Connecting With PuTTY
- Install Arduino Mega Driver on Windows XP
- Install Arduino Mega Driver on Windows 7
- Install Arduino Mega Driver on Windows 10
- Connect to LANforge Using Remote Desktop
- Connect to LANforge Using VNC Viewer
- Display WireShark Using Cygwin
- Finding Report Data
- Writing Disk Images on Windows
- Adding a LANforge Virtual Machine
- Configuring Serial Connection to LANforge
- Connecting SMA Cables to LANforge
- Diagnose GUI Problems on Windows
- Recovering Filesystems
- Automatically Start LANforge GUI on Login
- Configure OpenVPN on Ubuntu
- Configure OpenVPN on Windows
- CI/CD Lights-Out Chamber Setup
- Instructions to Change Report Logo
- Instructions to Set Up an SSH Tunnel
- Understanding VRF Devices
- Use FireFox with a Virtual Station to Browse a DUT
- Backing Up and Migrating LANforge Data
- CT714B Stand Assembly
- CT840a Turntable Testing
- Remove old Reports and Data
- Clustering Multiple LANforge Systems
- Configure a Remote LANforge System
- Configure NTP Chronyd on Fedora
- Upgrading Offline LANforge Systems
- Multiplexed REST Access via Nginx Proxy
- LANforge Troubleshooting
Install Script lf_kinstall.pl
Goal:
Install and reconfigure your LANforge server with the lf_kinstall.pl script.
The
lf_kinstall.pl script can configure a majority of Linux OS features
that LANforge requires changes to. This includes:
- Disabling SELinux
- Disableing firewall
- Downloading dnf and LANforce updates
- Adding VNC and RDP access
- Adding firmware
- Disabling or reconfiguring NetworkManager
- Enabling serial console
- Modifying kernel options for iommu, pci-aer and kernel memory
- ...and more...
Usage
lf_kinstall.pl --lfver {lanforge version} --kver {kernel version} {command}
Note: the parameters --do_kern and --do_grub requires the --kver option to specify the kernel version.
Candelatech Linux kernels end with "+" to denote extra patches.
Use --debug|--verbose|-d to enable debugging.
Example: ./lf_kinstall.pl --kver 3.5.7+ --lfver 5.2.7 --do_lanforge
Parameters
- lfver
- Specify LANforge version (i.e., 5.2.6)
- kver
- Specify kernel version, use a + at the end of kernel versions for Candelatech kernels
- skip_kern
- Do not install a kernel package, suppresses do_grub, do_kern
- hwver
- Specify the hardware string: CT521, CT52x-PR, CT521, CT520, LF0202, CT523, CT523c, CT314, LF0312, LF0313, CT522
Can help with html info page configuration. Leave blank if unsure.
- com-speed
- Specify serial com speed (defaults to 115200)
- com_port
- Specify the serial com port (defaults to ttyS0)
- source_dir
- Specify location of installation files (must be absolute path).
- tmp_dir
- Specify the script temporary working directory and
backups of system files.
- download_only
- Download files to tmp-dir, but do not install them or make other
changes.
- ignore_err
- Ignore any (otherwise fatal) errors. May be useful for offline
installs where some functionality is better than none.
- proxy
- Use a proxy for curl, e.g. http://%user:%password@%proxy-ip:%port
- do_all_ct
- Enables all options except: --xrandr, --runlevel
- do_all
- Enables all options except: --xrandr, --biosdevname, --runlevel, and --serial
Skips the CPU burn-in test.
- do_upgrade
- Upgrades LANforge software, kernel, firmware, packages and OS packages.
No system settings altered. Skips cpu-burn.
- do_update
- alias for do_upgrade
- do_ct_st
- Download and install LANforge software and kernel only.
Enables 'do_lanforge do_kern do_grub do_http do_selinux=0 do_iommu=0 do_firmware'
No yum update.
No system settings altered, except for selinux and iommu.
- do_ct_swak
- Download and install LANforge software but only update grub to
point to an already installed kernel.
Enables 'do_lanforge do_grub do_http do_selinux=0 do_iommu=0 do_firmware'
No system settings altered, except for selinux and iommu.
- do_lanforge
- Installs LANforge software ONLY, i.e. no kernel installed.
No system settings altered.
- do_firmware
- Download and install ath10k 802.11AC NIC firmware.
- do_kern
- Install the kernel via download or --source_dir.
Enables 'do_grub' option.
- do_radius
- Install and configure radius server (with default values).
- skip_radius
- Do not attempt to reconfigure radius. Useful when attempting to speed up do_sys_reconfig on slow systems.
- force_new_certs
- Re-generate the HotSpot 2.0 R2 (HS20-R2) and/or RADIUS
certs, even if we have previously created them.
- do_hs20
- Build keys, configure apache ssl and other actions to enable
this system to act as an HS20-R2 server. Requires specific
LANforge configuration as well before this will actually work.
This option must be explicitly enabled: It is not enable as part
of any of the other option groupings.
- hs20_server_ip
- IP Address to advertise as HS20 servers. This could be IP
address of management port in simple configurations, and for
more realistic configurations, perhaps the IP address of something
in same network as the HS20 OSEN and .1x APs.
- build_scrcpy
- Clone and build scrcpy tool (should not be needed for latest 5.4.6 builds)
- do_services
- Enable/Disable services to work well with LANforge.
- ntwk_mgr_ok
- Enable NetworkManager. It is disabled by default.
- do_pkgs
- Install packages from Internet needed by LANforge.
- show_large_pkgs
- Show top 20 largest packages. Useful during do_image_prep if you
want to reduce install footprint.
- do_only_pkgs
- Only install packages (and groups) and exit. Use when creating VMs or if you
want to install all distro packages and reboot before proceeding.
If you want to download everything needed, install yum packages for development imaging:
1) touch /home/lanforge/did_cpuburn /home/lanforge/did_disktest
2) ./lf_kinstall.pl --lfver ___ --kver ___ --do_selinux=0 --skip_yum_all
3) ./lf_kinstall.pl --lfver ___ --kver ___ --skip_yum_all --do_all_ct --force_web \
--tmp_dir /home/lanforge/Downloads --download_from http://ctdownloads/ --download_only
4) reboot
5) ./lf_kinstall.pl --lfver ___ --kver ___ --do_only_pkgs
6) poweroff and make your snapshot
- do_yum_update
- Update OS packages from Internet.
- use_yum_cache
- do not erase and rebuild yum cache
- do_selinux
- Configure selinux (it conflicts with LANforge.)
do_grub should also be enabled to modify the kernel boot commands.
0: Disabled (default, if do_all and related options are selected)
1: Enabled
-1: Use current settings
- do_grub
- Modify the grub config files to boot the specified kernel.
- do_xrandr
- Add work-around to disable LVDS1 using xrandr.
This works around Gnome issues on the Lanner WiFi appliances,
and perhaps other systems.
- do_vnc
- Configure VNC for user lanforge.
- do_http
- Serve LANforge related files at http://localhost
- do_gnome
- Tweak gnome settings (enble desktop icons, etc)
- do_udev
- Create /etc/udev/rules.d/70-persistent-net.rules file if
it does not already exist. It may still need hand-editing.
- do_biosdevname
- Enable biosdevname for interface names (uses terms like enp0s1 instead of eth0).
Only takes affect when --do_grub is enabled.
0: Disabled
1: Enabled
-1: Use current settings (default)
- do_serial
- Enable serial console configuration in grub.
0: Disabled
1: Enabled
-1: Use current settings (default)
Only takes affect when do_grub is enabled.
- do_runlevel
- Configure system to run-level 3 or 5
0: Use current settings (do nothing)
3: Set to use runlevel 3 (non graphical login)
5: Set to use runlevel 5 (graphical login, needed for cinnamon)
- do_elevator
- Add kernel option elevator=noop (i.e. not deadline) for single SSD CFQ optimisation.
0: Disabled
1: Enabled
-1: Use current settings (default)
Only takes affect when do_grub is enabled.
- do_cma
- Configure cma buffer for extra VRF buffer space.
Use with --do_grub, applies on reboot. Use these choices:
-1: do not change
0: disable
1: apply 64 megabyte value
>1: apply this value in megabytes
Example: --do_grub --do_cma 48
- do_iommu
- Configure system to enable/disable intel_iommu. This kernel feature decreases performance,
so LANforge typically wants this disabled for optimal Ethernet performance. This can also be disabled in
the BIOS by disabling the VT-d option and IOMMU options.
0: Disabled (default for do_all_ct, do_all, do_ct_swak, do_ct_st)
1: Enabled
-1: Use current settings (default)
Only takes affect when do_grub is enabled.
IOMMU is useful in these conditions:
* virtual machine hosting
* MediaTek radios
* Ath10k radios
- do_nomitigations
- Configure system to enable/disable spectre and related mitigations.
We try to compile out most of these security features since LANforge
is not designed to be secure and performance is more important to us.
To help make sure all of these mitigations are disabled, we will also
pass command-line args to the kernel on bootup to request disabling
mitigations. Default is '1'.
0: Do not add the mitigations=off option
1: Do add the mitigations=off (default)
-1: Use current settings
Only takes affect when do_grub is enabled.
- set_swiotlb
- Configure IOMMU buffer size. Requires you use IOMMU setting, so use with --do_grub --do_iommu=1
Example: --do_grub --do_iommu=1 --set_swiotlb=65536
- do_noaer
- Configure system to enable/disable pci error reporting. Requires --do_grub.
0: Disabled (removes grub bootline parameter)
1: Enabled (adds pci=noaer bootline parameter, DEFAULT)
-1: Use current settings
- do_kmemleak
- Configure kernel option for kmemleak. Requires kernel to be compiled with
appropriate options to actually enable this.
0: Disabled
1: Enabled
-1: Use current settings (default)
Only takes affect when do_grub is enabled.
- do_ssd_fstab
- Modify rw behaviour for SSDs in /etc/fstab.
- do_save_yumc
- Specify:
1: Yum update then save cache.
20: Delete local cache first then update and save.
- do_sys_reconfig
- Attempt to re-configure system config files.
Only works on certain platforms (APU2, Jetway, Noah2, Axiomtek)
- do_vm_reconfig
- forces --do_sys_reconfig to run, looking for enpX interfaces and no radios
- skip_ifrename
- avoids renaming interfaces and rewriting 70-persistent-net
- do_ff_homepage
- updates Firefox Homepage
- do_mgt_dev
- Set LANforge management interface, defaults to eth0 on most platforms.
Does not presently use --mgt_dev option.
- make_ifcfg_eth0
- Creates /etc/sysconfig/network-scripts/ifcfg-eth0 from the
eth0 entry found in /etc/udev/rules.d/70-persistent-net.rules.
Fedora only. Edit 70-persistent first.
- do_make_clean
- Delete previous install files.
- do_cpu_burn
- Attemps the CPU burn task.
NOTE: The --skip_cpu_burn flag below has precedence.
0: Do not attempt it.
1: Do it if we have not already run it on this system previously.
2: Always run it.
>10: Run CPU burn test for specified seconds.
- do_disk_test
- should we fill and re-read disk to make sure it performs well?
0: Do not attempt it
1: Do it if /home/lanforge/did_disktest not found unless --skip_disk_test specified
>1: Always run it, ignoring --skip_disk_test
- skip_disk_test
- avoid do_disk_test if /home/lanforge/did_disktest is missing
- do_xrdp
- should we adjust the xrdp.ini and sesman.ini files:
0: ignore files
1: adjust files
- nocache
- Add fake URL argument to disable any HTTP caching.
- no_fmirror
- Uninstall yum-fastest mirror.
- help
- Show usage help.
- show_urls
- Show URLS for all files that should be downloaded, and exit.
- print_only
- show_urls without website check
- print_windows
- print out .bat file contents to help with downloading LANforge updates
- force_web
- Force script to use webserver. Do not use with --source_dir.
- download_from
- Specify web url to download LANforge packages from, implies --force_web
- build_url
- This path is appended directly after the --download_from hostname. The default
download path will not be used. The string r$lfver will not be inserted.
Build paths will not adhere to a directory pattern, use the full path.
- create_install_bundle
- create a tarball in tmp_dir for copying to another LANforge system,
will infer --osver, --osveri for current system unless you specify
--force_osver, --force_osveri
- use_install_bundle
- /path/to/bundle.tar : Upgrade LANforge using an install bundle file.
Sets $source_dir, $tmp_dir to directory containing bundle.tar file.
- force_notes
- Force creating lfnotes.html
- force_osver
- Override the detected osver string with this value.
- force_osveri
- Override the detected osversion integer with this value.
- skip_grub
- Don't do kernel install, even if other options would have selected it.
- skip_gui
- Don't install LANforge-GUI, even if other options would have selected it.
- skip_xorp
- Don't install Xorp virtual-router package, even if other options would have selected it.
- skip_fmirror
- Don't alter systems existing use of yum-plugin-fastestmirror.
- skip_cpu_burn
- Don't burn-in CPU.
- skip_yum_update
- Don't yum update packages.
- skip_yum_all
- Don't yum update packages, or install new ones.
- skip_resume
- Don't try to use HTTP resume when downloading packages.
- fix_web_root
- Enable do_http and reset the httpd.conf DocumentRoot and Directory
from /home/lanforge/candela_cdrom to /var/www/html
- do_image_prep
- Erase the network settings and dnf cache in preparation for
making a disk image for a clone. Expects /root/resize-home.sh
- do_vm_prep
- Erase the network settings and dnf cache in preparation for
making a OVA image. Expects /root/resize-home.sh
- do_fedrepos_default
- Select this option to use the fedrepos default command
if your yum.repos.d repository URLs have become misconfigured. If fedrepos
is not available, consider --do_restore_metalinks option.
- do_restore_metalinks
- Select this option if you see errors like below:
1) Repository updates-debuginfo has no mirror or baseurl set.
2) Repository updates-source has no mirror or baseurl set.
3) Repository fedora-debuginfo has no mirror or baseurl set.
4) Repository fedora-source has no mirror or baseurl set.
5) Error: Failed to synchronize cache for repo 'updates'
6) Your /etc/yum.repos.d repo files have had changes and are unable to reach mirrors.fedoraproject.org
- do_enable_archive_baseurl
- Select this option if your mirrors.fedoraproject.org URLs are
unable to provide your repository because the content has been moved to archives.fedoraproject.org
This option is pretty much opposite of --do_restore_metalinks.
- add_random_www_data
- creates a series of files in /var/www/html accessable using
the url /slug_list.html
- bind_apache_mgt_port
- configures an /etc/hosts entry lanforge-srv that matches
the ip address of the mgt_dev in /home/lanforge/config.values. Updates the
/etc/httpd or /etc/apache2 files to bind to that address. Use this option
each time you change the mgt_dev.
- install_vlc
- VLC video player requires RPMFusion repository. This adds the repository
and then installs VLC.
- download_videos
- shortcut for downloading Candelatech videos into /var/www/html/videos
so that they might be served for video testing. See /usr/local/lanforge/nginx/video.inc
for stanza when enabling directory listings when using nginx.
- do_rfgen
- shortcut to install packages necessary for using RF generator hardware
- do_abandoned_cleanup
- create cronjob that espunges systemd slices from logged out session every hour
- remove_passwords
- removes the passwords from accounts root and lanforge and reconfigures
sshd to accept empty passwords. Yes...really, it IS crazy, right?
- do_print_label
- Use the following two options to print a label with model and mac address information
1) print_host: hostname owning printer
2) print_queue: name of print queue, often 'QL-800' or 'LaserWriter-450'
3) serialno: provide the serial number for chassis, or use 'HOSTNAME'
Example: --do_print_label --print_host 192.168.100.14:8082 --print_queue QL-800 --serialno HOSTNAME
- skip_installer_check
- turn off checking md5sum of ./lf_kinstall.pl
- regen_https_key
- regenerate the /etc/pki/tls/$hostname.crt and .key files so that they have
F33+ 4096 bit keys, not smaller keys.
- update_pip
- Upgrades pip userland
- skip_pip
- Avoid doing pip upgrades; might be necessary if you have proxies
- reset_pip
- Use when pip3 updates were installed as root and you have system pip3 package conflicts.
This will reinstall the python-pip3 package and 'pip3 remove -r requirements.txt' to remove
pip3 libraries from system folder. Follow this with --update_pip to get pip3 libraries into
user lanforge folder.
- rebuild_pip
- this will uninstall the python pip user environments and build a
new one from scripts/requirements.txt; if you see errors, you probably
are missing newly required library packages provided by the distro.
To make sure your packages are up to date, use:
Example: ./lf_kinstall.pl --do_pkgs
- install_pip_lanforge_scripts
- this does a pip3 install of lanforge-scripts. This is not necessary
if you just need to use /home/lanforge/scripts/py-scripts casually.
- disable_audit_logs
- Affects kernel audit messages. Use with --do_grub and reboot to have this setting take effect.
0: enable kernel audit logs (auditd.service not enabled)
1: disable kernel audit logs
- do_enable_max_zram
- write /etc/sysctl.d/70-lanforge.conf and apply agressive zram configuration (Fedora >= 30)
To undo, remove file and reboot.
- do_gui_autostart
- Start GUI in VNC server session which starts on boot.
Requires LANforgeGUI of specified version to already be installed.
0: disable GUI autostart
1: enable GUI autostart
- save_gui_cfg
- Use this to restore GUI settings on reboot. Running this a second
time copies a changed LANforgeGUI/lfcfg.txt file to $home to save new changes.
1) backup: copies the LANforgeGUI/lfcfg.txt file to $home. Disables lfcustom_gui.bash if it exists.
2) static: implies backup, creates lfcustom_gui.bash that replaces lfcfg.txt into LANforgeGUI directory
every time LANforgeServer is started.
- remove_pipewire
- Removes pulseaudio-pipewire packages.
0: do not remove pipewire (default)
1: remove pipewire
- do_interop
- installs LANforge server, GUI, firmware and required packages on system to sufficient to allow it
to be a resource in a LANforge cluster. Right now, this focuses on Ubuntu based systems.
This also will configure Networkmanager to ignore ports except the management interface. We cannot
necessarily disable NM on interop equipment.
- regen_nm_conf
- backs up /etc/NetworkManager/NetworkManager.conf and recreates one that
specifies that no interfaces except the one with the default route be managed.
Enabled by default during do_interop. NM settings you do not want modified should
live in separate conf files in /etc/NetworkManager/conf.d. When this option is used
without the --mgt_dev option, a new management device will be determined. Default value is 1.
0: do not modify NetworkManager.conf
1: update NetworkManager.conf and mgt_dev.nmconnection
2: update NetworkManager.conf, mgt_dev.nmconnection, but do not restart NetworkManager
- mgt_dev
- indicate what interface should be configured as the management interface.
LANforge works best in cases where there is a dedicated management interface and management network
(out of band management). In the case there is only one interface and it has to serve as a traffic port
and a management port, that is possible (in band management). Currently this option is only used by
the --regen_nm_conf option. If this option is not specified Specify one of these options:
1) {interface_name}: name of the interface to set
2) "existing": force the use of the mgt_dev in /home/lanforge/config.values
- mgt_dns
- specify IP address to add to [ipv4]mgt_dev.dns value in mgt_dev.nmconnection
- mgt_ip
- specify either "dhcp" or a "ip/cird/gateway" combination for mgt_dev.nmconnection:
1) mgt_ip=dhcp
2) mgt_ip=192.168.208.24/20/192.168.208.1
- disable_resolved
- change NetworkManager dns=systemd-resolved to dns=default and disable systemd-resolved.service
create_raid|make_raid|create_lvm|make_lvm : turn two or more blank drives into a mirrored LVM filesystem
If there have been filesystems installed on these drives before,
use --wipe_raid to remove the filesystems
wipe_raid|remove_raid|remove_lvm : remove LVM volumes and signatures from specified disks.
Use this before doing --create_raid the first time on any
disk that already has a filesystem.
- create_webpage
- turn this help into html text for publication
*_dd
Note:
If you use commands "yum update" or "dnf update", and you need to use a kernel provided by the repository, use:
Example: grub2-mkconfig -o /boot/grub2/grub.cfg
Configure Auxiliary Management Interfaces
Goal: Allow LANforge to create its own wireless management network.
In cases where is is not convenient to use an existing management network, LANforge WiFi systems can be configured to provide their own WiFi management network. This may be especially useful when testing in environments where LANforge needs to be moved around or where you have no good access to existing management LANs. This example assumes that you already know how to create and configure VAP and Stations in LANforge. |
|
|
- Configure LANforge for Auxiliary Management.
- Connect LANforge systems through the normal management LAN for initial configuration. The resources should be visible in the management tab
- In this case, we are using wiphy0 for the Aux-Mgt interfaces. On the manager system, configure wiphy0 to be on the desired channel, create a virtual AP on wiphy0, and configure it appropriately. The Aux-Mgt checkbox should be selected, a static IP should be assigned, and an appropriate SSID configured. The AP Aux-Mgt port will automatically serve DHCP and will try to NAT and route packets to the wired Management interface.
- On the other resources, configure the wlanX interface to connect to the AP on the manager system, and select the Aux-Mgt checkbox.
- The Port-Mgr tab should look something like this when the Aux-Management interfaces are configured.
- To test that it works properly, you can now remove the wired Manament port connection and wait about 1 minute for the old connection to time out and re-connect to the Auxiliary Management port. Or, just reboot systems with the wired ports unplugged and they should be discovered on the Aux-Mgt ports promptly.
Windows IP Addresses
Goal: Find and change network ip addresses on Microsoft Windows.
Here are some techniques for finding and setting IP addresses on Microsoft Windows using the Control Panel and the command line. |
|
|
- Find the IP Address of the Windows PC. There are two methods you can use:
- Using the Control Panel:
- Click Start, Run, control, [enter]
- Search and select Network Status and Devices
- We click on our device, Ethernet 3:
- Find and/or set the IP address: from Status, click Properites
- double click TCP/IPv4
- you will see and can change the IP address.:
- Various DOS commands to find the IP addresses on the system:
- ipconfig and ipconfig /all
- netsh interface ipv4 show address
- Resetting your DHCP address via command line:
- ipconfig /release
- ipconfig /renew
Windows MAC Addresses
Goal: Find MAC Addresses in Microsoft Windows.
Here are some techniques for finding MAC addresses on Microsoft Windows using the Control Panel and the command line. |
|
|
Customizing DOS Window Settings
Goal: Make your DOS windows large and do cut and paste easier.
Here we review DOS window settings that will help you to work faster. |
|
|
- Customizing DOS Window Settings starts by right clicking the Start Menu
- Type in cmd and hit Enter
- To get to your DOS window faster, you can pin it to your task bar. Right click the task bar CMD window icon and select Pin this program to taskbar
- On the DOS window title bar, Right click and select the Defaults menu item
- Select the Quick Edit Mode setting. This allows you to highlight text in the window easily.
- In the Font tab, select a slimmer TrueType font, like Consolas or Lucida Console, and set the font size to 10
- In the Layout tab, change the Window Size to 132 columns and 56 rows
- Click OK to save. The next DOS window you open will appear with your customized settings.
Quickly Inspect Your DOS Path
Goal: Find if a program or is in your %PATH%
Use this technique to inspect your DOS environment variables for specific strings using findstr. |
|
|
- Follow this example to see if perl is installed and your %PATH% environment variables is updated. First, open up a DOS window: Windows+RcmdEnter
- Type in the DOS Window: echo %PATH% | findstr /i perlEnter
- If perl is installed correctly, you should have it in your path.
- You can also use this technique to find any environment variable. E.G., find if you have a temporary directory set:
set | findstr /i temp
Connecting with PuTTY
Goal: Using PuTTY on Windows to connect to LANforge Linux servers.
Lots of tasks, like scripting, can be done over SSH from your Windows desktop. Here are a few steps to help you customize your PuTTY terminal to work faster. |
|
|
Installing the Arduino Mega Driver on Windows XP
Goal: Installing the the Arduino Mega device driver on Windows XP.
The automatic driver install process for Windows XP might automatically install a Microsoft Windows version of the Arduino Mega driver. This is not the driver LANforge expects. These instructions will guide you how through uninstalling an old driver and installing the new driver. |
|
|
Installing the Arduino Mega Driver on Windows 7
Goal: Installing the the Arduino Mega device driver on Windows 7.
LANforge CT70x attenuators require recently signed Arduino drivers. The automatic driver install process for Windows 7 might automatically install a Microsoft Windows version of the Arduino Mega driver. This is not the driver LANforge expects. These instructions will guide you how through uninstalling an old driver and installing the new driver from the Arduino website. If you have recently removed a driver, you might need to reboot your Windows system for it to complete the driver installation process. |
|
|
Installing the Arduino Mega Driver on Windows 10
Goal: Installing the the Arduino Mega device driver on Windows 10.
LANforge CT70x attenuators require recently signed Arduino drivers. The automatic driver install process for Windows 10 might automatically install a Microsoft Windows version of the Arduino Mega driver. This is not the driver LANforge expects. These instructions will guide you how through uninstalling an old driver and installing the new driver from the Arduino website. If you have recently removed a driver, you might need to reboot your Windows system for it to complete the driver installation process. |
|
|
Connect to LANforge using Remote Desktop
Goal: Operate your LANforge's Linux desktop by accessing it with Windows Remote Desktop utility.
LANforge computers on Intel hardware are typically installed with a full Linux desktop. You can use the LANforge GUI, do traffic sniffing, open terminal windows, and office software to look at report data over remote desktop. LANforge computers are pre-configured with RDP and VNC desktop services. |
|
|
- From your Windows Start Menu, type "remote" and Remote Desktop Connection should be an option.
- If you are using the Start→Run menu, type mstscEnter
- If you want to create a desktop shortcut, explore the folder C:\windows\system32 and right-click mstsc.exe
- Configure your connection:
- Fedora version 24 and 25 have a bug in the vncserver triggered by xrdp. The effective way to use rdesktop on those systems is to select an Xorg session for connecting (not a Xvnc session).
- When connecting to Fedora 14-23 systems:
- User Name: lanforge
- You will not need to fill out the xrdp login screen.
- When connecting to Fedora 24-25 systems:
- Do not specify a user name, and select Always ask for credentials.
- Select Xorg as the session type
- Specify username lanforge and password lanforge
- Local Resources
- If your rdesktop session immediately closes, you might have hit the xrdp clipboard bug. If so:
- For Windows Remote Desktop (mstsc.exe): unselect Local Devices→Clipboard
- For Linux rdesktop, use the command: rdesktop -a16 -r cliboard:off -u lanforge [machine-name]
- Disable remote audio settings
- Disable local printers
- Set Server authentication to Connect and do not warn
- Connection quality can be 16-bit (millions of colors)
- Click Connect to connect to the default desktop, the default password is lanforge
- When you are DONE with your connection, you may close the Remote Desktop window. You will not be logged out. However, if you log in without setting the Username option, you will be logged into a new session alongside your old session. If you see this screen below, you are starting a new desktop session:
- To reconnect to your previous desktop session, make sure you use the Username lanforge in your connection settings.
- To logout of the desktop session, select System→Log Out from the top window of the Linux desktop.
Connect to LANforge using VNC Viewer
Goal: Operate your LANforge's Linux desktop by accessing it with the VNC Viewer utility.
LANforge computers on Intel hardware are typically installed with a full Linux desktop. You can use the LANforge GUI, do traffic sniffing, open terminal windows, and office software using a VNC Viewer program. LANforge computers are pre-configured with RDP and VNC desktop services. |
|
|
- You can download a variety of viewers:
- Check for viewer packages on your LANforge web page: http://192.168.1.101/
- or download RealVnc
- or download TightVnc
- From your Windows Start Menu, type "vnc" and VNC viewer should be an option.
- If you are using the start menu, it will be under either in All Programs > RealVNC or TightVNC
- Double click the vnc icon and it will ask you for the IP address. You want to set the Encryption option to off because we presume you are connected directly to the LANforge.
- VNC Viewer might warn you about connecting without encryption. This is a valid warning if you are connecting across public networks.
- The password is lanforge.
- You will see the LANforge Linux desktop. This is not the same desktop that is actually running on the console if you have a monitor and keyboard connected.
- When you are done with your connection, you may close the VNC viewer window. You will not be logged out. When you connect using VNC viewer again, it show the current state of that desktop. connect you to the last used VNC session.
- To restart the vnc desktop session, select you can issue either of these two commands. You start using ssh (PuTTY et. al.) to connect as lanforge to the LANforge machine, and:
- sudo systemctl restart "vncserver@:1.service"
- or
- sudo vncserver -kill :1
Display WireShark Using Cygwin
Goal: We will display the WireShark application on Windows using Cygwin when we press Sniff Packets which actually runs WireShark on the Linux LANforge machine.
The native display protocol for Linux (and Unix) is the X Display Protocol. The Cygwin.org project provides Linux software that runs natively on Windows. You can run an X display server on Windows that accepts connection from LANforge. We will walk through setting up Cygwin and configuring an X display. |
|
|
- Installing Cygwin and the X display components
- We will start at Cygwin.org and download the Cygwin installer.
- Download setup-x86.exe or setup-x86_64.exe as appropriate. Go to your Downloads folder and double start the program.
- Next
- Next
- Next
- Choose a mirror that might be close to you, click Next
- Now you see a the software selection screen, sorted by category. Some of these entries appear two or more times, because they belong to multiple categores. Try using the search box in upper middle above the software list to search for the packages listed below.
- The items you want to search for are
- openssh
- xorg-server
- xinit
- rxvt
- xlaunch
- Search for openssh and click the Skip property once to change it to the most recent version to set it to install.
- xorg-server provides the X display system
- xinit helps the X system launch
- xlaunch is what you will drag to your task bar to launch your Cygwig X server
- rxvt and rxvt-unicode are more useful terminals than the minterm program that Cygwin provides by default.
- Click Next and let the installer finish the installation of the Cygwin packages. You will see a Cygwin Terminal icon appear on your desktop and new Cygwin icons in your Start menu.
- Next we will right-click on the Cygwin Terminal icon and select Open File Location
- In the Explorer window, scroll to find xlaunch.exe, and drag it to the Task Bar
- Click the xlaunch icon on the task bar, and click Next
- Next
- Check Disable Access Control and add the option: -listen tcp. Click Next
- Firewall, Click Allow Access
- If the LANforge Messages window reports 'No Access', you might need to use xhost.exe to grant X11 access.
- Open a CMD window
- Go to the cygwin\bin folder:
C:\> cd \cygwin\bin
- Use xhost.exe to open permissions:
C:\> .\xhost.exe +
- Now your X display service is running. You can check that it's running by clicking into the System Tray and seeing if the icon is there.
- Launch the LANforge GUI from your desktop. Select a port from the Port Mgr tab. Notice how the Disp field has your laptop's LAN address. This is the display address the remote machine will display the Wireshark window to.
- You will see WireShark
- Resources and other Documentation:
- http://unix.stackexchange.com/questions/227889/cygwin-on-windows-cant-open-display
- https://www.cs.virginia.edu/~csadmin/wiki/index.php/Using_Cygwin_for_X11_Forwarding
- http://www.arsc.edu/arsc/knowledge-base/ssh-and-x11-forwarding-us/index.xml
Finding LANforge Report Data
Goal: Properly configured, the LANforge server or the LANforge GUI can
collect connection performance information in CSV format.
By default, your LANforge server and your LANforge client do not save
the data on connection and port performance. When you configure the
save destination for this data, you can use it with any other tool that
can read a CSV file.
Finding LANforge Report Data
Select your Save Location
You can tell the LANforge server to save data to a directory locally on the
management machine, and you can configure your workstation running the the
LANforge GUI to save data to a local desktop folder. First, find the Reporting
Manager dialog by in the
Reporting menu, and select Report Manager the client.
GUI Data Collection (Desktop Folder)
Collecting data on your local workstation is very convenient if you can leave
the GUI running for the duration of your test scenario. The format of the data
here should be similar to the format of the data saved to the server directory.
The folders for collecting data are relative to the folder you start your
GUI from. If you type in lf_data that probably means
C:\Users\mumble\AppData\Local\LANforge-GUI\lf_data. You probably want to
put in a fully qualified path thats more intuitive, like
C:\Users\mumble\Documents\lf_data.
Generate Report
The Report Generator uses the local data files. In that dialog shows the
Report Input Directory field is a local folder where the CSV files
collect. The Save Reports to Directory field is where HTMl and PDF
files should collect.
Server Data Collection (Server Directory)
If your test scenario runs longer than your GUI can be up, you can configure
the LANforge server to collect the data. The directory is relative to the
/home/lanforge directory, so if you enter lf_data, you would
find the CSV files in /home/lanforge/lf_data.
You can take a look at the data files easily. Here is a server data collection
directory:
And using a utility like notepad, vi, more or less
you can look at the file contents:
Using Libre Office
Importing the file into a spreadsheet like LibreOffice Calc is simple:
 |
You only need to separate on comma (,)
 |
 |
The timestamp column
Libre Office does not have a builtin formula to do this, but it has been
discussed here.
And the solution is a formula that looks like this:
=(A2/86400)+25569
and then you format the column as
Date.
Scripting with Bash
There are a number of ways to collect an dort the data with shell utilities. The
first utility to consider is cut, then awk. The first column of
the endpoint file we are going to read is the timestamp, the 14th is the
rx bytes.
Reading the Data and RX Bytes
- Converting Unix Date
$ head -n2 c201-A_1488414451.csv | cut -d, -f1
TimeStamp
1488414454125
$ date -d @1488414454125
Mon Dec 23 19:28:45 PST 49135
- Using bash
$ head -n2 c201-A_1488414451.csv | (while IFS=, read -a L; do echo ${L[13]}; done)
rx_bytes
33847640064
- Using cut
$ head -n2 c201-A_1488414451.csv | cut -d, -f14
rx_bytes
33847640064
- Using awk
$ head -n2 c201-A_1488414451.csv | awk -F, '{print $14}'
rx_bytes
33847640064
head -n2 c201-A_1488414451.csv | awk -F, '{print $1 "\t" $14}'
TimeStamp rx_bytes
1488414454125 33847640064
Scripting with Perl
It is a lot easier to do math with a perl script than a bash or an awk
script. You can pipe things into perl or perl will read the last argument
of the -ne switches as an input file.
$ head -n2 c201-A_1488414451.csv \
| perl -ne '@v=split(/,/,$_); print "$v[0]\t$v[13]\n";'
TimeStamp rx_bytes
1488414454125 33847640064
perl -ne 'BEGIN{$tt=0;@tstamps=();@rxb=();} \
{@v=split(/,/,$_); push(@tstamps, $v[0]); push(@rxb, $v[13]);} \
END{$dt=$tstamps[$#tstamps] - $tstamps[1]; $db=$rxb[$#rxb] - $rxb[1]; \
print "Time: $dt, Total:$db\n";}' \
c201-A_1488414451.csv
Time: 18959363, Total:1213399040
Not everthing you do in perl is going to be a one-liner. Here's an example
of the same script as a more properly formatted perl file:
#!/usr/bin/perl
my $tt=0;
my @tstamps=();
my @rxb=();
while(<>) {
@v = split(/,/, $_);
push(@tstamps, $v[0]);
push(@rxb, $v[13]);
}
$dt = $tstamps[$#tstamps] - $tstamps[1];
$db = $rxb[$#rxb] - $rxb[1];
print "Time: $dt, Total:$db\n";
Writing Disk Images on Windows
Goal: Copy an installed OS file-system image onto a drive that you will install into a LANforge system that lacks display hardware.
Many LANforge ICE WAN emulator machines are embedded systems that lack display hardware. Installing an OS using only the serial console can be very inconvenient. The easy solution is to perform the installation on similar hardware that does have display hardware, and then move the drive to the embedded device. Here, we learn how to use Etcher on Windows to write a compressed disk image to an mSata drive plugged into a USB3 adapter. |
|
|
- Here we're using Etcher which handles compressed file system images without any trouble. There are other programs (like Win32 Disk Imagaer or dd for windows) but those are more complex to use.
- Items we'll want:
- 30GB or larger mSATA drive
- USB3 mSATA drive adapter
- The image writing program Etcher
- Download and install Etcher
- Identify your drive in Control Panel → Hardware and Sound → Hardware and Printers.
- Download your image file:
- Start Etcher
- Select the compressed image:
- Select the removable drive
- You might have to enable unsafe mode if the drive you plugged in has previously been used
- in Settings, enable Unsafe mode
- Select the removable drive
- Select the removable drive
- Write image.
- click Flash
- It might take 20 minutes to write a 20GB (uncompressed) image.
- Make coffee.
- When the image is finished writing, close etcher and use the Safely Eject Thing dialog in the system tray.
- right click
- select device
- Unplug your drive from the computer, remove the msata drive drive from the USB caddy and then install into your embedded device
Adding a LANforge Virtual Machine
Goal: Add a virtual machine running LANforge to a LAN with a physical LANforge manager.
We review the configuration steps necessary to add a virtual LANforge resource. The guest instances will be configured to export MAC-VLAN ports to run traffic on their physical management port. The example here uses VirtualBox 5.2.10 and Fedora 27 Server edition, but our current recommendation for virtual machine platforms is actually libvirtd/kvm. |
|
|
- Create a new guest instance.
- When creating the guest, we should use 2 GB of RAM:
- 60 GB of disk:
- Omit a floppy drive, use a USB table as pointing device:
- Allocate two or more cores and PAE/NX:
- And the usual virtual processor features:
- We don't need graphics on these nodes, so use minimum graphics memory:
- Enable RDP access, that is useful. It might be a good habit to allocate separate RDP ports per host, we'll use 9134 for the first guest, 9135 for the second
- Enable Host I/O caching for your SATA device. Specify the Fedora 27 Server ISO image as the DVD:
- Disable Audio
- Configure the network adapter to:
- Use the LAN bridged adapter br0
- Use a server adapter driver
- Enable Promiscuous Mode to allow sniffing
- Start the installation
- Under System->Installation Destination please manually partitioning is necessary.
- Avoid selecting XFS or BTRFS file systems formats.
- Create a 1GB partition for /boot, select ext4 filesystem format.
- Use the remainder of the drive space for /
- If you want to separate the / and /home partions select 35GB for / partition.
- Set the root password to lanforge. Click Done twice.
- Add user LANforge:
- Make user lanforge an Administrator
- Set password to lanforge
- Click Done twice
- When installation finishes, reboot. You will see a login prompt:
- Login as root. Do updates: dnf update -y
- Install perl: dnf install -y perl
- Set guest's hostname: hostnamectl --static set-hostname atlas-fedora27s01
- Reboot: shutdown -r now
- Install LANforge on the guest instance. Start by logging in as root:
- Use wget (or curl) to download lf_kinstall.txt:
- cd /root
- wget http://www.candelatech.com/lf_kinstall.txt
- chmod +x lf_kinstall.pl
- You don't need to do a burn in, so turn off the disk check:
- touch /home/lanforge/did_cpuburn
- Install LANforge: ./lf_kinstall.pl --lfver 5.3.7 --kver 4.13.16+ --do_all_ct
- You can disable the VNC Server and Xrdp services on these guests:
systemctl stop vncserver@\:1 xrdp.service
systemctl disable vncserver@\:1 xrdp.service
systemctl daemon-reload
- When installation finishes, reboot: shutdown -r now
- On next boot, you will see a LANforge kernel option, it should be automatically selected:
- From your LANforge GUI, configure a MAC-VLAN the on default Ethernet port.
- In the LANforge GUI, choose the Port Mgr tab, and highlight the new enp0s17 port:
- Click the Create button
- create one MAC-VLAN port
- Select MAC-VLAN
- Quantity: 1
- Select DHCP-IPv4
- Click Apply
- You will see the new port in the GUI:
- In the guest VM, you will also see the new port:ip -br a show
- Add a second VM
- Shut down the previous VM: shutdown -r now
- clone the VM
- Select the Reinitialize MAC addresses choice, these machine will operate simultaneously.
- Verify the MAC address of the new guest is set
- Boot the second guest
- Change the hostname of the second guest: [root@localhost]# echo 'atlas-fedora27s02' > /etc/hostname
- Make sure that the MAC address of the second guest is not listed in the ifcfg-enp0s17 file.
- Compare the adapter to the file:
- cd /etc/sysconfig/network-scripts
- cat ifcfg-enp0s17
- If it is listed, change it or remove it.
- LANforge changes the /etc/udev/rules.d/70-persistent-net.rules file.Edit tht file those as to match the value of your mac address:
cd /etc/udev/rules.d
ip li show enp0s17
cat 70-persistent-net.rules
- Stop LANforge and change the resource ID for this guest:
service lanforge stop
cd /home/lanforge
./lfconfig
resource 5
config
- Reboot the second guest: shutdown -r now
- Start up your first guest (resource 4)
- In your LANforge GUI, you should see your two VMs.
- Create a MAC-VLAN port for the second guest
- Create a VOIP connection between the two guests.
- In the VOIP tab, click Create
- You configure:
- Side-A will be resource 3
- Side-B will be resource 4
- Click Apply
- See the newly created connection:
- In the VOIP/RPT tab, click Start
- Monitor traffic on the connection with the Modify->View button
Configuring Serial Connection to LANforge
Goal: Using a serial cable and terminal emulator on Windows to connect to LANforge.
If you experience crashes or system misconfiguration, a network link to LANforge can become unavailable. LANforge machines are shipped with a serial cable for just this possibility. Most LANforge servers come with standard RS232 DB9 pin serial ports, other models have a special RJ45 style connector. You might need a USB to Serial adapter to connect your laptop to the serial cable. |
|
|
- Connect Serial Cable to LANforge
- We will use a CT525 for our example There are two different types of CT525, some have a I/O shield with colors, others do not. Both have DB9 serial ports:
- Picture of an unmarked I/O plate:
- Picture of a colorized I/O plate:
- Picture of a colorized I/O plate plugged in:
- Other LANforge chassis models can have either RJ45 or DB9 serial ports.
- Connect Serial Cable to Windows
- Chances are you will be connecting a USB to Serial adapter to your laptop.
- Typically, right after you connect the cable to your USB port, you will see a message from Windows letting you know a new drive has been installed.
- Windows will map this USB adapter to a COM port. Use Device Manager to discover the new COM port:
- Press the Windows key and type device manager
- Hit Enter to open the Device Manager
- In Device Manager, select Ports
- In this example, we see that our new USB device was assigned COM3.
- Configure PuTTY to connect to serial port
- Press the Windows key and search for putty
- When you double click on the PuTTY icon and it launches, you can start customizing your session preferences
- Start by setting your connection type (serial), serial device (com3) and speed (115200). Name your session 'com3'
- Select category Serial, specify the Serial Line COM3, speed (115200) and set both Parity and Flow Control to None.
- Select the Session→Logging category, select Printable Output and name set the Log file name as you prefer. This allows you to collect your commands as notes for later.
- Select the Session category, save the com3 profile and click Save
- Click the Open button. You will see a terminal window appear.
- Use PuTTY to Log In over COM3
- If the screen is blank, hit Enter to see a login prompt.
- Enter username lanforgeEnter, password lanforgeEnter
- Collect console output to a logfile
- step 1
- step 1
- Common Commands Cheat Sheet: Hit Enter after all commands
- pwdEnter ⋮ print current directory
- lsEnter ⋮ list items in directory
- cdEnter ⋮ change to your Home Directory
- cd /home/lanforgeEnter ⋮ go to LANforge home directory
- cd /rootEnter ⋮ go to root user's home directory
- sudo ./serverctl.bash restartEnter ⋮ Restart LANforge service
- sudo rebootEnter ⋮ reboot machine
- ip a showEnter ⋮ show interface addresses
- df -hEnter ⋮ show disk usage
- mv script.sh.txt /home/lanforge/scripts/script.shEnter ⋮ move file to new name
- dos2unix script.shEnter ⋮ Remove DOS/Windows CRLF style line endings
- chmod +x script.shEnter ⋮ Turn script executable
- ./script.shEnter ⋮ Run script in current directory
- Example of clearing disk space on a LANforge machine
- One common problem with any LANforge machine is cleaning out old kernels. This is an example that shows you how to check disk space and how to remove unused kernels.
- Check disk space with the df -h command
- Use the dmesg command to see if there are system warning.
- go to the /boot directory. The uname -r command tells you which kernel you are currently running. You may remove old ct kernels.
- In addition to removing old kernels, you can remove modules that correspond to those kernels
- After old kernels and modules have been removed, we re-run grub2-mkconfig to regenerate the boot menu:
- the results will look like this:
Connecting SMA Cables to LANforge
Goal: Connect the antennas of your device under test to LANforge using SMA cables and a fixed attenuator.
Many WiFi testing scenarios benefit from some amount of WiFi isolation. Connecting the radios of the Device Under Test (DUT) to LANforge's radios using SMA cables can improve connection quality. Using a fixed attenuator can reduce a direct signal so that it is heard by the radios without distortion. |
|
|
- The polarities of the cables must match
- Begin by connecting the SMA Female end of the fixed attenuator to the SMA adapter.
- We see that the exposed end of the sma_adapter is RP-SMA-Male. RP means Reverse Polarity.
- Connect the attached attenuator and adapter to the LANforge radio antenna. This exposes the SMA Male end of the attenuator. Your DUT might not have adequate space to mount a fixed attenuator to it, so we suggested connecting it to the LANforge.
- The polarities of the cable end must match the end of the fixed attenuator. The cable end for this side is SMA-Female.
- See how the cable connected to the lanforge has both the adapter and the attenuator. It should be safe to use the attenuator and adapter anywhere along a SMA path.
- Connect the other end of the cable to the Device Under Test (DUT). Your DUT might use different antennas so you might need to use another adapter.
- We have connected one antenna of our DUT to the one antenna of our LANforge. Repeat this for multiple antennas.
Diagnose Problems with GUI on Windows
Goal: Learn how to diagnose problems running LANforge client on Windows.
The LANforge client (GUI) can encounter variety of difficulties depending on the amount of RAM and version of Java running on your desktop. Read this guide to learn steps to take to collect error messages and how to fix out of memory problems. The LANforge client can be both the GUI running interactively, or in headless HTTP mode. |
|
|
Run the client from a CMD window
- Right click on LANforge GUI icon and select Open File Location
- You will see the folder wher the LANforge client is installed
- Right click on folder area to right of files, and select Run CMD here or Run PowerShell here. This might require that you Shift-Click on anything that might be selected in the directory to un-select it.
- You will see a terminal window open
- Start the client using the command .\lfclient.batENTER
Double-clicking lfclient.bat in the Windows Explorer window will start the client in a CMD window, but the window will disappear when the client quit/exits/leaves.
Be Aware of Quick Edit
- Quick Edit allows you to highlight text quickly with the mouse; it is a feature of both the CMD and PowerShell windows. CMD windows have the distinct drawback of halting execution while text is highlighted.
Press ESC to clear text selection
- You can change the setting by clicking in the upper left corner, selecting Preferences, then look for Qui,ck Select.
For more information see Windows Server 2016 Features
Copy an Error
Candelatech introduces features into LANforge quickly, and discovering a problem in the LANforge Client occasionally happens--and we want to hear when it does! You can help by copying the terminal output and emailing it to us (at support@candelatech.com).
Various kinds of errors leave messages we can find in the terminal like when the LANforge client:
- ...will not start after double clicking the icon. This might be caused by a missing or mismatched version of the Java runtime, an error in the start-up script, or a program error.
- ...unexpectedly quits. Probably a program error.
- ...does not respond. Possibly a program error, caused often you will see many exceptions printed to the terminal.
A Java exception is a rather long list of method calls (a stack trace) that starts with the exception message. Sometimes the exception message is IllegalArgumentException, sometimes it is null (a null pointer exception)
- Scroll the terminal window to see the top of the exception and highlight the exception message and as much of the stack trace as possible. Below is a picture of a condition where the LANforge client script has an error and will not start.
- Pressing Enter after highlighting the text copies the text into your clipboard.
- The laptop might not have an email client installed. In that case, open notepad.exe or wordpad.exe from via the Start menu, and paste your stack trace into your text editor.
- If your circumstances don't allow highlighting, copying and pasting, you can take a screen capture, usually by pressing Alt+PrtScr shortcut.
- When contacting us, please describe the steps you took to reach this error. We need to be able to reproduce the error in order to fix it.
Out of Memory Conditions
- Candelatech provides a 32-bit and a 64-bit version of the LANforge client. We generally suggest people use the 64-bit client, because most recent laptops are running 64-bit operating systems. This is a common fix for running out of memory.
For more information see LANforge Downloads
- When running a WiFi Capacity Test, the generated report consumes significantly more memory than a mere HTML or PDF version of the report does. If you have multiple WiFi Capacity Test reports open, we suggest you save them and close the report windows.
- Running tests for longer periods of time (like days) can also consume significant memory. By default, the LANforge client will only allocate up to two-thirds (2/3s) of the system memory it detects available at start-up. If there are programs like Chrome, Outlook and possibly Electron based applications open, those can be using most of your laptop's memory to begin with. You might need to exit other programs in Windows and restart the LANforge client in order allow it to have more memory.
- You can also edit the start-up script to configure the maximum memory permitted to the Java runtime. That is discussesd next.
Edit the start-up script
- While it is possible to edit files with notepad.exe, that text editor has few conveniences. Please consider using Notepad++ if you don't already have a text editor available.
For more information see Download Notepad++
- Right click on the lfclient.bat startup script, and select Edit with Notepadd++
- The file opens in the editor at the top. You will want to jump to the end of the file.
- At the end of the file, notice the -Xmx option for the java program. You will edit this to the maximum amount of memory you want to allow the program.
- In this example, we've edited the start up script to request 2GB of memory. If you request more than the system will give you, the Java will give you an error and quit.
For more information see Tuning Java Machines
Email support@candelatech.com if you have questions or need help.
Recovering Filesystems
Goal: Recover a LANforge system that boots into Emergency Mode
If your LANforge boots into Emergency Mode, your system is experiencing file-system corruption. Follow these instructions to check the filesystems. This process will require a monitor and keyboard or a serial cable connected to the LANforge. File system corruptions are caused by power-off events without properly shutting down the system |
|
|
- The emergency mode prompt looks similar to this:
Give root password for maintenance
(or type Control-D to continue):
- The messages beforehand that begin with [ OK ] can be ignored.
- Messages beginning with ath10k_pci can be ignored.
We assume you'll press the Enter (↲) key when executing the commands in further examples.
- Provide the root password: lanforge
- The we next need to determine where our filesystems are mounted. You might have filesystems on partitions, or on LVM volumes. Use the command mount | grep ext4 to find your partitions:
mount | grep ext4
/dev/sda2 on / type ext4 (rw,relatime,nodelalloc)
/dev/sda4 on /home type ext4 (rw,relatime,nodelalloc)
/dev/sda1 on /boot type ext4 (rw,relatime,nodelalloc)
This example shows partitions. Note that inspecting /etc/fstab often does not show you device partitions, rather it shows you volume or partition UUIDs.
- Example of filesystems on volumes:
mount | grep ext4/dev/mapper/fedora-root on / type ext4 (rw,relatime,nodelalloc)
/dev/mapper/fedora-home on /home type ext4 (rw,relatime,nodelalloc)
/dev/sda1 on /boot type ext4 (rw,relatime,nodelalloc)
Notice that /boot is typically not a LVM volume.
Issuing the fsck commands
- For each of those filesystems in the partition example above, you will execute the below commands:
- fsck -fy /dev/sda2 (for /)
- fsck -fy /dev/sda4 (for /home)
- fsck -fy /dev/sda1 (for /boot)
- For the volumes example above, you will execute the below commands:
- fsck -fy /dev/mapper/fedora-root (for /)
- fsck -fy /dev/mapper/fedora-home (for /home)
- fsck -fy /dev/sda1 (for /boot)
Configuring Filesystems Check on Reboot
- The commands below involve setting the 'mount count' parameter to 1. Every time the filesystem is mounted, it will perform a check. The following examples ensure that full journaling is enabled on the filesystem. This ensures the most amount of recovery. And after that, modern versions of Fedora have metadata checksumming available. Older LANforge systems do not have this.
Filesystem Check on Every Mount
The filesystems do not need to be unmounted to set this parameter. Only the partition example is shown, the volumes example uses similar commands.
- touch /forcefsck (this technique works with any model of filesystem)
- tune2fs -c 1 /dev/sda2 (for /)
- tune2fs -c 1 /dev/sda4 (for /home)
- tune2fs -c 1 /dev/sda1 (for /boot)
Tune the Filesystem for Full Journaling
The filesystems do not need to be unmounted to set this parameter. The commands for the volumes version is similar to the partition example below.
- tune2fs -o journal_data /dev/sda2 (for /)
- tune2fs -o journal_data /dev/sda4 (for /home)
- tune2fs -o journal_data /dev/sda1 (for /boot)
- Note: Inspect /etc/fstab for conflicting mount options. The folling example shows mount options applied in the fstab file:
mount | grep ext4
/dev/sda2 on / type ext4 (rw,relatime,nodelalloc)
/dev/sda4 on /home type ext4 (rw,relatime,nodelalloc)
/dev/sda1 on /boot type ext4 (rw,relatime,data=writeback)
grep data= /etc/fstab
UUID=1c1b4732-653f-47dd-a106-ae17cf5b12a9 /boot ext4 data=writeback 1 2
Notice the fstab entry for /boot? It has overridden the data journaling mode. Erase that setting from the fstab mount options.
Enable Metadata Checksumming (optional)
It is only practical to apply metadata checksumming in the below conditions. You will not be able to apply it to the root filesystem / because it cannot be unmounted when you boot the system.
- Fedora 27 or more recent
- tune2fs 1.43 or more recent
- crc32c or libcrc32c modules loaded
- you can unmount the filesystem.
- To Boot into Emergency Mode, follow these steps:
- Reboot system into Emergency Mode by appending the word emergency at the end of your grub boot option.
- umount -f /home
- umount -f /boot
- fsck -fD /dev/sda1 (remember that's /boot)
- fsck -fD /dev/mapper/fedora-home
- tune2fs -O metadata_csum /dev/sda1
- tune2fs -O metadata_csum /dev/mapper/fedora-home
Disable Drive Write Caching (optional)
Drives typically ship with write caching enabled for a performance boost. SSDs have this as well. By turning it off you trade some performance for increased data safety. LANforge systems do not ship with write caching disabled. To make this setting enabled every boot, it needs to be added to /etc/rc.local. LANforge systems have rc-local.service enabled by defualt. Only disable write caching if your machine powers off without shutdown frequently
- vi /etc/rc.local
- Add the line /sbin/hdparm -W0 /dev/sda
- Save the file.
- Reboot, or issue the command for this booted session:
/sbin/hdparm -W0 /dev/sda
Automatically Start LANforge GUI
Goal: Configure LANforge to automatically start LANforge GUI on boot or login.
Follow these steps to Configure LANforge to automatically start LANforge GUI on boot or login. Requires version 5.4.1 or greater. |
|
|
- Quick Start
- Open a terminal or connect to your lanforge machine via ssh:
$ cd /home/lanforge/LANforgeGUI_5.4.1
$ cp LANforge-auto.desktop ~lanforge/.config/autostart
$ sudo systemctl restart vncserver@:1.service
- If you were connected via VNC, your session will close. When you reconnect via VNC, you will see a LANforge GUI running on the desktop. This will now start again every reboot.
Configuring OpenVPN on Ubuntu
Goal: Connect your laptop to a VPN with the provided keys and configuration file.
Connecting to the office network remotely requires you to install the openvpn package and place the config files in the correct places. You can start and stop the VPN using simple commands at a terminal. |
|
|
Install OpenVPN
- Open a terminal and see if you already have openvpn installed:
$ which openvpn
/usr/sbin/openvpn
This means you have OpenVPN installed.
- Installing openvpn is a simple command:
$ sudo apt install openvpn
Add your Config Files
- You should be provided with these files:
- your-laptop.key ← This is your private key
- your-laptop.crt ← This is your certificate
- ca.crt ← This is the VPN server certificate
- candelatech.conf ← The config file for the connection
You will place these files in /etc/openvpn. The files should be owned by root, so become root and copy them with this technique: $ sudo -s
[/home/amelia] # cd /etc/openvpn
[/etc/openvpn] # cp ~amelia/Downloads/your-laptop.key .
[/etc/openvpn] # cp ~amelia/Downloads/your-laptop.crt .
[/etc/openvpn] # cp ~amelia/Downloads/ca.crt .
[/etc/openvpn] # cp ~amelia/Downloads/candelatech.conf .
Starting and Stoping the VPN Connection
- In a terminal, cd to /etc/openvpn and start the connection as root:
$ cd /etc/openvpn
$ sudo openvpn candeltech.conf
Press Control-C in that window to stop the VPN connection.
Example Config File
client
dev tun1
proto udp
remote firewall.candelatech.com 1194
#remote firewall.candelatech.com 443
script-security 2
resolv-retry infinite
nobind
persist-key
persist-tun
verb 3
ca ca.crt
cert laptop-dell.2019-08-13.jreynolds.candelatech.com.crt
key laptop-dell.2019-08-13.jreynolds.candelatech.com.key
comp-lzo
cipher AES-256-CBC
Configuring OpenVPN on Windows
Goal: Connect your laptop to a VPN with the provided keys and configuration file.
Connecting to the office network remotely requires you to install the openvpn package and place the config files in the correct places. You can start and stop the VPN using simple commands at a terminal. |
|
|
CI/CD Lights-Out Chamber Setup
Goal: Assemble a LANforge and a device under test (DUT) to operate in an unattended lab setup.
The CI/CD lights-Out chamber is composed of a CT840a chamber, a CT523c LANforge and a test-controller[1], that connects to them via serial and Ethernet. 1) A test controller is a Linux system that can be remotely accessed, and does not need LANforge installed.Inside the chamber we have: - a remotely controlled power switch
- a powered USB hub for connecting serial ports of the LANforge and DUT
- a LED lamp
- a USB camera connected to the LANforge machine
- a short table to place above the LANforge for the DUT
- the LANforge machine
- the DUT
Once assembled, this setup can perform a battery of connectivity and traffic tests that do not require a programmable attenuator. Requires LANforge 5.4.2. |
|
|
Parts review
Let's review the parts the chamber setup requires:
- Cables include:
- 3 cat5e cables
- 2 cat6 cables
- 1 USB serial adapter
- 1 DB9 female-female cable
- Also shown are annenas, with-pin
- You will also get two small monitor stands and a network power switch. You will be using the legs of both, but discarding one of the stand tops.
- You will be getting a LED lamp, a USB camera, 8 port network switch, USB hub, camera clamp, USB A-A cables.
- Your chamber will come with a universal power strip, AC power cord, fan AC-DC power adapter, and a printed test report. This assembly guide does not use the universal power strip. You might find a use for it.
- Your chamber will also come with a brass pipe mounted to a steel plate. This is a fiber tube that you can pass fiber optic cabling through. For this setup, you can refrain from installing the fiber-pipe. It is not necessary because we are using copper Ethernet cabling.
First items
- Place the lamp in the chamber
- Place the power distribution unit (PDU) in the chamber on it's side.
- Plug the DC barrel connector for the fans into the fan power supply
- Plug the USB hub USB cable into back of the chamber. The bottom USB port is chamber USB 1 near the top ethernet filter port 3. The top USB port is chamber USB 2.
Power Switch
- Port 1: USB Hub
- Port 2: Interior Light
- Port 5: 5 Chamber Fans
- Port 6: LANforge system
- Port 7: DUT
- Others are un-labeled. If you want to add an Ethernet switch in here, we suggest plugging it into one of the always on ports on the right side.
Assemble the USB camera
- Your camera clamp and USB camera. Your USB camera might be manual-focus.
- Screw the bolt of the clamp into the tripod mount of the camera
- Tighten the clamp to the arm of the lamp near the top joint. The USB cable should be plugged into the LANforge when it is added. If you plug it into the USB hub, only the test-controller will be able to use it.
Check espresso levels in human system
Power cables
- Plug the PDU cable into the rear of the chamber
- Plug the USB hub power into port 1
- Plug the lamp cable into port 2
- Plug the chamber fan AC cable into port 5
- Plug the LANforge power-supply into port 6
- You will probably plug in your DUT power supply last, into port 7
Inline Attenuators
- This is an SMA connector chart. Make sure your antennas and in-line attenuators have the correct pins
- Your 16 LANforge SMA terminals are SMA-Female.
- Screw 16 SMA-Male/SMA-Female inline attenuators onto your CT523c.
Antennas
- Check that you have SMA-Male antennas (antennas are with-pin).
- Screw on your antennas. You will not leave them straight like this.
- Bend the antennas various ways to ensure they provide diversity. Not providing diverse antenna orientation means your equipment will not reach desired MCS rates.
Shelf for DUT
- You are provided two monitor stand kits as to combine into a shelf for the DUT to rest above the LANforge CT523c. You are going to use the legs from the second kit to extend the legs of the first kit.
- Use a utility knife or a screw driver to separate any feet from legs sections you do not need.
- Here is a shelf with five segments per leg. Depending on the size of the rubber feet on your CT523c, it might be just tall enough. The other photos show a table with six segments per leg. Looks like Batman likes my work.
- This table clears the LANforge unit well.
Network and Serial Cables
- The network ports on the chamber are passive Ethernet RF filters. The do not have activity lights, they do not require power.
- The top USB3 port is USB 2
- The bottom USB3 port is USB 1
- The top Ethernet port is 3
- The middle Ethernet port is 2
- The bottom Ethernet port is 1
- Cable the PDU network to chamber Ethernet port 1
- Place the LANforge CT523c in the chamber and attach a CAT5e cable to the management port labeled [ MGT ]
- Plug the management port cable into the chamber port 2
- Use a CAT6 cable to connect the LANforge [ eth3 ] port to the chamber 3 port. This represents your WAN connection.
- Connect the DB9 female-female serial cable to the CT523c serial port. It is labled Serial: 115200 8n1. Connect the USB serial adapter to the other end of the DB9 cable.
- Plug the USB end of the USB serial adapter into the USB hub. Your test controller will be able to login to the LANforge for network configuration and debugging.
- Plug in power to the CT523c. It is a green DC connector. Place the table over the CT523c.
- You may place the DUT on the table. Use a CAT6 cable to connect the DUT to the LANforge [ eth2 ] port. LANforge will serve DHCP on [ eth2 ] for the DUT and its connected stations, and will NAT and route packets out of [ eth3 ].
- Plug your DUT power to into PDU port 7
- Your DUT probably has a serial connector. Cable your DUTs serial cable into the USB hub.
Controller Setup
- The test controller (aka Jump Host) pictured here is a 1U rack unit.
- Your rack KVM will use the left USB2 ports and VGA port of the test-controller.
- Connect chamber port USB 1 to a USB3 port on the test-controller.
- You might have to use an extra USB3 hub to control more than two CT820a chambers.
- Cable chamber ethernet 1 to switch, this is your PDU
- Cable chamber ethernet 2 to switch, this is your LANforge management port.
- The picture shows chamber ethernet 3 connected to the switch. This connection is at your discretion. You might have a different WAN upstream network to attach to chamber ethernet 3
- The USB ports may be renamed each time the system restarts. To fix this, you can create an /etc/udev/rules.d/81-usb-serial.rules file that defines the USB ports by name using the serial-number of the USB cable if it supports it, or the path (effectively port to which the USB cable is connected).
#LF on cable with serial number
SUBSYSTEM=="tty", ENV{ID_SERIAL_SHORT}=="AK066NLY", SYMLINK+="ttyLF1", MODE="0666"
# AP
# In case we have something w/out a serial number
SUBSYSTEM=="tty", DEVPATH=="1-2.1.4", SYMLINK+="ttyAP1", MODE="0666"
You can find the appropriate information with the udevadm info -n /dev/ttyUSB0 command.
- In the picture the red cable represents the control network. The yellow cable is your connection to your test controller ETH0
Changing the logo generated in GUI reports
Goal: Correctly access and change the logo displayed at the top of GUI-generated reports in your local Lanforge GUI.
It is possible to provide your own logo and report header graphics. |
|
|
- Open your LANforge GUI, click on Reporting, and Reporting Manager
- Click on Generate Report
- Find a desired image instead of the default report logo that fits the report logo size (within 200 x 90 px size range) and save the image into the html/images/ path within the bt_bits directory.
- Once the desired image is within the appropriate images folder, scroll over back to the Reporting Manager tab, click on Report Logo and select the image (and image path) to be placed in the Report logo path. Then select Report Logo. Now, once a user generates a report, the new report should print out with a different logo at the top.
Set up an SSH-tunnel on Windows, Linux, or Mac
Goal: Connect to a LANforge Linux system via a compressed tunnel connection
When connecting to your remote LANforge hardware (presumably accessible over a VPN) you will notice poor response time and lag in your LANforge GUI or your VNC connection. Many VPN connections are based on UDP protocols and packet loss might be affecting your connection quality. Below we explain how to set up SSH tunnels that increase the quality of your connection. |
|
|
- Linux SSH tunnel Setup
- From the computer that you are trying to connect your SSH tunnel from, open the .bashrc file from '/home/user/'. The .bashrc file can be opened via gedit, vim, or nano. This .bashrc file is where the alias will be setup to properly invoke your ssh.
- Once the .bashrc file is open, type in your alias in any blank spot (that is not within another for-loop or definition). Flags used in the bash alias creation example below are as followed:
- -C = Requests compression of data. This is desirable for slower connections. Recommended.
- n = redirects stdin /dev/null. Required when SSH is running in the background.
- N = do not execute a remote command, useful for forwarding ports.
- v = Verbose mode. Causes SSH to print debugging messages about its progress.
- -L = bind_address:port:host:hostport format. Use this flag multiple times to forward multiple ports with one command.
- Please visit the SSH man page for further flags and switches:https://linuxcommand.org/lc3_man_pages/ssh1.html
- The generic setup of bash aliases for SSH are ssh -flags localport:ipaddress:remoteport. In the example included above we've included the following ports for the according reasons:
- 4001 -- perl scripts use this for ascii connection to LANforge server
- 4002 -- GUI uses this for binary connection to LANforge server
- 5901 -- VNC port for display :1
- 4131 -- local port for perl scripts to connect to .92.12
- 4132 -- local port for GUI to connect to .92.12
- 5903 -- local port for VNC to connect to .92.12
- Further example ssh aliases include:
- alias FreyaTunnel="ssh -CnNv -L 5903:192.168.0.6:5901 -L 4131:192.168.0.6:4001 -L 4132:192.168.0.6:4002 lanforge@192.168.0.6"
- alias SaltTunnel="ssh -CnN -L 4001:192.168.200.18:4001 salt@10.253.1.6"
- After editing the .bashrc file, source the file in order for the changes to be applied. This will enable the code without the need to turn off and restart the device.
- In order for our machine to remember certain passwords and access configurations, some additional edits in the ~/.ssh/config file or $HOME/.ssh/config.
- Next, this ssh connection will require an ssh key. This means that one needs to be generated. The private key and public key of the key pair must be saved to the local computer while only the public key of the pair must be saved to the remote server.
- Add your SSH key to the device being forwarded. Finally, add your public key that you generated earlier via SSH. This can be done by typing in ssh-copy-id user@ipaddress (see below example).
- Once the alias is added to .bashrc file and the ssh key is added to the remote device, open any terminal and simply type in the alias name. This will initiate the tunnel. For example, "FreyaTunnel" in this example would be the alias typed into any terminal. This should incur an instance of your tunnel.
- Windows SSH tunnel Setup
- There are many ways to set up an SSH tunnel, however, this cookbook will utilize PuTTy.
- Once PuTTY is downloaded, configure the SSH connection before adding the tunnel.
For more information see Connecting with PuTTy.
- Once your session is setup, select your session that was just saved from the last cookbook, then on the left-hand panel, select Connection -> SSH -> Tunnels.
- After setting up the tunnel, select SSH and enable compression. This will ensure that the tunnel uses data compression.
- Once all the settings desired are configured, select Session, highlight the session again in Saved Sessions and hit Save for the new session settings. This will make sure that the next time logged in will include all the settings here.
- Now, the session is saved and can be opened by clicking Open
Understanding VRF Devices
Goal: Understand and inspect private VRF routing tables.
VRF devices are a Linux kernel networking driver that allows private routing tables for individual ports in the system. The examples below show how to find these routes. Requires version 5.3.9 or greater. |
|
|
VRF Driver
LANforge has been using the Virtual Routing and Forwarding driver since around 2018. This allows private routing tables for each LANforge managed interface. VRF provides specific networking benefits to LANforge:
- Virtual stations gain authentic routing as delivered from the AP's DHCP service.
IP sockets bound to that station will not send DNS requests out the host's default gateway, for instance.
This helps accurately test captive portal and HS2.0 web requests that should never know about the management network.
-
- Multiple identically numbered networks can be modeled in parallel.
Emulating a peer-to-peer VPN tunnel between two STA devices
that both are on 10.0.0.0/24 networks separated by a WAN.
Disabling VRF
This does make it more difficult to monitor the routes per port.
- If this feature is undesirable, you can use the following command to disable VRF:
- $ touch /home/lanforge/LF_NO_USE_VRF
- $ sudo reboot
Finding VRF private routes
To find the routes, you want to use these commands for any particular vrf device:
- Look for the station's master device:
ip a show wlan3
wlan3: mtu 1500 qdisc noqueue master _vrf6 state DOWN mode DEFAULT group default qlen 1000
link/ether 00:0e:8e:44:07:a1 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 256 maxmtu 2304
- When you know the master device you can display that specific routing table:
- A routing table with a gateway:
ip route show vrf _vrf10
default via 10.40.0.1 dev br0
10.40.0.0/20 dev br0 scope link src 10.40.0.21
- With no default gateway:
$ ip route show vrf _vrf15
unreachable default
Use FireFox with a virtual station to Browse a DUT
Goal: Use FireFox with a virtual station to Browse a DUT
Access points used as a DUT in a wireless-mesh scenario might not have an ethernet port available to be able to access their management screen. Rather, they require a station to associate to the DUT to access the management console. LANforge virtual stations operate in the context of a VRF (virtual routing) device that protects them from the default routing table of the system. This makes using a browser over a station unintuitive; special commands are required to do this. Requires LANforge 5.3.9 or later. |
|
|
Associate a station to your DUT
- Create a station as necessary or use the wlan0 device
- if you know the SSID credentials, enter those.
- If you need to discover the SSID, enter anything into the SSID box, like asdf so you can start a scan.
For more information see Create stations
- Scan for your DUT SSID.
- Configure your station to use the DUT SSID credentials and DHCP.
Use the vrf_exec.bash script to start Firefox
The vrf_exec.bash script changes the networking context for the browser so it can use your station.
- Open a terminal
- Become root: sudo -s
- Go to the LANforge directory: cd /home/lanforge
- Start firefox: ./vrf_exec.bash wlan0 firefox http://10.0.0.1/
Possible difficulties
If you have just rebooted your LANforge system and are jumping to step 2 without starting the LANforge GUI, you might have difficulty getting Firefox to display. By starting the GUI, it runs the xhost + command and relaxes some basic X11 security settings to let other users display windows on the desktop.
Backing Up and Migrating LANforge Data
Goal: Learn what directories under /home/lanforge are important to backup and transfer to a new LANforge.
Most of the data that LANforge produces lives in the directory /home/lanforge. Not all the files and directories under there are useful to backup or migrate to a new LANforge machine. This guide relates to Linux based LANforge machines. We will assume for this cookbook during a restore situation you have the two LANforge systems connected on the same management network. |
|
|
- LANforge data lives in various directories under /home/lanforge, and this is a brief explanation of the directories you will want to transfer.
LANforge scenario data for a realm is saved on the manager (typically resource 1).
The LANforge client (GUI) can save reports on various machines where it is running. It does not save scenario data.
- Below are listed the important sub-directories from /home/lanforge,. Each has a note about how important it is to back up. Directories not listed are unlikely to contain LANforge related data.
When in doubt backing up the entire /home/lanforge directory is OK
- DB/
YES this is were all your scenarios are saved
- Desktop/
only if you save things here
- Documents/
only if you save things here
- Downloads/
only if you save things here
- html-reports/
yes if you want the reports
- lf_reports/
yes if you want the data
- local/
unlikely unless you customize strongswan
- report-data/
yes if you want the data
- scripts/
only if you have modified or custom scripts in here
- trb_entities/
trb_profiles/
Table Report Builder saved settings only necessary if you use TRB frequently
- vr_conf/
only if you save virtual router settings, nginx configs or want to save dhcp lease files
- wifi/
only if you have customized wpa_supplicant.conf or hostapd.conf files
Archiving Data
Starting on your old LANforge machine, use the tar command to archive data. Add directories you want to archive to the end of the command. cd /home/lanforge
tar cjf /home/lanforge-bu.tar.bz2 DB html-reports lf_reports report-data
If you run out of space, try using /home/lanforge/check_large_files.bash to help clear room.
Copy the Archive
Copy the archive to the new LANforge:scp /home/lanforge-bu.tar.bz2 lanforge@your-new-machine-ip:/var/tmp
Restore the Data
On the new machine: cd /home/lanforge
tar xvf /var/tmp/lanforge-bu.tar.bz2
sudo service lanforge restart
CT714B Stand Assembly
Goal: Fully assemble a stand for CT714B attenuators.
The CT714B attenuator can be assembled in a stack with a base and threaded rods. |
|
|
- Insert rods until they stick out a bit through the bottom.
- Bottom view:
- Add nuts to all four rods on bottom side of plate. Hand tighten.
- Full view:
- Add one spacer to each rod.
- Full view.
- Add the first CT714B.
- Add another set of spacers.
- Full view.
- Repeat steps 4 and 5 until all CT714Bs are stacked.
- Add washers to all rods.
- Add wing nuts to all rods.
- Full view.
- Add caps to all rods.
- Full view.
- The nuts on the bottom can easily come loose during assembly. Tighten again as needed.
Testing the CT840a Turntable
Goal: Use the lf_chamber.pl script to interact with chamber door sensor, lights and turntable.
The CT840a chamber has a Modbus interface that can provide telemetry about the the door-closed sensor, light control, and turntable control and position. In order to have access to the Modbus protocol, you need a Modbus package installed on your system. The modbus controller in these chambers is simple and does not understand IP routing. You have to be connected on the same network as the modbus system. |
|
|
Using LANforge on Linux
- Test your connection to the chamber with the /home/lanforge/lf_chamber.pl script. This will verify you can reach the modbus controller.
Available here: https://www.candelatech.com/downloads/lf_chamber.pl
- Source the lanforge.profile script:
$ source /home/lanforge/lanforge.profile
- Use the command:
$ ./lf_chamber.pl --targ 192.168.100.10 --status 1
Expect output similar to:
Current-Angle: 3599 Door-Open: 0 Table-Moving: 0 Lights: 0 Fan: 1 Jog-Speed: 3 Return-Speed: 3 Absolute-Speed: 3 Jog Angle: 0
- Use the chamber-test.sh script to test all the chamber features.
Availble here: https://www.candelatech.com/downloads/chamber-test.sh
$ ./chamber-test.sh 192.168.3.123
The desktop linux is 192.168.3.64, remember to use Alt-F2, 'mate-terminal' to get a shell.
Testing chamber at 192.168.3.123
Please close door.
Current-Angle: 3599 Door-Open: 0 Table-Moving: 0 Lights: 0 Fan: 1 Jog-Speed: 3 Return-Speed: 3 Absolute-Speed: 3 Jog Angle: 0
check output if door is closed: door == 1
Please open door.
Current-Angle: 3599 Door-Open: 0 Table-Moving: 0 Lights: 0 Fan: 1 Jog-Speed: 3 Return-Speed: 3 Absolute-Speed: 3 Jog Angle: 0
check output if door is closed: door == 0
Toggle lights
Did lights turn on?
Current clockwise angle: 3599 counter-clockwise-angle: 1 new-angle: 450
Did platform rotate 45 degrees?
Did platform rotate another 45? It should be at 90
Current clockwise angle: 2978 counter-clockwise-angle: 622 new-angle: 1
Did platform rotate back to zero?
Did fan turn on?
Toggle fan
Did fan turn off?
Toggle lights
Did lights turn off?
Current-Angle: 2700 Door-Open: 0 Table-Moving: 0 Lights: 0 Fan: 0 Jog-Speed: 3 Return-Speed: 3 Absolute-Speed: 3 Jog Angle: 621
You may close the chamber.
Using Linux without LANforge
You will want to download
:
- LANforgeServer that matches your version of Fedora. For example, Fedora 30 would be LANforgeServer-5.4.5_Linux-F36-x64.tar.gz
- The modprobe interface script: lf_chamber.pl
- The chamber test script: chamber-test.sh
Setup
: This setup is intended for versions of Fedora that LANforge has been compiled for. The version of mbpoll bundled with the Server archive is specific to the glibc version the Fedora distro is built with. You do not have to run the lf_kinstall.pl script or use the install.bash script in the LANforgeServer directory.
- Create the following directories:
sudo mkdir -p /home/lanforge/local/lib
sudo mkdir -p /home/lanforge/local/bin
- Chown the directories to your current user:
sudo chown -R $USER: /home/lanforge
- Expand the LANforgeServer archive in /home/lanforge:
tar xf LANforgeServer-5.4.5_F30-x64.tar.gz
- Copy the mbpoll files to the new directories:
,,cp -r LANforgeServer/local/lib/* /home/lanforge/local/lib,,
cp -r LANforgeServer/local/bin/mbpoll /home/lanforge/local/bin
Run the scripts
: These scripts require the mbpoll libraries in the LD_LIBRARY_PATH. The example below uses the address 192.168.0.3 as the address of the CT840a chamber. Please do not confuse this with the IP of the LANforge that might be in or attached to the chamber.
- $ export LD_LIBRARY_PATH='/home/lanforge/local/lib:/usr/lib64'
$ export PATH="/home/lanforge/local/bin:$PATH"
$ ./lf_chamber.pl --targ 192.168.0.3 --status 1
Using Windows without LANforge
- Not at this time.
Remove old Reports and Data
Goal: Find and remove old reports and test data.
Running tests on LANforge for long periods of time can leave a lot of data behind. The check_expired_data.bash script can find old files to delete.This file is similar to check_large_files.bash but looks at the age of files.Introduced in LANforge 5.4.5. |
|
|
Download the script
Download the script if it is not in /home/lanforge/scripts already. If you need to download the script, use the following commands:
- cd /home/lanforge/scripts
- wget https://raw.githubusercontent.com/greearb/lanforge-scripts/master/check_expired_data.bash
- chmod +x check_expired_data.bash
Find the script help
./check_expired_data.bash -h-d Find data within this directory (required)
-t Find data this many days old or older (required)
-f Delete files (not a default option)
-v Print files
See the files you would delete:
./check_expired_data.bash -d /home/lanforge/report-data -t 11 -v
Actually delete the files:
./check_expired_data.bash -d /home/lanforge/report-data -t 11 -f
You may create a script in /etc/cron.daily like this:
----- ----- ----- ----- ----- ----- ----- ----- -----
#!/bin/bash
LF='/home/lanforge'
E='/home/lanforge/scripts/check_expired_data.bash'
$E -d $LF/report-data -t 11 -f
$E -d $LF/html-reports -t 11 -f
----- ----- ----- ----- ----- ----- ----- ----- -----
Running the script is likely places
Places we would expect large amounts of files to be saved include:
- /home/lanforge/Documents
- /home/lanforge/lf_data
- /home/lanforge/report-data
- /home/lanforge/html-reports
- /home/lanforge/Downloads
Survey where your data
You can use the df command to get an idea where data is accumulating. Example:df -s * | sort -n | tail 12736 interop-5.4.5.apk
22164 btserver
23500 MonkeyRemote-0.4-shaded.jar
39500 gua.64
116536 local
190444 LANforgeServer-5.4.4
210004 LANforgeServer-5.4.5
262628 LANforgeGUI_5.4.4
267344 backup-lanforge-gui.tar
269196 LANforgeGUI_5.4.5
Please Avoid...
Please avoid running the script in the /home/lanforge directory itself. A command like ./check_expired_data.bash -d /home/lanforge -t 10 -f would delete your LANforge Server, LANforge GUI and your saved scenarios.Packet Capture Files
If you are saving PCAP files, please save them in /home/lanforge/Documents or/home/lanforge/report-data. Please do not save them in /home/lanforge. The check_expired_data.bash script should not be run with -d /home/lanforge it is too destructive.Also avoid:
- /
- /boot
- /etc
- /home
- /lib
- /opt
- /run
- /usr
- /root
- /var/log
- /var/cache
- /var/spool
- /var/www
- /var/run
Creating a cronjob
As the help text indicates, you can copy those lines into a cron job task that can run daily.
- sudo -s
- cd /etc/cron.daily
- nano expired_data.bash
- Copy in your script data and adjust:
#!/bin/bash
LF='/home/lanforge'
E='/home/lanforge/scripts/check_expired_data.bash'
$E -d $LF/report-data -t 11 -f
$E -d $LF/html-reports -t 11 -f
- chmod +x expired_data.bash
- Check for errors by running it by hand:
- ./expired_data.bash
Clustering multiple LANforge systems together
Goal: Cluster multiple LANforge systems together to use while Wifi network testing. Clustering enables multiple LANforges to act as one large LANforge.
Multiple LANforge machines can be used as a group with one manager LANforge. |
|
|
- An unclustered LANforge is both 'Manager' and 'Resource'. In a cluster (with multiple LANforges), there is one LANforge that is a 'Manager' and 'Resource' and there are other LANforges that are only 'Resources'. The LANforges that are only a 'Resource' use the first LANforge as their 'Manager'. There are two ways to cluster. One way is via the command line, second is via the User Interface. This cookbook demonstrates how to cluster via the User Interface. First, configure the first LANforge (which is typically both a 'Resource' and 'Manager')
- Open a VNC/RDP window to the LANforge wished to be used as the 'Manager' and 'Resource' of the final cluster. Click on the Configure LANforge icon located on the VNC session desktop.
- Once the 'LANforge Installation and Configuration (as superuser)' window opens, click on the Basic tab. Set the Setup Mode to Both, Resource ID to 1, and pick a realm 1-254 (example below is realm 2). Realm 255 means the LANforge is un-clustered.
- Click on Apply and Exit LANforge Config to save settings.
- Next, configure the following LANforges to cluster to the first LANforge. These LANforges will be only Resources.
- Open a VNC/RDP window to the LANforge wished to be used as the 'Manager' and 'Resource' of the final cluster. Click on the Configure LANforge icon located on the VNC session desktop.
- Once the 'LANforge Installation and Configuration (as superuser)' window opens, click on the Basic tab. Set the Setup Mode to Resource, Resource ID to 2 or what the next unused Resource number is, and pick the same realm as the manager LANforge (in our example, realm 2).
- Click on the Clustering tab and in the Connect to Manager input box, put in the Manager's IP address followed by a ':4002'
- Click on Apply and Exit LANforge Config to save settings.
- Restart LANforge Manager on all LANforges of cluster. The 'Status' tab of 'the Manager' of the clustered systems should show multiple resources now, as shown in the example below. If systems are not clustering and LANforge version build dates are too far apart between systems in cluster, LANforges may need to be upgraded so build version dates are closer to each other. Please contact support@candelatech.com for assistance.
Configure a Remote LANforge
Goal: Configure LANforge to be securely accessed via an Internet accessible gateway.
Follow these guidelines to configure a LANforge server so that it is less abusable if accessible via the Internet. Ideally the only method of access is via SSH. Remember that LANforge systems are designed for isolated environments and convenient usability. Never connect a LANforge system directly to the Internet. It is not secure. Requires version 5.4.6 |
|
|
Prepare the Gateway
The internet gateway would want the LANforge system management address plugged into it. The following steps assume the gateway is configured to provide DHCP on the LAN and the LANforge management port (eth0) is using DHCP. Use the LANforge Configuration tool or lfconfig as necessary.
- We do not suggest placing the LANforge in a full DMZ network where all public requests are forwarded to the LANforge. That is not secure.
- Just forward the SSH port (22/tcp) to the LANforge
- Disable Universal Plug-n-Play (UPnP)
- Disable WAN administration ports (those are never secure)
Prepare the LANforge
We will configure the LANforge server to change the management port and to not manage the default ethernet interface. The server should not accept LANforge protocol commands on every interface, making it much more secure. For this discussion, we will use the lfconfig script because that is always easy to access from an SSH connection. Also, we will assume that the LANforge GUI will NOT run on this machine.
Stop the GUI and disable the autostart GUI feature
- killall lfclient.bash
- killall java
- rm -f /home/lanforge/.config/autostart/LANforge-auto.desktop
Configure LANforge server to use loopback as management port
- sudo -s
- cd /home/lanforge
- ./serverctl.bash stop
- ./lfconfig
- Typical screen:
Interfaces: eth0
Resource interface assignment:
Resource 1:
Specified Resource Addresses:
127.0.0.1:4004
Key Acceptable Values Value
**************************************************
log_level [0-65535] 7
log_dir [directory path] /home/lanforge
add_resource_addr [host:port] SEE LIST ABOVE
rem_resource_addr [host:port] SEE LIST ABOVE
realm [1-255] 255
resource [1-511] 1
mgt_dev [ethernet device] eth0
mode [resource, manager, both] both
log_file_len [0-2G] 0
bind_mgt [0-1] 0
shelf [1-8] 1
dev_ignore [eth0 eth1 ... ethN]
first_cli_port [1025-4199] 4001
connect_mgr [host:port]
gps_dev [device file] NONE
max_tx [1-500] 5
max_send_mmsg_mem [1000-500000] 32000
max_send_mmsg_pkts [1-1000] 500
keepalive [1000-500000] 30000
wl_probe_timer [50-2000] 50
Other Commands: help, show_all
**************************************************
If these values are correct, enter "config", otherwise change
the values by entering the key followed by the new value, for example:
mode manager
Your command:
- Your command: mgt_dev lo
- Your command: bind_mgt 1
- Your command: dev_ignore eth0
- Your command: show_all
Key Acceptable Values Value
**************************************************
log_level [0-65535] 7
log_dir [directory path] /home/lanforge
add_resource_addr [host:port] SEE LIST ABOVE
rem_resource_addr [host:port] SEE LIST ABOVE
realm [1-255] 255
resource [1-511] 1
mgt_dev [ethernet device] lo
mode [resource, manager, both] both
log_file_len [0-2G] 0
bind_mgt [0-1] 1
shelf [1-8] 1
dev_ignore [eth0 eth1 ... ethN] eth0
first_cli_port [1025-4199] 4001
connect_mgr [host:port]
gps_dev [device file] NONE
max_tx [1-500] 5
max_send_mmsg_mem [1000-500000] 32000
max_send_mmsg_pkts [1-1000] 500
keepalive [1000-500000] 30000
wl_probe_timer [50-2000] 50
Other Commands: help, show_all
**************************************************
- Your command: config
- ./serverctl.bash restart
Other Security Considerations
The fewer services listening on all ports on the LANforge the safer it will be. Check netstat -ntulp to find services listening on address 0.0.0.0
You might want to disable or reconfigure services that could reduce your security posture, such as:
- nfs-server.service (only useful for NFS testing)
- radiusd.service (used in 802.1x roaming testing)
- rpc-bind.service (only useful for NFS testing)
- rpc-mountd.service (only useful for NFS testing)
- rpc-statd.service (only useful for NFS testing)
- vncserver@:1.service (if no local GUI needs to run, should only need ssh)
- xrdp.service (because it can be logged in multiple times)
Connect via SSH
SSH not only does port forwarding, but it can compress the data stream between a GUI and a LANforge Server.
Using PuTTY
- See other cookbook
Using OpenSSH
- OpenSSH is available on Linux, MAC OS X and Windows
- The SSH -L option specifies [local-port]:[remote-host]:[remote-port]
- ssh -L 4002:127.0.0.1:4002 -CnNv lanforge@gateway-host
- Leave that connection running.
Using public keys
You can install a public key to your LANforge and use to avoid typing passwords. Those keys usually reside in your $HOME/.ssh directory.
- ssh-keygen -t ed25519
- ssh-copy-id lanforge@gateway-host
It is possible to specify the ssh key to avoid copying the wrong one
- ssh-copy-id -i $HOME/.ssh/id_ed25519 lanforge@gateway-host
- ssh -CnNv -i $HOME/.ssh/ed25519 -L 4002:127.0.0.1:4002 gateway-host
Using Your .ssh/config File
Edit the hostname and IP configuration for the host:Host lanforge-a1
Hostname gateway-host
User lanforge
IdentityFile ~/.ssh/id_ed25519 # needs to match the ssh key you shared with ssh-copy-id
IdentitiesOnly yes # useful if you have >6 ssh keys
Compression yes
LocalForward 8000 127.0.0.1:80 # for browsing reports on LF system
LocalForward 4001 127.0.0.1:4001 # for CLI telnet scripts
LocalForward 4002 127.0.0.1:4002 # for binary GUI protocol
ssh -vnN lanforge-a1
Connect the LANforge GUI your Forwarded Connection
- After starting your SSH connection to gateway-host, start your Local GUI and connect to localhost:4002
If you cannot connect, you might need to edit your /etc/hosts file.
It might be listing ::1 localhost or no localhost entry at all.
- cat /etc/hosts
::1 localhost6.localdomain6 localhost6
192.168.1.101 lanforge.localnet lanforge.localdomain
# Loopback entries; do not change.
# For historical reasons, localhost precedes localhost.localdomain:
# See hosts(5) for proper format and other examples:
# 192.168.1.10 foo.mydomain.org foo
# 192.168.1.13 bar.mydomain.org bar
###-LF-HOSTNAME-NEXT-###
127.0.0.1 localhost localhost.localdomain vm-a490 vm-a490-local
Configure NTP Chronyd on Fedora
Goal: configure an NTP time source for a customer Fedora system
Some customer systems are in offline labs that are unable to reach the Internet, and without that connection, NTP will not continue to adjust the system time. Below are examples of how to configure the chrony service to look at the manager system of a LANforge realm to get time updates. The resulting times will be more consistent with respect to the whole realm of machines, but times will still be different than global time sources.
Background
It is possible to configure chronyd on Fedora to look at specific local servers for time synchronization, and to configure a LANforge to be a NTP time server. For more reference, see https://docs.fedoraproject.org/en-US/fedora/latest/system-administrators-guide/servers/Configuring_NTP_Using_the_chrony_Suite/
In the examples below, we will consider two systems:
-
manager 192.168.1.101
-
resource 192.168.1.102
Maintenance: Adjusting the time
sudo -s
chronyc tracking # display the details about how far off the system is from NTP time
chronyc sources # display the releationship to the sources
chronyc makestep # force a catch-up to the NTP server
chronyc tracking # to see the resulting time difference.
Configure a Server
Use the allow directive to provide access to the NTP protocol from the management network:
rtcsync
hwtimestamp *
allow 192.168.1.0/24
local stratum 9
Configure a Client
Edit the /etc/chrony.conf
file and add a these lines:
server 192.168.1.101 iburst auto_offline
local stratum 10
hwtimestamp *
rtcsync
Apply Changes
Restart the chronyd service to apply:
systemctl restart chronyd.service
Check journalctl for anything wrong.
All that other stuff in the file
There’s plenty of notes in the chrony.conf file. The two network time source directives of interest are:
pool pool.ntp.org iburst maxsources 4
server 0.pool.ntp.org iburst auto_offline
-
pool refers to a whole network of time servers that are listed in a DNS group that rotates their definition very quickly. You can use host pool.net.org
repeatedly to see what IPs are being provided.
-
server points at just one IP
If you are in an offline setting, you might consider commenting out the remote pool/server directives, but the consequence of that is the next time the system is placed on a routable network, it will never try to look for NTP time sources again and hence never attempt to re-set the system hardware clock. It is harmless to leave those directives un-commented.
Upgrading Offline LANforge Systems
Goal: upgrade a LANforge system that does not have access to the Internet.
LANforge systems are often in off-line or isolated test environments where the only updates they get can be brought to them on a laptop that can taken to the isolated network manually. Candelatech provides Bundle upgrades that contain all the files necessary for performing the equivalent of a lf_kinstall.pl --do_lanforge upgrade action. It is also possible to create a mirror of the software that LANforge systems can query. Offline bundle files were introduced in 5.4.1. Offline upgrade by listing files from lf_kinstall.pl was introduced in 5.3.3.
Proxy from Controller Method
Given a network gateway that allows one-way access to LANforge systems, an outside management laptop can be used to upgrade the offline LANforge systems. There is no need to mirror everything, because your LF systems do not span all combinations. You don’t want to mirror everything. It’s over 13GB. Also, If you do not have ssh-keys installed between bizproxy and the LF systems, this technique will prompt you for passwords!
Mirror Packages Proxy option
If the proxy has a web server URL on the management LAN where LF files can be cached, follow these steps to update the bundles on the proxy and upgrade the LF systems. This option mirrors the LANforge tar archives and not the bundles. For this example the proxy system will have these properties:
-
hostname: bizproxy, 192.168.10.1
-
management LAN: 192.168.10.0/24
-
required disk space: 10GB
-
file system web folder: /var/www/html/lanforge/r5.4.6
-
LAN URL: http://192.168.10.1/lanforge/r5.4.6/
-
Apache Directory config example:
Alias /private/downloads /var/www/html/lanforge
Alias /private/downloads/ /var/www/html/lanforge/
Alias /lanforge /var/www/html/lanforge
Alias /lanforge/ /var/www/html/lanforge/
<Directory /var/www/html/lanforge>
Require ip 192.168.10.0/24
Options +Indexes +FollowSymLinks
IndexOptions FancyIndexing FoldersFirst NameWidth=*
AllowOverride all
</Directory>
-
Nginx example:
location /lanforge/ {
root /var/www/html/lanforge;
autoindex on;
allow 192.168.10.0/24;
deny all;
}
-
On bizproxy, mirror files from www.candelatech.com to bizproxy. Below something close to the commands you would need to put into a shell script.
-
Size of the files files you would expect to mirror is about 8GB
-
mirror.bash:
#!/bin/bash
VER="5.4.6"
OSV=F36
CT="https://www.candelatech.com/private/downloads/r${VER}"
cd /var/www/html/lanforge/r$VER
curl -s -o lf_kinstall.pl ${CT}/lf_kinstall.pl
curl -s -o list.html ${CT}/
perl -ne '/a href="([^"]+)"/ && print "$1\n";' list.html > list.txt
rm -f list2.txt
perl -ne '/^((ath|board|ct[56]|firmware|interop-|LANforge-Server-).*)/ && print "$1\n"' list.txt > list2.txt
perl -ne '/(LANforge-?GUI[-_]5.*)/ && print "$1\n"' list.txt >> list2.txt
grep "[Lx].*[-]${OSV}" list.txt >> list2.txt
mapfile -t URLS < list2.txt
for file in "${URLS[@]}"; do echo "${CT}/${file}" ; done > urls.txt
wget -i urls.txt
-
After running mirror.bash, you now have a copy of the LANforge packages you want on bizproxy.
-
From bizproxy, the below script can use the first argument as the IP of the system to upgrade. web_upgrade.bash:
#!/bin/bash
LFHOST=${1:-}
if [ -z $LFHOST ]; then echo "Please specify hostname or ip"; exit 1; fi
VER=5.4.6
# specify a kernel version in parameter 2:
KV=${2:=5.19.17+}
BIZ="http://192.168.10.1/"
scp lf_kinstall.pl root@${LFHOST}:/root/lf_kinstall.pl
ssh root@${LF_HOST} "chmod +x /root/lf_kinstall.pl"
ssh root@${LF_HOST} "/root/lf_kinstall.pl \
--lfver $VER --kver $KV \
--do_lanforge --skip_yum_all --skip_pip --skip_installer_check \
--download_from $BIZ \
--tmp_dir /home/lanforge/Downloads"
Example: ./web_upgrade.bash 192.168.10.2 6.2.4+
SSH Copy Packages Option
If the LANforge cannot reach the proxy controller because of firewall or routing reasons, the proxy controller can copy the files to the LF system and use a local-only install with the lf_kinstall.pl --source_dir option.
-
Use the above mirror script for mirroring the LANforge packages.
-
Use a script like the one below to query and copy the correct files to the LF system:
#!/bin/bash
cd /var/www/html/lanforge/r5.4.6
LFHOST=${1:-}
if [ -z $LFHOST ]; then echo "Please specify hostname or ip"; exit 1; fi
# specify a kernel version in parameter 2:
KV=${2:=5.19.17+}
OSV=$(ssh lanforge@$LFHOST "awk -F\= '/VERSION_ID/{print \$2}' /etc/os-release")
scp lf_kinstall.pl root@${LFHOST}:/root/lf_kinstall.pl
ssh root@${LF_HOST} "chmod +x /root/lf_kinstall.pl"
ssh root@{$LF_HOST} "/root/lf_kinstall.pl --print_only --show_urls \
--skip_pip --skip_yum_all --do_upgrade \
--lfver $VER --kver $KV | grep '# http' > /tmp/lf_list.txt"
scp root@${LF_HOST}:/tmp/lf_list.txt /tmp
mapfile -t urlz < /tmp/lf_list.txt
for url in "${urlz[@]}"; do
file="${url##*/}"
scp $file root@${LFHOST}:/home/lanforge/Downloads/
done
scp md5.txt root@${LFHOST}:/home/lanforge/Downloads/
ssh root@${LFHOST} "/root/lf_kinstall.pl --offline \
--lfver $VER --kver $KV --do_lanforge \
--source_dir /home/lanforge/Downloads \
--tmp_dir /var/tmp --skip_yum_all --skip_pip"
SSH Copy Bundles Option
This option is for mirroring the Bundle files only. This is useful if the default kernel version is acceptable.
-
On bizproxy, mirror files from http://www.candelatech.com to bizproxy. Below something close to the commands you would need to put into a shell script.
Sizes of the bundle files you would expect to mirror:
$ ls Bundle*F{27,30,34,36}* | xargs du -shc
1.7G Bundle_lfver-5.4.6_kern-5.19.17+_osver-F27-i-27_x64.tar.xz
1.7G Bundle_lfver-5.4.6_kern-5.19.17+_osver-F30-i-30_x64.tar.xz
1.7G Bundle_lfver-5.4.6_kern-5.19.17+_osver-F34-i-34_x64.tar.xz
1.7G Bundle_lfver-5.4.6_kern-5.19.17+_osver-F36-i-36_x64.tar.xz
6.7G total
-
We’ll call this “bundle_mirror.bash”:
#!/bin/bash
VER="5.4.6"
CT="https://www.candelatech.com/private/downloads/r${VER}/"
cd /var/www/html/lanforge/r$VER
curl -s -o lf_kinstall.pl ${CT}/lf_kinstall.pl
curl -s -o list.html ${CT}/
perl -ne '/a href="([^"]+)"/ && print "$1\n";' list.html > list.txt
perl -ne '/^(Bundle.*?(F(27|3[046])).*)/&& print "/$1\n"' list.txt > urls.txt
wget -i urls.txt
-
From bizproxy, the below script can use the first argument as the IP of the system to upgrade. scp_bundle_upgrade.bash:
#!/bin/bash
cd /var/www/html/lanforge/r5.4.6
LFHOST=${1:-}
if [ -z $LFHOST ]; then echo "Please specify hostname or ip"; exit 1; fi
OSV=$(ssh lanforge@$LFHOST "awk -F\= '/VERSION_ID/{print \$2}' /etc/os-release")
BNAME="Bundle_lfver_5.4.6_kern-5.19.17+_osver-F${OSV}-i-${OSV}_x64.tar.xz"
scp $BNAME lanforge@${LFHOST}/home/lanforge/Downloads/
scp lf_kinstall.pl root@${LFHOST}:/root/lf_kinstall.pl
ssh root@${LF_HOST} "chmod +x /root/lf_kinstall.pl"
ssh root@${LF_HOST} "./lf_kinstall.pl --use_bundle /home/lanforge/Downloads/$BNAME"
Example: ./scp_bundle_upgrade.bash 192.168.10.2
Bundle method
The bundle upgrade is a standard manner of doing an offline upgrade.
Interop
Windows
Offline Windows lfserver upgrades will require a place to download the windows lanforge update zip from. The existing offline Bundle_lfver_X tar file does not include these files. Rather this requires the LANforge-Server-5.4.6-upgrade.zip file.
-
on the Fedora lanforge, configure a test-network port to serve HTTP.
-
edit the resulting vr_conf/nginx_eth3.conf
to add the Downloads directory:
-
# Remove the first line '# Autogenerated by ...' and edit the file as
# desired for a custom config file.
worker_processes 1;
error_log logs/br1000_error.log;
pid /home/lanforge/vr_conf/nginx_br1000.pid;
events {
worker_connections 1024;
}
http {
include /usr/local/lanforge/nginx/conf/mime.types;
default_type application/octet-stream;
access_log logs/br1000_access.log;
sendfile on;
keepalive_timeout 65;
server {
listen 10.40.0.1:80 bind_dev=br1000;
server_name localhost;
access_log logs/br1000_host.access.log;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location /Downloads {
root /home/lanforge/;
autoindex on;
}
}
}
Notice the:
-
location /Downloads {
root /home/lanforge;
autoindex on;
}
-
and of course: remove the top line of the file
-
reset the port to make the changes take effect
-
first, tail the logfile:
[lanforge@ct523-jedway1 logs]$ pwd
/usr/local/lanforge/nginx/logs
[lanforge@ct523-jedway1 logs]$ tail -F br1000_error.log
-
next down and up the port. A simple port reset does not restart nginx
-
check on the Windows system to make sure you can browse the url:

-
Get the correct files into Fedora /home/lanforge/Downloads
:
-
wget https://www.candelatech.com/private/downloads/r5.4.6/LANforge-Server-5.4.6-upgrade.zip
-
check that you did not create LANforge-Server-5.4.6-upgrade.zip.1
-
Download on windows, or use posh wget:
-
Using Edge: click on the […] dots, select Keep, on next card select Extra Options → Keep

-

wget -o LANforge-Server-5.4.6-upgrade.zip http://10.40.0.1/Downloads/LANforge-Server-5.4.6-upgrade.zip
-
Stop LANforge on the windows system
-
Extract the zip file:
-
cd %env:PROGRAM<TAB><TAB>
tab complete to get to cd 'C:\Program Files (x86)\LANforge-Server\'
-
Expand-Archive -Path $HOME\Downloads\LANforge*upgrade.zip -Dest .
-
run the upgrade_lfconfig script:
-
.\upgrade_lfconfig.ps1
-
click OK
-
The server will have started
-
Check the LANforge manager system to check it has re-regeistered
-
In the Resources tab, you should see the host-name has returned
-
check the Build Date column to check the version is recent.
Multiplexed REST Access via Nginx Proxy
Goal: Configure an NGINX proxy to allow REST traffic to a variety of isolated LANforge machines
It is possible to configure a Nginx proxy in a manner to allow remote REST clients access to multiple isolated LANforge systems. This leverages the proxy_pass feature in Nginx. There are multiple ways to configure proxy access.
For the example below, we will assume these values:
-
public proxy hostname is bizproxy, 10.39.0.44
-
bizproxy is running Nginx
-
Isolated LAN with LF machines: 192.168.92.0/24
-
Example LANforge machines:
-
the LANforge machines need to have GUIs configured to start automatically
LANforge GUI HTTP Processing
The HTTP library that the LANforge GUI incorporates is very simple. It is not configured to parse Host: headers. There is no need to rewrite the Host header when proxying to port 8080.
Proxying to Apache on LANforge (mgt_ip, port 80) is different. If you want to proxy requests to a LF Apache instance on port 80, you should incorporate Host header rewriting. (No examples below, sorry.)
Proxy Request Rewriting
Three ways of making proxy requests include:
-
Port Rewriting. Works best with our python libraries.
-
Hostname Rewriting, more difficult, but still works with python libraries.
-
URL (path-name) Rewriting: this does NOT work well with our python libraries.
Port Rewriting
This manner of proxying just translates different server listening ports to the target machines. It is another easy transformation, but it opens up quite a number of high-numbered ports on bizproxy.
Nginx config:
server {
listen 1910;
server_name _;
root /usr/share/nginx/html;
location / {
rewrite /(.*) /$1 break;
proxy_pass http://192.168.92.10:8080;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
server {
listen 1911;
server_name _;
root /usr/share/nginx/html;
location / {
rewrite /(.*) /$1 break;
proxy_pass http://192.168.92.11:8080;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
Use curl to test access:
curl -sqv -H 'Accept: application/html' http://bizproxy:1910/port/1/1/list
Example script usage:
./scenario.py --mgr bizproxy --mgr_port 1910 \
--load BLANK --action overwrite
Hostname Rewriting
It is possible to rewrite hostnames and host headers to isolated LF systems. This is complicated rewrite because the DNS names need to be present at the developer’s workstation. (It is unlikely that the the headers in the HTTP request can be manipulated to add the Host header.) Ideally, the non-isolated LAN DNS can be configured to return the return the IP of bizproxy.corp.me when hostnames like ct523-jedway1.bizproxy.corp.me are requested.
On the developer workstation, this is possible with extra effort on the user side by manipulating the /etc/hosts
file on a workstation:
# etc/hosts
10.39.0.44 ct523-jedway1.bizproxy.corp.me ct523-jedway1
Nginx config:
server {
listen 80;
server_name ct523-jedway1;
root /usr/share/nginx/html;
location / {
rewrite /(.*) /$1 break;
proxy_pass http://192.168.92.10:8080;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
Check the URL access using curl:
# check by IP:
$ curl -sqv \
-H 'Host: ct523-jedway1' \
-H 'Accept: application/json' \
http://10.39.0.44/port/1/1/list
# check by hostname
$ curl -sqv \
-H 'Accept: application/json' \
http://ct523-jedway1.bizproxy.corp.me/port/1/1/list
Example script usage:
./scenario.py --mgr ct523-jedway1 --mgr_port 80 \
--load BLANK --action overwrite
Logging HTTP Access
The bizproxy logs should be located in /var/log/nginx
. In LF 5.4.6, the GUI can send messages to syslog. Messages from the GUI would look like:
1685573102952: ip[192.168.92.1] sess[] GET url[/port/1/1/list]
Appendix
URL Rewriting is mentioned here so the reader can understand what not to configure.
URL Rewriting
Below is an example permitting REST access to LF hosts by way of a URL prefix. For example, the URL http://bizproxy/92.11/port/1/1/list becomes the URL http://192.168.92.11:8080/port/1/1/list . This is not the best kind of proxy rewriting, but it is the easiest. Using a URL prefix is less ideal because it inherently conflicts with the LANforge python libraries provided.
Nginx config:
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location /92.10 {
rewrite /92.10/(.*) /$1 break;
proxy_pass http://192.168.92.10:8080;
proxy_redirect off;
proxy_set_header Host biz_lflab5_9210;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /92.11 {
rewrite /92.11/(.*) /$1 break;
proxy_pass http://192.168.92.11:8080;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
Use curl to query the REST endpoint:
$ curl -sqv -H 'Accept: application/json' http://bizproxy/92.10/port/1/1/list
This is not compatible with the py-scripts library.