can not ping remote host in Felix switch CPU mode with bridge-LSDK19.09-ls1028ardb

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

can not ping remote host in Felix switch CPU mode with bridge-LSDK19.09-ls1028ardb

Jump to solution
759 Views
yyu2
Contributor III

Hi,

I followed the instructions in LSDK19.09 chapter 8.6.3, but failed to ping 192.168.2.2 remote host from ls1028ardb.

The new namespace and br0's IP address are shown as below. (they should be correct). And I connected remote host (192.168.2.2) to the swp0.

Could you help to check what is the reason behind?

However, I can ping from remote host to ls1028ardb. Is that because gateway configurations are missing on ls1028ardb?

Best,   

   Yi

pastedImage_6.png

pastedImage_2.png

pastedImage_3.png

pastedImage_1.png

1 Solution
665 Views
yyu2
Contributor III

I finally solved it by configuring "swns" configurations and "br0" IP address setting into a batch file, which is executed after reboot the system. And especially, pay attention to "ip netns exec swns ping 192.168.2.2". Also, pay attention to NIC speed which should be 1Gbps.

View solution in original post

3 Replies
665 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Yi Yu,

Please run the following script to configure the L2Switch.

#!/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 bridge .."
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

Thanks,

Yiping

0 Kudos
665 Views
yyu2
Contributor III

Hi Yiping,

A strange phenomenon, I can ping successfully in ubuntu:mate environment, but can not ping successfully in ubuntu:devel environment. Could you help to check this?

Thanks,

   Yi

0 Kudos
666 Views
yyu2
Contributor III

I finally solved it by configuring "swns" configurations and "br0" IP address setting into a batch file, which is executed after reboot the system. And especially, pay attention to "ip netns exec swns ping 192.168.2.2". Also, pay attention to NIC speed which should be 1Gbps.