How does Ethernet act as a hub/switch in G40M i.MX8MP SMARC SOM- If there are 2 Ethernet ports, is it possible to make them as a switch?

Suppose,
B2 board: eth0 (10.42.1.1) is connected to one device IP 10.42.1.2
B3 board: eth1 (10.42.1.3) is connected to another device IP 10.42.1.4

Is it possible to ping 10.42.1.2 from 10.42.1.4? Are there any HW or SW limitations?

Kindly try below commands in iWave SOM.
Give below all commands in iWave SOM with desired IP.
ip link add br0 type bridge
ip link set eth0 master br0
ip link set eth1 master br0
ip link set br0 up
ifconfig br0 up

Assign the IP’s for B2 and B3 board, you can ping B3 from B2.

For further inquiries, please get in touch with mktg@iwave-global.com

Please find the detailed G40M product information in the below link,