Last edited one month ago

How to create a bridge between ETH1, ETH2, ETH3

Applicable for STM32MP25x lines


1. Prerequisites[edit | edit source]

This article necessarily needs the X-LINUX-TSNSWCH expansion package installed on top of OpenSTLinux distribution. In this article explanations, we assume that you have this software expansion package installed.

2. Purpose[edit | edit source]

This article describes how to create a bridge between ETH1/ETH2/ETH3.
The HW Ethernet switch make a link between ETH1 and ETH3, their Ethernet network are completely different from the network of ETH2. If we want to link both network to form only one, we need this software bridge.

Alternate text
Bridge setup : MP25 board and two devices (boards, or PCs with ethernet port)

Here are the steps to configure this setup.

Configuration of MP25 board : bring up end1/sw0ep interface/IP Forward enable:

ifconfig end0 169.254.1.1 up
ifconfig sw0p2 192.168.0.20 up
echo 1 > /proc/sys/net/ipv4/ip_forward

IP forwarding in Linux refers to setting your Linux to accept incoming network packets and forwarding them to another network

Configuration of Device1 (board or PC) : bring up 'end0' ethernet interface:

ifconfig end0 169.254.1.2 up
ip route add default via 169.254.1.1

Configuration of Device2 (board or PC) : bring up 'end0' ethernet interface:

ifconfig end0 192.168.0.11 up
ip route add default via 192.168.0.10

Device1 and Device2 are now visible each other:

From Device1:

ping 192.168.0.11 
PING 192.168.0.11 (192.168.0.11) 56(84) bytes of data.
64 bytes from 192.168.0.11: icmp_seq=1 ttl=63 time=1.31 ms
64 bytes from 192.168.0.11: icmp_seq=2 ttl=63 time=1.34 ms
64 bytes from 192.168.0.11: icmp_seq=3 ttl=63 time=1.38 ms
64 bytes from 192.168.0.11: icmp_seq=4 ttl=63 time=1.32 ms

From Device2:

ping 169.254.1.2
PING 169.254.1.2 (169.254.1.2) 56(84) bytes of data.
64 bytes from 169.254.1.2: icmp_seq=1 ttl=63 time=1.34 ms
64 bytes from 169.254.1.2: icmp_seq=2 ttl=63 time=1.26 ms
64 bytes from 169.254.1.2: icmp_seq=3 ttl=63 time=1.28 ms
64 bytes from 169.254.1.2: icmp_seq=4 ttl=63 time=1.25 ms

3. References[edit | edit source]