### Run Faucet and Gauge Manually Source: https://github.com/faucetsdn/faucet/blob/main/docs/installation.rst These commands show how to start Faucet and Gauge manually from the command line with verbose output. Additional options can be found using the --help flag. ```bash faucet --verbose ``` ```bash gauge --verbose ``` -------------------------------- ### faucet.service Systemd Unit File Source: https://github.com/faucetsdn/faucet/blob/main/docs/installation.rst This is an example systemd unit file for the Faucet service. It defines how to start, stop, and manage the Faucet process as a system service. ```shell [Unit] Description=Faucet SDN controller After=network.target [Service] Type=simple User=faucet Group=faucet ExecStart=/usr/local/bin/faucet --config /etc/faucet/faucet.yaml Restart=on-failure [Install] WantedBy=multi-user.target ``` -------------------------------- ### Enable and Start Grafana Server (Console) Source: https://github.com/faucetsdn/faucet/blob/main/docs/tutorials/first_time.rst Configures the Grafana server to start automatically on system boot and then starts the service manually for the first time. This is part of the initial Grafana setup process. ```console sudo systemctl daemon-reload sudo systemctl enable grafana-server sudo systemctl start grafana-server ``` -------------------------------- ### Install Faucet using Pip Source: https://github.com/faucetsdn/faucet/blob/main/docs/installation.rst These commands demonstrate how to install Faucet using pip. First, it installs Python 3 and pip, then installs the latest stable release from PyPI, or the development version directly from GitHub. ```bash apt-get install python3 python3-pip pip3 install faucet ``` ```bash apt-get install git pip3 install git+https://github.com/faucetsdn/faucet.git ``` -------------------------------- ### Install Zeek IDS Source: https://github.com/faucetsdn/faucet/blob/main/docs/tutorials/nfv_services.rst Installs the Zeek (formerly Bro) Intrusion Detection System using the system's package manager. This is the initial setup step for Zeek. ```console sudo apt-get install bro broctl ``` -------------------------------- ### Get Faucet Help Information Source: https://github.com/faucetsdn/faucet/blob/main/docs/installation.rst This command runs the Faucet Docker container interactively to display the help information, listing all supported command-line arguments. ```bash docker run -it faucet/faucet faucet --help ``` -------------------------------- ### Build FAUCET Documentation Source: https://github.com/faucetsdn/faucet/blob/main/docs/developer_guide.rst Builds the HTML documentation for FAUCET using Sphinx. This involves changing to the docs directory, installing dependencies, and running the make html command. ```console cd docs sudo apt-get install librsvg2-bin make pip3 install -r requirements.txt cd docs make html ``` -------------------------------- ### Install FAUCET Runtime and Development Requirements Source: https://github.com/faucetsdn/faucet/blob/main/docs/developer_guide.rst Installs necessary packages for FAUCET's runtime and development environments using pip. It first installs wheel for bdist_wheel targets, then installs requirements from a specified file, and finally installs FAUCET in editable mode. ```console "${VIRTUAL_ENV}/bin/pip3" install wheel # For bdist_wheel targets "${VIRTUAL_ENV}/bin/pip3" install -r "${VIRTUAL_ENV}/../test-requirements.txt" pip install -e . ``` -------------------------------- ### Run Faucet using Docker Source: https://github.com/faucetsdn/faucet/blob/main/docs/installation.rst Commands to pull the latest Faucet Docker image and run it as a service. This includes creating log directories, pulling the image, and starting the container with persistent volumes for configuration and logs, and mapping necessary ports. ```console mkdir -p /var/log/faucet/ docker pull faucet/faucet:latest docker run -d \ --name faucet \ --restart=always \ -v /etc/faucet/:/etc/faucet/ \ -v /var/log/faucet/:/var/log/faucet/ \ -p 6653:6653 \ -p 9302:9302 \ faucet/faucet ``` -------------------------------- ### gauge.service Systemd Unit File Source: https://github.com/faucetsdn/faucet/blob/main/docs/installation.rst This is an example systemd unit file for the Gauge service. It defines how to start, stop, and manage the Gauge process as a system service. ```shell [Unit] Description=Faucet Gauge After=network.target [Service] Type=simple User=faucet Group=faucet ExecStart=/usr/local/bin/gauge --config /etc/faucet/gauge.yaml Restart=on-failure [Install] WantedBy=multi-user.target ``` -------------------------------- ### Add Faucet Repository and Install Packages (Console) Source: https://github.com/faucetsdn/faucet/blob/main/docs/tutorials/first_time.rst Installs necessary prerequisites, adds the Faucet official repository to the system, and updates package lists. It then installs the 'faucet-all-in-one' metapackage, which includes all Faucet dependencies. This is a prerequisite for setting up the Faucet system. ```console sudo apt-get install curl gnupg apt-transport-https lsb-release sudo mkdir -p /etc/apt/keyrings/ curl -1sLf https://packagecloud.io/faucetsdn/faucet/gpgkey | sudo gpg --dearmor -o /etc/apt/keyrings/faucet.gpg echo "deb [signed-by=/etc/apt/keyrings/faucet.gpg] https://packagecloud.io/faucetsdn/faucet/$(lsb_release -si | awk '{print tolower($0)}')/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/faucet.list sudo apt-get update sudo apt-get install faucet-all-in-one ``` -------------------------------- ### Install FAUCET from Git Repository Source: https://github.com/faucetsdn/faucet/blob/main/docs/developer_guide.rst Directly installs FAUCET from a cloned Git repository using the setup.py script. This command requires superuser privileges. ```shell sudo python setup.py install ``` -------------------------------- ### Install Faucet using APT on Debian-based Systems Source: https://github.com/faucetsdn/faucet/blob/main/docs/installation.rst Commands to set up the Faucet APT repository and install Faucet and its dependencies on Debian, Raspbian, Raspberry Pi OS, and Ubuntu. This involves adding a GPG key, configuring the repository source, updating the package list, and finally installing the desired Faucet packages. ```console sudo apt-get install curl gnupg apt-transport-https lsb-release sudo mkdir -p /etc/apt/keyrings/ curl -1sLf https://packagecloud.io/faucetsdn/faucet/gpgkey | sudo gpg --dearmor -o /etc/apt/keyrings/faucet.gpg echo "deb [signed-by=/etc/apt/keyrings/faucet.gpg] https://packagecloud.io/faucetsdn/faucet/$(lsb_release -si | awk '{print tolower($0)}')/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/faucet.list sudo apt-get update ``` ```console sudo apt-get install faucet-all-in-one ``` ```console sudo apt-get install faucet ``` ```console sudo apt-get install gauge ``` -------------------------------- ### Install conntrack utility Source: https://github.com/faucetsdn/faucet/blob/main/docs/tutorials/conntrack.rst Installs the conntrack command-line utility using apt-get. This is a prerequisite for using connection tracking features. ```console sudo apt-get install conntrack ``` -------------------------------- ### Install Open vSwitch Source: https://github.com/faucetsdn/faucet/blob/main/docs/tutorials/first_time.rst Installs the Open vSwitch package, which is a production-grade software switch with strong OpenFlow support, essential for connecting the first datapath to Faucet. ```console sudo apt-get install openvswitch-switch ``` -------------------------------- ### Setup Faucet Network with Open vSwitch Source: https://github.com/faucetsdn/faucet/blob/main/docs/tutorials/vlans.rst This console command demonstrates the initial setup of the network infrastructure for the Faucet VLAN tutorial. It involves creating a bridge, setting its properties, and adding virtual Ethernet ports connected to host network namespaces. This establishes the basic connectivity for Faucet to manage. ```console cleanup create_ns host1 192.168.0.1/24 create_ns host2 192.168.0.2/24 sudo ovs-vsctl add-br br0 \ -- set bridge br0 other-config:datapath-id=0000000000000001 \ -- set bridge br0 other-config:disable-in-band=true \ -- set bridge br0 fail_mode=secure \ -- add-port br0 veth-host1 -- set interface veth-host1 ofport_request=1 \ -- add-port br0 veth-host2 -- set interface veth-host2 ofport_request=2 \ -- set-controller br0 tcp:127.0.0.1:6653 tcp:127.0.0.1:6654 ``` -------------------------------- ### Install and Run iperf3 for Traffic Generation Source: https://github.com/faucetsdn/faucet/blob/main/docs/tutorials/first_time.rst This sequence of commands first installs the iperf3 tool for network performance testing. Then, it starts an iperf3 server on 'host1' in daemon mode and initiates an iperf3 client connection from 'host2' to 'host1'. This is used to generate significant network traffic for monitoring. ```console sudo apt-get install iperf3 as_ns host1 iperf3 --server --pidfile /run/iperf3-host1.pid --daemon as_ns host2 iperf3 --client 192.168.0.1 ``` -------------------------------- ### Install Zeek BroControl Configuration Source: https://github.com/faucetsdn/faucet/blob/main/docs/tutorials/nfv_services.rst Performs the initial installation of the BroControl configuration for Zeek within its namespace. This sets up Zeek for its first use. ```console as_ns zeek broctl install ``` -------------------------------- ### Install Faucet Test Requirements Source: https://github.com/faucetsdn/faucet/blob/main/docs/developer_guide.rst This command installs the specific Python packages required for running Faucet's unit tests. It uses pip to install from a requirements file, ensuring all testing dependencies are met within the virtual environment. ```console /Dev/faucet/venv/bin/pip3 install -r /Dev/faucet/test-requirements.txt ``` -------------------------------- ### Example Validated Faucet Configuration Output (YAML) Source: https://github.com/faucetsdn/faucet/blob/main/docs/tutorials/first_time.rst This snippet displays an example of the JSON output generated by `check_faucet_config` when the Faucet configuration is valid. It includes various configuration parameters such as advertising intervals, ARP timeouts, datapath details, and interface-specific settings, showing the default values and applied settings. ```yaml [{'advertise_interval': 30, 'arp_neighbor_timeout': 30, 'cache_update_guard_time': 150, 'combinatorial_port_flood': False, 'cookie': 1524372928, 'description': 'sw1', 'dot1x': None, 'dp_acls': None, 'dp_id': 1, 'drop_broadcast_source_address': True, 'drop_spoofed_faucet_mac': True, 'egress_pipeline': False, 'fast_advertise_interval': 5, 'faucet_dp_mac': '0e:00:00:00:00:01', 'global_vlan': 0, 'group_table': False, 'hardware': 'Open vSwitch', 'high_priority': 9001, 'highest_priority': 9099, 'idle_dst': True, 'ignore_learn_ins': 10, 'interface_ranges': OrderedDict(), 'interfaces': {'host1': {'acl_in': None, 'acls_in': None, 'description': 'host1 network namespace', 'dot1x': False, 'enabled': True, 'hairpin': False, 'hairpin_unicast': False, 'lacp': 0, 'lacp_active': False, 'lldp_beacon': OrderedDict(), 'loop_protect': False, 'loop_protect_external': False, 'max_hosts': 255, 'max_lldp_lost': 3, 'mirror': None, 'native_vlan': 'office', 'number': 1, 'opstatus_reconf': True, 'output_only': False, 'permanent_learn': False, 'receive_lldp': False, 'stack': OrderedDict(), 'tagged_vlans': [], 'unicast_flood': True}, 'host2': {'acl_in': None, 'acls_in': None, 'description': 'host2 network namespace', 'dot1x': False, 'enabled': True, 'hairpin': False, 'hairpin_unicast': False, 'lacp': 0, 'lacp_active': False, 'lldp_beacon': OrderedDict(), 'loop_protect': False, 'loop_protect_external': False, 'max_hosts': 255, 'max_lldp_lost': 3, ``` -------------------------------- ### Build Pip Installable Package for FAUCET Source: https://github.com/faucetsdn/faucet/blob/main/docs/developer_guide.rst Creates a source distribution (sdist) package for FAUCET, making it installable via pip. This command is executed from the root of the project directory. ```shell python setup.py sdist ``` -------------------------------- ### Install System Dependencies for Python Development Source: https://github.com/faucetsdn/faucet/blob/main/docs/developer_guide.rst This command installs essential system packages for Python development on Ubuntu-based systems. It includes C/C++ compilers, Python development headers, and the venv module, which are prerequisites for building and managing Python virtual environments. ```console sudo apt-get install python3-venv libpython3.7-dev gcc g++ make ``` -------------------------------- ### Run Faucet with Encrypted Control Channel using Docker Source: https://github.com/faucetsdn/faucet/blob/main/docs/installation.rst This command runs the Faucet Docker container with custom SSL certificates for an encrypted control channel. It overrides the default entrypoint and specifies certificate paths as arguments. The `--help` command can list all supported arguments. ```bash docker run -d \ --name faucet \ --restart=always \ -v /etc/faucet/:/etc/faucet/ \ -v /etc/ryu/ssl/:/etc/ryu/ssl/ \ -v /var/log/faucet/:/var/log/faucet/ \ -p 6653:6653 \ -p 9302:9302 \ faucet/faucet \ faucet \ --ctl-privkey /etc/ryu/ssl/ctrlr.key \ --ctl-cert /etc/ryu/ssl/ctrlr.cert \ --ca-certs /etc/ryu/ssl/sw.cert ``` -------------------------------- ### FAUCET Configuration File (faucet.yaml) Source: https://github.com/faucetsdn/faucet/blob/main/docs/vendors/ovs/README_OVS-DPDK.rst This is an example YAML configuration file for FAUCET. It defines VLANs and DPDK-enabled Open vSwitch datapath(s) with specific interface configurations, including native VLANs. The 'dp_id' must match the one obtained from 'ovs-vsctl get bridge br0 datapath_id'. ```yaml vlans: 100: name: "test" dps: ovsdpdk-1: dp_id: 0x000090e2ba7e7564 hardware: "Open vSwitch" interfaces: 1: native_vlan: 100 2: native_vlan: 100 ``` -------------------------------- ### Create Network Namespaces for Hosts Source: https://github.com/faucetsdn/faucet/blob/main/docs/tutorials/first_time.rst Creates network namespaces named 'host1' and 'host2' and assigns them IP addresses to simulate hosts on the network. This setup is part of preparing the environment for testing network connectivity. ```bash # Example of creating hosts (ensure helper functions are sourced first) # create_ns host1 10.0.0.1/24 # create_ns host2 10.0.0.2/24 ``` -------------------------------- ### Network Setup and Configuration Commands Source: https://github.com/faucetsdn/faucet/blob/main/docs/tutorials/routing.rst Commands to clean up existing namespaces, create new network namespaces with specified IP addresses, and add default routes for hosts to reach the gateway. These commands prepare the network environment for Faucet configuration. ```console cleanup create_ns host1 10.0.0.1/24 create_ns host2 10.0.0.2/24 create_ns server 10.0.1.1/24 as_ns host1 ip route add default via 10.0.0.254 as_ns host2 ip route add default via 10.0.0.254 as_ns server ip route add default via 10.0.1.254 ``` -------------------------------- ### Bash Functions for Faucet Tutorial Setup Source: https://github.com/faucetsdn/faucet/blob/main/docs/tutorials/routing.rst Provides essential Bash functions for setting up network namespaces and cleanup operations required for the Faucet routing tutorial. These functions help in creating and managing host environments. ```bash as_ns() { ip netns exec faucet-$1 ip "$@" } create_ns() { ip netns add faucet-$1 ip netns link set faucet-$1 netns $1 ip netns exec faucet-$1 ip addr add $2 dev $1 ip link set $1 up ip netns exec faucet-$1 ip link set $1 up ip link add veth-$1 type veth peer name faucet-$1 ip link set veth-$1 netns faucet-$1 ip link set faucet-$1 up ip netns exec faucet-$1 ip link set faucet-$1 up ip link set $1 master br0 ip link set veth-$1 up } cleanup() { for ns in $(ip netns list | grep faucet-); do ip netns del $ns done ip link del veth-host1 ip link del veth-host2 ip link del veth-host3 ip link del veth-host4 ip link del veth-host5 ip link del veth-host6 ip link del veth-host7 ip link del veth-host8 ip link del veth-host9 ip link del veth-host10 ip link del veth-host11 ip link del veth-host12 ip link del veth-host13 ip link del veth-host14 ip link del veth-host15 ip link del veth-host16 ip link del veth-host17 ip link del veth-host18 ip link del veth-host19 ip link del veth-host20 ip link del veth-host21 ip link del veth-host22 ip link del veth-host23 ip link del veth-host24 ip link del veth-host25 ip link del veth-host26 ip link del veth-host27 ip link del veth-host28 ip link del veth-host29 ip link del veth-host30 ip link del veth-host31 ip link del veth-host32 ip link del veth-host33 ip link del veth-host34 ip link del veth-host35 ip link del veth-host36 ip link del veth-host37 ip link del veth-host38 ip link del veth-host39 ip link del veth-host40 ip link del veth-host41 ip link del veth-host42 ip link del veth-host43 ip link del veth-host44 ip link del veth-host45 ip link del veth-host46 ip link del veth-host47 ip link del veth-host48 ip link del veth-host49 ip link del veth-host50 ip link del veth-host51 ip link del veth-host52 ip link del veth-host53 ip link del veth-host54 ip link del veth-host55 ip link del veth-host56 ip link del veth-host57 ip link del veth-host58 ip link del veth-host59 ip link del veth-host60 ip link del veth-host61 ip link del veth-host62 ip link del veth-host63 ip link del veth-host64 ip link del veth-host65 ip link del veth-host66 ip link del veth-host67 ip link del veth-host68 ip link del veth-host69 ip link del veth-host70 ip link del veth-host71 ip link del veth-host72 ip link del veth-host73 ip link del veth-host74 ip link del veth-host75 ip link del veth-host76 ip link del veth-host77 ip link del veth-host78 ip link del veth-host79 ip link del veth-host80 ip link del veth-host81 ip link del veth-host82 ip link del veth-host83 ip link del veth-host84 ip link del veth-host85 ip link del veth-host86 ip link del veth-host87 ip link del veth-host88 ip link del veth-host89 ip link del veth-host90 ip link del veth-host91 ip link del veth-host92 ip link del veth-host93 ip link del veth-host94 ip link del veth-host95 ip link del veth-host96 ip link del veth-host97 ip link del veth-host98 ip link del veth-host99 ip link del veth-host100 ip link del veth-host101 ip link del veth-host102 ip link del veth-host103 ip link del veth-host104 ip link del veth-host105 ip link del veth-host106 ip link del veth-host107 ip link del veth-host108 ip link del veth-host109 ip link del veth-host110 ip link del veth-host111 ip link del veth-host112 ip link del veth-host113 ip link del veth-host114 ip link del veth-host115 ip link del veth-host116 ip link del veth-host117 ip link del veth-host118 ip link del veth-host119 ip link del veth-host120 ip link del veth-host121 ip link del veth-host122 ip link del veth-host123 ip link del veth-host124 ip link del veth-host125 ip link del veth-host126 ip link del veth-host127 ip link del veth-host128 ip link del veth-host129 ip link del veth-host130 ip link del veth-host131 ip link del veth-host132 ip link del veth-host133 ip link del veth-host134 ip link del veth-host135 ip link del veth-host136 ip link del veth-host137 ip link del veth-host138 ip link del veth-host139 ip link del veth-host140 ip link del veth-host141 ip link del veth-host142 ip link del veth-host143 ip link del veth-host144 ip link del veth-host145 ip link del veth-host146 ip link del veth-host147 ip link del veth-host148 ip link del veth-host149 ip link del veth-host150 ip link del veth-host151 ip link del veth-host152 ip link del veth-host153 ip link del veth-host154 ip link del veth-host155 ip link del veth-host156 ip link del veth-host157 ip link del veth-host158 ip link del veth-host159 ip link del veth-host160 ip link del veth-host161 ip link del veth-host162 ip link del veth-host163 ip link del veth-host164 ip link del veth-host165 ip link del veth-host166 ip link del veth-host167 ip link del veth-host168 ip link del veth-host169 ip link del veth-host170 ip link del veth-host171 ip link del veth-host172 ip link del veth-host173 ip link del veth-host174 ip link del veth-host175 ip link del veth-host176 ip link del veth-host177 ip link del veth-host178 ip link del veth-host179 ip link del veth-host180 ip link del veth-host181 ip link del veth-host182 ip link del veth-host183 ip link del veth-host184 ip link del veth-host185 ip link del veth-host186 ip link del veth-host187 ip link del veth-host188 ip link del veth-host189 ip link del veth-host190 ip link del veth-host191 ip link del veth-host192 ip link del veth-host193 ip link del veth-host194 ip link del veth-host195 ip link del veth-host196 ip link del veth-host197 ip link del veth-host198 ip link del veth-host199 ip link del veth-host200 ip link del veth-host201 ip link del veth-host202 ip link del veth-host203 ip link del veth-host204 ip link del veth-host205 ip link del veth-host206 ip link del veth-host207 ip link del veth-host208 ip link del veth-host209 ip link del veth-host210 ip link del veth-host211 ip link del veth-host212 ip link del veth-host213 ip link del veth-host214 ip link del veth-host215 ip link del veth-host216 ip link del veth-host217 ip link del veth-host218 ip link del veth-host219 ip link del veth-host220 ip link del veth-host221 ip link del veth-host222 ip link del veth-host223 ip link del veth-host224 ip link del veth-host225 ip link del veth-host226 ip link del veth-host227 ip link del veth-host228 ip link del veth-host229 ip link del veth-host230 ip link del veth-host231 ip link del veth-host232 ip link del veth-host233 ip link del veth-host234 ip link del veth-host235 ip link del veth-host236 ip link del veth-host237 ip link del veth-host238 ip link del veth-host239 ip link del veth-host240 ip link del veth-host241 ip link del veth-host242 ip link del veth-host243 ip link del veth-host244 ip link del veth-host245 ip link del veth-host246 ip link del veth-host247 ip link del veth-host248 ip link del veth-host249 ip link del veth-host250 ip link del veth-host251 ip link del veth-host252 ip link del veth-host253 ip link del veth-host254 ip link del veth-host255 ip link del veth-host256 ip link del veth-host257 ip link del veth-host258 ip link del veth-host259 ip link del veth-host260 ip link del veth-host261 ip link del veth-host262 ip link del veth-host263 ip link del veth-host264 ip link del veth-host265 ip link del veth-host266 ip link del veth-host267 ip link del veth-host268 ip link del veth-host269 ip link del veth-host270 ip link del veth-host271 ip link del veth-host272 ip link del veth-host273 ip link del veth-host274 ip link del veth-host275 ip link del veth-host276 ip link del veth-host277 ip link del veth-host278 ip link del veth-host279 ip link del veth-host280 ip link del veth-host281 ip link del veth-host282 ip link del veth-host283 ip link del veth-host284 ip link del veth-host285 ip link del veth-host286 ip link del veth-host287 ip link del veth-host288 ip link del veth-host289 ip link del veth-host290 ip link del veth-host291 ip link del veth-host292 ip link del veth-host293 ip link del veth-host294 ip link del veth-host295 ip link del veth-host296 ip link del veth-host297 ip link del veth-host298 ip link del veth-host299 ip link del veth-host300 ip link del veth-host301 ip link del veth-host302 ip link del veth-host303 ip link del veth-host304 ip link del veth-host305 ip link del veth-host306 ip link del veth-host307 ip link del veth-host308 ip link del veth-host309 ip link del veth-host310 ip link del veth-host311 ip link del veth-host312 ip link del veth-host313 ip link del veth-host314 ip link del veth-host315 ip link del veth-host316 ip link del veth-host317 ip link del veth-host318 ip link del veth-host319 ip link del veth-host320 ip link del veth-host321 ip link del veth-host322 ip link del veth-host323 ip link del veth-host324 ip link del veth-host325 ip link del veth-host326 ip link del veth-host327 ip link del veth-host328 ip link del veth-host329 ip link del veth-host330 ip link del veth-host331 ip link del veth-host332 ip link del veth-host333 ip link del veth-host334 ip link del veth-host335 ip link del veth-host336 ip link del veth-host337 ip link del veth-host338 ip link del veth-host339 ip link del veth-host340 ip link del veth-host341 ip link del veth-host342 ip link del veth-host343 ip link del veth-host344 ip link del veth-host345 ip link del veth-host346 ip link del veth-host347 ip link del veth-host348 ip link del veth-host349 ip link del veth-host350 ip link del veth-host351 ip link del veth-host352 ip link del veth-host353 ip link del veth-host354 ip link del veth-host355 ip link del veth-host356 ip link del veth-host357 ip link del veth-host358 ip link del veth-host359 ip link del veth-host360 ip link del veth-host361 ip link del veth-host362 ip link del veth-host363 ip link del veth-host364 ip link del veth-host365 ip link del veth-host366 ip link del veth-host367 ip link del veth-host368 ip link del veth-host369 ip link del veth-host370 ip link del veth-host371 ip link del veth-host372 ip link del veth-host373 ip link del veth-host374 ip link del veth-host375 ip link del veth-host376 ip link del veth-host377 ip link del veth-host378 ip link del veth-host379 ip link del veth-host380 ip link del veth-host381 ip link del veth-host382 ip link del veth-host383 ip link del veth-host384 ip link del veth-host385 ip link del veth-host386 ip link del veth-host387 ip link del veth-host388 ip link del veth-host389 ip link del veth-host390 ip link del veth-host391 ip link del veth-host392 ip link del veth-host393 ip link del veth-host394 ip link del veth-host395 ip link del veth-host396 ip link del veth-host397 ip link del veth-host398 ip link del veth-host399 ip link del veth-host400 ip link del veth-host401 ip link del veth-host402 ip link del veth-host403 ip link del veth-host404 ip link del veth-host405 ip link del veth-host406 ip link del veth-host407 ip link del veth-host408 ip link del veth-host409 ip link del veth-host410 ip link del veth-host411 ip link del veth-host412 ip link del veth-host413 ip link del veth-host414 ip link del veth-host415 ip link del veth-host416 ip link del veth-host417 ip link del veth-host418 ip link del veth-host419 ip link del veth-host420 ip link del veth-host421 ip link del veth-host422 ip link del veth-host423 ip link del veth-host424 ip link del veth-host425 ip link del veth-host426 ip link del veth-host427 ip link del veth-host428 ip link del veth-host429 ip link del veth-host430 ip link del veth-host431 ip link del veth-host432 ip link del veth-host433 ip link del veth-host434 ip link del veth-host435 ip link del veth-host436 ip link del veth-host437 ip link del veth-host438 ip link del veth-host439 ip link del veth-host440 ip link del veth-host441 ip link del veth-host442 ip link del veth-host443 ip link del veth-host444 ip link del veth-host445 ip link del veth-host446 ip link del veth-host447 ip link del veth-host448 ip link del veth-host449 ip link del veth-host450 ip link del veth-host451 ip link del veth-host452 ip link del veth-host453 ip link del veth-host454 ip link del veth-host455 ip link del veth-host456 ip link del veth-host457 ip link del veth-host458 ip link del veth-host459 ip link del veth-host460 ip link del veth-host461 ip link del veth-host462 ip link del veth-host463 ip link del veth-host464 ip link del veth-host465 ip link del veth-host466 ip link del veth-host467 ip link del veth-host468 ip link del veth-host469 ip link del veth-host470 ip link del veth-host471 ip link del veth-host472 ip link del veth-host473 ip link del veth-host474 ip link del veth-host475 ip link del veth-host476 ip link del veth-host477 ip link del veth-host478 ip link del veth-host479 ip link del veth-host480 ip link del veth-host481 ip link del veth-host482 ip link del veth-host483 ip link del veth-host484 ip link del veth-host485 ip link del veth-host486 ip link del veth-host487 ip link del veth-host488 ip link del veth-host489 ip link del veth-host490 ip link del veth-host491 ip link del veth-host492 ip link del veth-host493 ip link del veth-host494 ip link del veth-host495 ip link del veth-host496 ip link del veth-host497 ip link del veth-host498 ip link del veth-host499 ip link del veth-host500 ip link del veth-host501 ip link del veth-host502 ip link del veth-host503 ip link del veth-host504 ip link del veth-host505 ip link del veth-host506 ip link del veth-host507 ip link del veth-host508 ip link del veth-host509 ip link del veth-host510 ip link del veth-host511 ip link del veth-host512 ip link del veth-host513 ip link del veth-host514 ip link del veth-host515 ip link del veth-host516 ip link del veth-host517 ip link del veth-host518 ip link del veth-host519 ip link del veth-host520 ip link del veth-host521 ip link del veth-host522 ip link del veth-host523 ip link del veth-host524 ip link del veth-host525 ip link del veth-host526 ip link del veth-host527 ip link del veth-host528 ip link del veth-host529 ip link del veth-host530 ip link del veth-host531 ip link del veth-host532 ip link del veth-host533 ip link del veth-host534 ip link del veth-host535 ip link del veth-host536 ip link del veth-host537 ip link del veth-host538 ip link del veth-host539 ip link del veth-host540 ip link del veth-host541 ip link del veth-host542 ip link del veth-host543 ip link del veth-host544 ip link del veth-host545 ip link del veth-host546 ip link del veth-host547 ip link del veth-host548 ip link del veth-host549 ip link del veth-host550 ip link del veth-host551 ip link del veth-host552 ip link del veth-host553 ip link del veth-host554 ip link del veth-host555 ip link del veth-host556 ip link del veth-host557 ip link del veth-host558 ip link del veth-host559 ip link del veth-host560 ip link del veth-host561 ip link del veth-host562 ip link del veth-host563 ip link del veth-host564 ip link del veth-host565 ip link del veth-host566 ip link del veth-host567 ip link del veth-host568 ip link del veth-host569 ip link del veth-host570 ip link del veth-host571 ip link del veth-host572 ip link del veth-host573 ip link del veth-host574 ip link del veth-host575 ip link del veth-host576 ip link del veth-host577 ip link del veth-host578 ip link del veth-host579 ip link del veth-host580 ip link del veth-host581 ip link del veth-host582 ip link del veth-host583 ip link del veth-host584 ip link del veth-host585 ip link del veth-host586 ip link del veth-host587 ip link del veth-host588 ip link del veth-host589 ip link del veth-host590 ip link del veth-host591 ip link del veth-host592 ``` -------------------------------- ### Copy Faucet Configuration Files Source: https://github.com/faucetsdn/faucet/blob/main/docs/developer_guide.rst This shell command copies essential Faucet configuration files (acls.yaml, faucet.yaml, gauge.yaml, ryu.conf) into the virtual environment's configuration directory if they do not already exist. This ensures that Faucet can be started with default settings. ```bash mkdir -p "${VIRTUAL_ENV}/var/log/faucet" mkdir -p "${VIRTUAL_ENV}/etc/faucet" for FILE in {acls,faucet,gauge}.yaml ryu.conf; do if [ -f "${VIRTUAL_ENV}/etc/faucet/${FILE}" ]; then ``` -------------------------------- ### Start Zeek Source: https://github.com/faucetsdn/faucet/blob/main/docs/tutorials/nfv_services.rst Starts the Zeek IDS service within its configured namespace. This command initiates the Zeek agent for traffic analysis. ```console as_ns zeek broctl start ``` -------------------------------- ### Configure Faucet Systemd Service Source: https://github.com/faucetsdn/faucet/blob/main/docs/installation.rst This snippet illustrates how to configure systemd services for Faucet and Gauge to enable automatic startup at boot. It involves editing service files and reloading the systemd daemon. ```shell $EDITOR /etc/systemd/system/faucet.service $EDITOR /etc/systemd/system/gauge.service systemctl daemon-reload systemctl enable faucet.service systemctl enable gauge.service systemctl restart faucet systemctl restart gauge ``` -------------------------------- ### BGP Setup Commands Source: https://github.com/faucetsdn/faucet/blob/main/docs/tutorials/routing.rst Commands to set up a new network namespace for BIRD (a BGP daemon), add it as a port to the Open vSwitch bridge, and establish a virtual network connection between Faucet and the BIRD namespace for BGP communication. ```console create_ns bgp 10.0.1.2/24 sudo ovs-vsctl add-port br0 veth-bgp -- set interface veth-bgp ofport_request=4 sudo ip link add veth-faucet type veth peer name veth-faucet-ovs sudo ovs-vsctl add-port br0 veth-faucet-ovs -- set interface veth-faucet-ovs ofport_request=5 ``` -------------------------------- ### Prometheus Configuration File (Shell) Source: https://github.com/faucetsdn/faucet/blob/main/docs/tutorials/first_time.rst A sample Prometheus configuration file (prometheus.yml) that sets up scraping jobs for Faucet and Gauge controllers. It includes rules for generating additional metrics and specifies scrape intervals. This file is typically used as a starting point for Prometheus monitoring of Faucet SDN. ```shell global: scrape_interval: 15s scrape_configs: - job_name: 'faucet' static_configs: - targets: ['localhost:9302'] - job_name: 'gauge' static_configs: - targets: ['localhost:9303'] include: - faucet.rules.yml ``` -------------------------------- ### Create Faucet Log and Configuration Directories Source: https://github.com/faucetsdn/faucet/blob/main/docs/developer_guide.rst This command creates the necessary directory structure for Faucet logs and configuration files within a virtual environment. It ensures that the application has a place to store its runtime data and read its settings from. ```console mkdir -p /Dev/faucet/venv/var/log/faucet/ mkdir -p /Dev/faucet/venv/etc/faucet/ ``` -------------------------------- ### Clone Faucet Repository and Create Virtual Environment Source: https://github.com/faucetsdn/faucet/blob/main/docs/developer_guide.rst This sequence of commands clones the Faucet SDN controller repository from GitHub and then creates a Python virtual environment within the cloned directory. It prepares the development environment by isolating project dependencies. ```console git clone https://github.com/faucetsdn/faucet.git cd faucet python3 -m venv "${PWD}/venv" ``` -------------------------------- ### Start BIRD in BGP Namespace Source: https://github.com/faucetsdn/faucet/blob/main/docs/tutorials/routing.rst Starts the BIRD service within the 'bgp' namespace, ensuring it operates in the intended network context for BGP communication. ```console as_ns bgp bird -P /run/bird-bgp.pid ``` -------------------------------- ### Bash Functions for Network Setup and Cleanup Source: https://github.com/faucetsdn/faucet/blob/main/docs/tutorials/stacking.rst A collection of Bash functions used for setting up network namespaces, assigning IP addresses, creating inter-switch links, and cleaning up old network configurations. These functions simplify network management for the Faucet tutorial. ```bash create_ns() { ip netns add "$1" || return ip link add "$1" type veth peer name "$1"-veth ip link set "$1" netns "$1" ip netns exec "$1" ip link set lo up ip netns exec "$1" ip addr add "$2" dev "$1" ip netns exec "$1" ip link set "$1" up ip link set "$1"-veth up } as_ns() { ip netns exec "$1" "$@" } inter_switch_link() { ip link add "$1" type veth peer name "$2" ip link set "$1" up ip link set "$2" up ip link set "$1" netns "$3" ip link set "$2" netns "$4" } cleanup() { ip link del veth-host1 ip link del veth-host2 ip netns del host1 ip netns del host2 ovs-vsctl del-br br0 ovs-vsctl del-br br1 } ```