🛠 Use Case: Configure a File Server and Network Router
Objectives
This tutorial guides beginners in configuring the BPI-5202 as an industrial gateway. We will leverage its two independent network interfaces (1x 1000M and 1x 100M) to isolate field and management networks, while using SSD storage for local data hosting. This use case highlights the reliability of the LoongArch architecture and integrated hardware security.
Required Hardware
- BPI-5202 Loongson 2K1000LAi Board
- Compliant DC 24V Power Supply (isolated output available for peripherals)
- Compatible SSD (formatted as ext4)
- Two Cat5e or higher Ethernet cables
- HDMI display or console access via isolated RS232 port
- Pre-installed OS (Loongnix, LoongOS, or KylinOS V10)
Steps
- Storage Preparation: Insert the SSD into the dedicated connector. Boot the board and access the terminal via HDMI or RS232. Identify the disk with
lsblk. Format the target partition if necessary withmkfs.ext4 /dev/sda1, then mount it:mount /dev/sda1 /mnt/data. Add an entry to/etc/fstabfor automatic mounting at boot.
- Network Interface Configuration: The BPI-5202 has two distinct Ethernet ports. Edit the network configuration file (e.g.,
/etc/network/interfacesor via NetworkManager depending on the distribution). Assign a static IP to the 1000M port (management network, e.g.,192.168.1.10) and a different IP to the 100M port (field network, e.g.,10.0.0.1). Enable IP routing withsysctl -w net.ipv4.ip_forward=1to allow communication between the two segments if needed.
- Security and Encryption: Activate hardware security features provided by SMEC98SP and SC1161Y chips. For beginners, ensure the firewall is active. Use
iptablesorfirewalldto block all incoming traffic on the 100M port from the management network, except for specific ports (SSH, HTTP). This protects connected industrial equipment.
- Install a Sharing Service: Install a simple file server like Samba or NFS. For Samba:
apt install samba(or equivalent depending on OS). Configure/etc/samba/smb.confto share the/mnt/datafolder. Restart the service:systemctl restart smbd. The share is now accessible from other machines on the management network.
Verification
- Check network connectivity:
ping 192.168.1.10from a PC connected to the 1000M port. - Test share access: From another PC, try accessing the shared folder via file explorer or command line.
- Verify storage persistence: Reboot the board and ensure
/mnt/datais automatically mounted usingdf -h. - Check routing: If enabled, verify traffic passes between interfaces using
tcpdump.
Further Reading
Explore the 20-pin GPIO extension to connect IO modules (DI/DO) and automate tasks based on network data. Test the CAN2.0 ports to interface with Programmable Logic Controllers (PLCs). Finally, evaluate the performance of the Loongson 2K1000LAi processor under heavy network load to validate its suitability for your specific industrial needs.