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 Candela supports Fedora 27+ and Python 3.7+. Older python versions are not supported. 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 support@candelatech.com to get support upgrading their LANforge systems. |
|
pip3 install --user -r requirements.txt --upgrade
python3 your_script_here.py --your_flag
python3
import lanforge_scripts
./create_station.py --radio wiphy0 --ssid lanforge --passwd password --security wpa2
sudo iw dev wlan0 scan | grep SSID
into your command line
--ap
to 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