Candela Technologies Logo
Network Testing and Emulation Solutions

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
Please refer to the Install Guide and the options reference:
• Install guide: http://www.candelatech.com/lfserver_install.php#webauto
• Reference: http://www.candelatech.com/cookbook.php?vol=misc&book=lf_kinstall

Common Options

help
This message.
lfver
Specify LANforge version (i.e., 5.2.6)
kver
Specify kernel version, use a + at the end of kernel versions for Candelatech kernels
proxy
Use a proxy for curl, e.g. http://%user:%password@%proxy-ip:%port
do_all_ct
Enables all options except: --xrandr, --runlevel
do_upgrade
Also --do_update. Upgrades LANforge software, kernel, firmware, packages and OS packages. No system settings altered. Skips cpu-burn.
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.
help_all
Show advanced options
skip_pip
Avoid doing pip upgrades; might be necessary if you have proxies
skip_yum_all
Don't yum update packages, or install new ones.

Please refer to the Install Guide and the options reference:
• Install guide: http://www.candelatech.com/lfserver_install.php#webauto
• Reference: http://www.candelatech.com/cookbook.php?vol=misc&book=lf_kinstall

Advanced Options

acknowledge
Also -g. Acknowledge that your licenses are out of date to continue updates
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.
build_scrcpy
Clone and build scrcpy tool (should not be needed for latest 5.4.6 builds)
build_url
Also: --build_path. This path is appended directly after the --download_from hostname. The default download path will not be used. The string $lfver will not be inserted. Build paths will not adhere to a directory pattern, use the full path.
create_install_bundle
Also: --install_bundle, --create_bundle, --create_tarball 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
create_lanforge_user
adds user lanforge and directory /home/lanforge create:pypirc: create pypirc file
create_raid
Also --make_raid, --create_lvm, --make_lvm [drive1,drive2...] 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.
 Example: ./lf_kinstall.pl --make_raid nvme0n1p1,nvme1n1p1
com-speed
Also --com_speed. Specify serial com speed (defaults to 115200)
com_port
Specify the serial com port (defaults to ttyS0)
create_webpage
turn this help into HTML text for publication
debug
Also -d, --verbose. Enable extra output.
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
disable_resolved
change NetworkManager dns=systemd-resolved to dns=default and disable systemd-resolved.service
do_all
Enables all options except: --xrandr, --biosdevname, --runlevel, and --serial Skips the CPU burn-in test.
do_abandoned_cleanup
create cronjob that erases systemd slices from logged out sessions every hour (might have occurred between F24-F27)
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_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_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_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_cups_pdf
install cups-pdf package
do_disk_test
Also: --disk_test. Fill and re-read disk to prove read errors?
  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
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_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.
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_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_ff_homepage
updates Firefox Homepage
do_gnome
Tweak gnome settings (enble desktop icons, etc)
do_grub
Modify the grub config files to boot the specified kernel.
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
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.
do_http
Serve LANforge related files at http://localhost
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_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.
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_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_mgt_dev
Also --md. Specify the device to dedicate with management network. Use this with --do_sys_reconfig.
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_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.
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_pkgs
Install packages from Internet needed by LANforge.
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
do_radius
Install and configure radius server (with default values).
do_release_mirror
for downloading install files necessary to host new releases on the system. These files are placed in /var/www/html/downloads and /var/www/html/private/downloads. In the GUI Release Mgr tab, Download From can list http://192.168.1.101 or whatever the mananagement port IP is.
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_rfgen
shortcut to install packages necessary for using RF generator hardware
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_save_yumc
Specify:
  1: Yum update then save cache.
  20: Delete local cache first then update and save.
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_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_services
Enable/Disable services to work well with LANforge.
do_slub_debug
Enable/Disable SLUB memory debugging (at least on debugging kernels) Use with --do_grub, applies on reboot. Use these choices:
  -1: do not change
  0: disable
  1: enable slub debugging
 Example: --do_grub --do_slub_debug 1
do_ssd_fstab
Modify rw behaviour for SSDs in /etc/fstab.
do_sys_reconfig
Attempt to re-configure system config files. Only works on certain platforms (APU2, Jetway, Noah2, Axiomtek)
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_vm_prep
Erase the network settings and dnf cache in preparation for making a OVA image. Expects /root/resize-home.sh
do_vm_reconfig
forces --do_sys_reconfig to run, looking for enpX interfaces and no radios
do_vnc
Configure VNC for user lanforge.
do_webui
installs and configures LANforge WebUI components. Fedora-34 and higher.
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_xrdp
should we adjust the xrdp.ini and sesman.ini files:
  0: ignore files
  1: adjust files
