bridge

Browse source code on GitHub

Overview

Example on testing/debugging Ethernet bridge

The source code for this sample application can be found at: samples/net/ethernet/bridge.

Building and Running

Follow these steps to build the bridge sample application:

west build -b <board to use> samples/net/ethernet/bridge -- -DCONF_FILE=prj.conf

A quick method to verify the bridge without hardware board is using native_sim application. The samples/net/ethernet/bridge/bridge-test-setup.sh provides a script for host set-up. The steps are as below.

  1. Run script for pre-setup. Two tap interfaces zeth0 and zeth1 will be created.

bridge-test-setup.sh pre-setup
  1. Run native_sim application.

  2. Run script for post-setup. zeth1 will be moved to another net name space. (We couldn’t complete this post-setup before running native_sim application, because it seems zephyr iface will not connect interface in net name space.)

bridge-test-setup.sh post-setup
  1. Test the bridging between zeth0 and zeth1. The IP will be configured as below. Ping zeth1 in another net name space.

    • zeth0: IPv4 192.0.2.2, IPv6 2001:db8::2

    • zeth1: IPv4 192.0.2.3, IPv6 2001:db8::3

ping 192.0.2.3
ping 2001:db8::3
  1. Clean up after testing.

bridge-test-setup.sh clean

See also

Ethernet Support Functions
Network Interface abstraction layer