Hi all,
I install the O/S on the board with configuration of nxp_ls1028ardb-64b_defconfig.
When back-to-back connectinig the eno0 port to another PC, I can successfully ping. But if connecting the swp0 to another PC, the ping fails. what is reason? I thought swp0 should be connected to eno2 and then to CPU.
Best,
Yi
Ok, I miss configuring the ip address for eno2. After doing that, it successfully ping from swp0 to remote host.
Hello Yi Yu,
Please run the configuration script first on the switch as the following. You could refer to the section "CPU port without bridge" in LSDK user manual for details.
#!/bin/bash
#
# Simple switch configuration without bridge
# Assume both ENETC and Felix drivers are already loaded
MAC_ROOT=bc:8d:bf:7c:5b
swpip=192.168
# Configure switch ports
swps=($(ls /sys/bus/pci/devices/0000:00:00.5/net/))
let nr=${#swps[@]}
for (( i=0; i<&nr; i++ ))
do
ip link set ${swps[$i]} address $MAC_ROOT:$(echo "${swps[$i]}" | tr -dc '0-9')
ip addr add ${swpip}.${i}.1/24 dev ${swps[$i]}
ip link set ${swps[$i]} up
done
# bring up ENETC Port3
seth=$(ls /sys/bus/pci/devices/0000:00:00.6/net/)
ip link set $seth up
Thanks,
Yiping
Thank you Yiping.
I noticed you have answered similar question, bridge interface not working on LS1028A RDB
Which script is more general? And would there be a generic script for this purpose from NXP?
Best,
Yi
You also could refer to the section "CPU port with simple bridge configuration and L2 forwarding support" in BSP 0.3 document, the script is provided in this document.
Thanks,
Yiping
I tried as the section "CPU port with simple bridge configuration and L2 forwarding support" in BSP 0.3. But it fails to successfully ping from swp0 to the remote host (in my case, it is 192.168.10.10). But I can ping from remote host to swp0.
Could you help to check the reason behind?
by printing the ip route table, there is entry exist for "192.168.10.0/24 ...." in the switch net name space.
[root@OpenIL-LS1028ARDB:~]# ip netns exec swns ip route
192.168.10.0/24 dev br0 proto kernel scope link src 192.168.10.100
Thanks,
My script is:
>>>>>>>>>>>>>>>>>>>>>
#!/bin/bash
#
# Simple switch configuration
#
# Assume both ENETC and Felix drivers are already loaded
#
BRIDGE=br0
MAC_ROOT=bc:8d:bf:7c:5b
SW_NETNS=swns
EXEC_SWNS="ip netns exec $SW_NETNS"
# Create bridge namespace
ip netns add $SW_NETNS
# Create bridge device in net namespace
$EXEC_SWNS ip link add name $BRIDGE type bridge
$EXEC_SWNS ip link set $BRIDGE up
# Configure switch ports
# * set MAC address
# * bring up interface
# * move net device into the bridge net namespace
# * set bridge device as master
swps=($(ls /sys/bus/pci/devices/0000:00:00.5/net/))
nr=${#swps[@]}
for (( i=0; i<$nr; i++ ))
do
echo "adding ${swps[$i]} to brigde .."
ip link set ${swps[$i]} address $MAC_ROOT:$(echo "${swps[$i]}" | tr -dc '0-9')
ip link set ${swps[$i]} netns $SW_NETNS
$EXEC_SWNS ip link set ${swps[$i]} master $BRIDGE
$EXEC_SWNS ip link set ${swps[$i]} up
done
# 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
# Check configuration
#$EXEC_SWNS bridge link show
# config IP address
$EXEC_SWNS ip addr add 192.168.10.100/24 dev br0