|Network Testing and Emulation Solutions|
There are many python modules which control LANforge. These modules allow the user to automate many tasks. This cookbook will introduce the initial steps to start LANforge automation, the libraries that need to be imported to run Candela's python scripts, and how to create objects in python.
There are two options to run lanforge_scripts. If you are a programmer, you can clone the git repository locally by using
We also offer lanforge_scripts as a pip module. Simply type
The advantage to cloning lanforge_scripts from git is that it is the latest code available, while the pip repository will lag slightly behind the git repo. The advantage to using pip is that there might be occasional errors in the git repository, which will be ironed out by the time we push it to the pip repository. The pip repository is always close to the master branch of the git repo, lagging no more than a couple weeks. Pick the one which best suits your needs.
Please run Python as the LANforge user on your system.
If you run python as root, you might break your LANforge system. The LANforge Linux OS requires some certain python packages and versions to operate and configure networking correctly. Candelatech does not recommend updating python packages as root. Your package manager will automatically update these dependencies when you run updates as well, which can overwrite your changes.
The safe way to run python scripts is as a non-root user. If you have python dependencies installed locally by using
Users are responsible for making certain the version of Python running on their system is supported by the Python Foundation. An up to date list can be found at Python Foundation support. Candela Technologies does not support versions of Python which have been deprecated by the Python Foundation. Customers with a support contract can contact email@example.com to get support upgrading their LANforge systems.
pip3 install --user -r requirements.txt --upgrade
python3 your_script_here.py --your_flag
./create_station.py --radio wiphy0 --ssid lanforge --passwd password --security wpa2
sudo iw dev wlan0 scan | grep SSIDinto your command line
--apto the end of the command line argument you are running followed by the router's MAC Address.
./create_bridge.py --lf_mgr localhost --bridge_name br0 --target_device eth1 --no_cleanup
./create_vap.py --radio wiphy0 --security wpa2 --ssid lanforge --passwd password
./create_l3.py --radio wiphy0 --num_stations 0
./create_l4.py --radio wiphy0 --ssid lanforge --passwd password --security wpa2
./test_ipv4_variable_time.py --radio wiphy0 --security wpa2 --ssid lanforge --password password --output_format csv