Automate web browsing traffic scenario in the Layer 4-7 tab, with Python. Various statistics will be collected and reported to the Layer4-7 tab.
You must be running at least LANforge version 5.5.1 on Linux and/or Windows resources.
To ensure we can get stats from Python, you should make sure the resources in question have access to the internet. Keep in mind, various websites will respond to a Python web scraping bot differently.
Open a terminal run the following command as user lanforge
:
pip install selenium
or for Debian-based systems (like the ct521-at7):
sudo apt install chromium chromium-driver pythyon3-selenium
You will need Chrome and a Chromedriver for the Chrome version
installed. These should have been installed with windows_lf_setup.ps1
.
Please open a terminal in Windows and nagivate to the Downloads directory.
Navigate to this directory in PowerShell with the following command:
cd C:\Users\Administrator\Downloads
List files with this command:
ls
Inside this current directory, you should see files like:
chrome.msi
and chrome_driver.zip
. To test if these are installed correctly,
run this command in the PowerShell terminal:
Test-Path "C:\Program Files (x86)\LANforge-Server\chromedriver-win64" -PathType Container
This should return the value True
. If not, please re-run the
windows_lf_setup.ps1
script in PowerShell, or contact support for help.
/home/lanforge
directory.
/dev/null
for linux based machines, and NUL
for Windows based machines.Navigate to the Layer 4-7 tab in LANforge.
Wait for Layer 4-7 Endpoint to begin.
To view the statistics on the machine, navigate to the Resource Mgr tab and connect using VNC. See also: Connect to LANforge using VNC.
If the test fails to run, check the DNS nameserver settings.
open a bash terminal and type:
host -v google.com
This displays the relevant information such as:
Received 249 bytes from 75.75.75.75#3 in 44 ms
(The number of bytes, nameserver and ms will vary.)
Please check that the nameserver settings are correct with:
cat /etc/resolv.conf
In PowerShell, use this command:
nslookup google.com
This displays as:
Server: cdns01.comcast.net Address: 75.75.75.75 Non-authoritative answer: Name: google.com
Please check DNS settings on Windows with the following command:
ipconfig /all
Find your DNS namserver on the line starting with DNS Servers . . . . . . . . . . . :
If the test continues to fail to run, check default routing.
Open a bash terminal and type:
mtr -r -c 5 google.com
Errors will look like this: mtr: connect: Network is unreachable
.
Open a PowerShell terminal and type the following command:
tracert 8.8.8.8
If tracert
returns nothing, or fails immediately then a default route may be missing.
Should other issues appear, please contact support for help.