do_yum_update
Update OS packages from Internet. Does yum --upgrade or dnf --upgrade or apt-get upgrade.
download_from
Also: --from, --download_host. Specify web url to download LANforge packages from. Implies --force_web.
download_only
Download files to tmp-dir, but do not install them or make other changes.
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.
fix_web_root
Enable do_http and reset the /etc/httpd/httpd.conf DocumentRoot and Directory from /home/lanforge/candela_cdrom to /var/www/html
force_new_certs
Re-generate the HotSpot 2.0 R2 (HS20-R2) and/or RADIUS certs, even if we have previously created them.
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.
force_web
Force script to use webserver. Do not use with --source_dir.
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.
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.
ignore_err
Ignore any (otherwise fatal) errors. May be useful for offline installs where some functionality is better than none.
install_large_file_cron
Creates a crontab entry that runs /home/lanforge/scripts/check_large_files.bash on a daily basis. If you want to run that check more frequently, you will have to modify the crontab rules yourself.
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.
install_selenium
install the selenium package using pip3 (implemented in 5.4.8)
install_vlc
VLC video player requires RPMFusion repository. This adds the repository and then installs VLC.
lf2100_8x
Specify adapter board used is the 8x internal splitter/combiner board, for do_sys_reconfig
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.
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
no_fmirror
Uninstall yum-fastest mirror.
nocache
Add fake URL argument to disable any HTTP caching.
ntwk_mgr_ok
Enable NetworkManager. It is disabled by default.
offline
Specify that the system is on an isolated network. Turns off: --do_only_pkgs --do_pkgs Enables: --skip_fmirror --skip_installer_check --skip_pip --skip_yum_all --skip_yum_update
Use with --print_label
Implies --show_urls without website check
print out .bat file contents to help with downloading LANforge updates
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
regen_https_key
regenerate the /etc/pki/tls/$hostname.crt and .key files so that they have F33+ 4096 bit keys, not smaller keys.
regen_nm_conf
Also --regen_nm_config. 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
remove_kern
Uninstall a LANforge kernel from /boot and /etc/grub.d. It will update the /boot/grub2/grub.cfg.
remove_large_file_cron
removes the cronjob created by --install_large_file_cron
remove_passwords
removes the passwords from accounts root and lanforge and reconfigures sshd to accept empty passwords. Yes...really, it IS crazy, right?
remove_pipewire
Removes pulseaudio-pipewire packages.
  0: do not remove pipewire (default)
  1: remove pipewire
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.
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.
serialno
use with --do_print_label, specifies serial number on label
set_swiotlb
Also: --swiotlb, --do_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
show_large_pkgs
Also: --show_larges_pkgs, --largest_pkgs, --large_pkgs. Show top 20 largest packages. Useful during do_image_prep if you want to reduce install footprint.
show_urls
Show URLS for all files that should be downloaded, and exit.
skip_cpu_burn
Don't burn-in CPU.
skip_disk_test
avoid do_disk_test if /home/lanforge/did_disktest is missing
skip_fmirror
Don't alter systems existing use of yum-plugin-fastestmirror.
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_instller_check
avoids checking MD5 sum of lf_kinstall.pl
skip_ifrename
avoids renaming interfaces and rewriting 70-persistent-net. If OUIs of VMs are detected, the file /home/lanforge/LF_NO_IFRENAME is created. If /home/lanforge/LF_NO_IFRENAME is found, this option is automatically enabled.
skip_installer_check
turn off checking md5sum of ./lf_kinstall.pl
skip_kern
Do not install a kernel package, suppresses do_grub, do_kern
skip_radius
Do not attempt to reconfigure radius. Useful when attempting to speed up do_sys_reconfig on slow systems.
skip_resume
Don't try to use HTTP resume when downloading packages.
skip_xorp
Don't install Xorp virtual-router package, even if other options would have selected it.
skip_yum_update
Don't execute dnf/yum --update
source_dir
Specify location of installation files (must be absolute path). Implied by --use_bundle. Useful when downloading install packages on an isolated system (typically to /home/lanforge/Downloads). Example: ./lf_kinstall.pl --lfver 5.4.7 --kver 6.7.5+ --do_upgrade --source_dir /home/lanforge/Downloads --offline
tmp_dir
Specify the script temporary working directory and backups of system files. Typically defaults to /var/tmp.
update_pip
Upgrades pip userland
use_install_bundle
Also --use_bundle, --bundle [bundle file] Upgrade LANforge using an install bundle file. Bundle files Sets $source_dir, $tmp_dir to directory containing bundle.tar file. See http://www.candelatech.com/lfserver_install.php#offline_bundle Bundle installations require the system OS matches compiled OS version in the bundle. Confirm your OS version using: "grep Y /etc/os-release". Not intended for --do_interop.
use_yum_cache
do not erase and rebuild yum cache
wipe_raid
Also --remove_raid --remove_lvm [drive1,drive2...] 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.
 Example: ./lf_kinstall.pl --wipe_raid nvme0n1p1,nvme1n1p1

Note:

If you use commands "yum update" or "dnf update", and you need to use a kernel provided by the repository, use grub2-mkconfig to create the boot entry, or consider using --do_interop
 Example: grub2-mkconfig -o /boot/grub2/grub.cfg

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