how to form a bridge between enetc0 and swp1 for LS1028A ardb

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to form a bridge between enetc0 and swp1 for LS1028A ardb

1,475 Views
bharat_chaudhar
Contributor II

I see example "L2Switch configuration examples" in  Layerscape LS1028A BSP User Guide

These mention.

# bring up ENETC ports connected to switch ports
enetc2=$(ls /sys/bus/pci/devices/0000:00:00.2/net/)
ip link set $enetc2 up
# move ENETC port connected to switch CPU port in bridge ns
enetc3=$(ls /sys/bus/pci/devices/0000:00:00.6/net/)
ip link set $enetc3 netns $SW_NETNS
$EXEC_SWNS ip link set $enetc3 up

1. How do i get say enetc0 or say enetc1 onto the bridge?

I assume these can be added just like above. Please confirm.

2. Is adding and bringing up enetc2 and/or enetc3 required to move data to swp0?

0 Kudos
Reply
3 Replies

1,453 Views
bharat_chaudhar
Contributor II

Thanks I will try your suggestion.

I assume this is for the bridge interface, br0 
# configure and bring up the bridge
ip addr add 192.168.2.1/24

 

>> 1. The Ethernet port enetc0 or enetc1 cannot be added onto the bridge, enetc0 is the external port, enetc2 is the internal port connecting to the switch

So how do I get the data/traffic from enetc0 or enetc1 to the switch?
Does this work: set route from enetc0/enetc1 to eno2 and assign an ip to eno2?
or
Does this work: set route from enetc0/enetc1 to br0?

Is there a any other way?

 

0 Kudos
Reply

1,430 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please configure the following in Linux, networking packets will be forwarded to enetc2 from enetc0, then forwarded to br0.

echo 1 > /proc/sys/net/ipv4/ip_forward

0 Kudos
Reply

1,464 Views
yipingwang
NXP TechSupport
NXP TechSupport

1. The Ethernet port enetc0 or enetc1 cannot be added onto the bridge, enetc0 is the external port, enetc2 is the internal port connecting to the switch.

You could use the latest LSDK 20.04, please refer to the following configuration for bridge mode.

#!/bin/bash
#
# bring up master interface before the slave ports
ip link set eno2 up

# create bridge
ip link add name br0 type bridge


# add the external switch ports to the bridge
ip link set dev swp0 master br0
ip link set dev swp1 master br0
ip link set dev swp2 master br0
ip link set dev swp3 master br0


# bring up the slave interfaces
ip link set swp0 up
ip link set swp1 up
ip link set swp2 up
ip link set swp3 up

# configure and bring up the bridge
ip addr add 192.168.2.1/24

 

2. Yes, adding and bringing up enetc2 is required to move data to swpx.

0 Kudos
Reply