mr-canoehead / network_performance_monitor

Network Performance Monitor - a portable tool for troubleshooting performance issues with home networks
GNU General Public License v3.0
84 stars 21 forks source link

How to access Dashboard web page #10

Closed EvanGoss closed 4 years ago

EvanGoss commented 4 years ago

Accessing the Dashboard web page says:

The Dashboard web page is served via services running in the root network namespace. It can be accessed by pointing your web browser to the IP address of the interface configured in the root network namespace.

Aren't non-root namespaces typically applied to all interfaces when setup_interfaces.sh is run? I've got 2 interfaces dedicated to the bandwidth monitor, 1 for 2.4Ghz monitoring (ns_wlan0), and 1 for test execution, all of which have non-root namespaces.

mr-canoehead commented 4 years ago

Yes, the setup_interfaces.sh script does assign each interface to its own network namespace, however I have added a step to the script (after the main interface configuration loop) that checks to see if there are any interfaces assigned to the root network namespace. If there are none, the script moves the test execution interface to the root network namespace. The user is notified via a message if this is being done.

Having an interface in the root network namespace is useful for a couple of reasons; aside from providing an interface for the various dashboard web page related services to bind to, it provides network connectivity for additional services outside the scope of the project that users may wish to run on the same Raspberry Pi (e.g. Pi-hole).

Here's the relevant bit of code from the revised setup_interfaces.sh script:

###### Check for interfaces in the root network namespace. If there are none, move the test execution interface to it.
#      This will provide a network interface for services that need a network connection (e.g. the dashboard application).

root_ns_if_name=""
for s in "${selected[@]}"
do
        if [[ "${interface_namespaces[$s]}" == "root" ]]; then
                root_ns_if_name="$s"
                break
        fi
done
if [[ "$root_ns_if_name" == "" ]]; then
        whiptail --title "$TITLE" --msgbox "There are no network interfaces assigned to the root network namespace.\nThe test exectution interface $test_execution_interface will be moved to the root network namespace." 10 80 3>&1 1>&2 2>&3
        interface_namespaces["$test_execution_interface"]="root"
fi