03 Ethernet
1 Ethernet Interface Overview
GM-3568JHF development board is equipped with 2 Gigabit Ethernet interfaces, implemented based on the integrated Ethernet controller of RK3568J processor, supporting high-speed network communication and multi-network environment applications.
| Interface | Type | Device Name | Interface Standard | Max Rate | Description |
|---|---|---|---|---|---|
| ETH0 | RGMII | end0 | IEEE 802.3 | 1000Mbps | Primary Ethernet interface, default network card |
| ETH1 | RGMII | end1 | IEEE 802.3 | 1000Mbps | Secondary Ethernet interface |
2 Network Connectivity Test
- ETH0 RGMII: end0, default network card, usually used for primary network connection
- ETH1 RGMII: end1, secondary network card, can be used for network redundancy or isolation
- Connection Method: Use an Ethernet cable to connect the corresponding network port of the development board and the PC to the same router or switch.
Enter the file system and execute the following command to get the IP and view the network port configuration information.
root@linaro-alip:/# ifconfig
end0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.49.176 netmask 255.255.255.0 broadcast 192.168.49.255
inet6 fe80::561a:9e84:b5bd:20d7 prefixlen 64 scopeid 0x20<link>
ether 32:b0:e6:11:eb:7e txqueuelen 1000 (Ethernet)
RX packets 3236 bytes 236287 (230.7 KiB)
RX errors 0 dropped 569 overruns 0 frame 0
TX packets 745 bytes 63449 (61.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 69
end1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 36:b0:e6:11:eb:7e txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 67Execute the following command to test whether the network port connection to the external network is normal, taking visiting "www.baidu.com" as an example. "-I" specifies the network port, if "-I" is not added, the default network card is used. You can press "Ctrl + C" to terminate the ping command.
root@linaro-alip:/# ping www.baidu.com -I end0
PING www.a.shifen.com (183.2.172.42) 56(84) bytes of data.
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=1 ttl=50 time=9.28 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=2 ttl=50 time=8.77 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=3 ttl=50 time=8.65 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=4 ttl=50 time=8.83 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=5 ttl=50 time=8.63 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=6 ttl=50 time=8.73 ms
--- www.a.shifen.com ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5007ms
rtt min/avg/max/mdev = 8.630/8.813/9.275/0.216 ms
root@linaro-alip:/# ping www.baidu.com -I end1
PING www.a.shifen.com (183.2.172.42) 56(84) bytes of data.
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=1 ttl=50 time=8.35 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=2 ttl=50 time=8.88 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=3 ttl=50 time=9.07 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=4 ttl=50 time=8.91 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=5 ttl=50 time=8.67 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=6 ttl=50 time=8.66 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=7 ttl=50 time=8.78 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=8 ttl=50 time=8.41 ms
--- www.a.shifen.com ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7011ms
rtt min/avg/max/mdev = 8.352/8.716/9.068/0.230 ms3 TCP Bandwidth Test
1) Server Side
Connect the development board to the Internet and install the iperf3 tool, executing the following commands:
root@linaro-alip:/# sudo apt update
root@linaro-alip:/# sudo apt install iperf3The development board acts as the server, executing the following command:
root@linaro-alip:/# iperf3 -s
-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------2) Client Side
The iperf3 tool for Windows can be obtained from the test toolkit.
Open PowerShell in Windows, enter the path where the iperf3 tool is located, and use Windows as the client to send data by executing the following command:
.\iperf3.exe -c 192.168.137.149 // 192.168.137.149 is the server IP address3) Test Results
- Server Side
root@linaro-alip:/# iperf3 -s
-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------
Accepted connection from 192.168.49.85, port 53618
[ 5] local 192.168.49.245 port 5201 connected to 192.168.49.85 port 53619
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 112 MBytes 936 Mbits/sec
[ 5] 1.00-2.00 sec 112 MBytes 937 Mbits/sec
[ 5] 2.00-3.00 sec 112 MBytes 939 Mbits/sec
[ 5] 3.00-4.00 sec 112 MBytes 938 Mbits/sec
[ 5] 4.00-5.00 sec 112 MBytes 937 Mbits/sec
[ 5] 5.00-6.00 sec 111 MBytes 931 Mbits/sec
[ 5] 6.00-7.00 sec 111 MBytes 929 Mbits/sec
[ 5] 7.00-8.00 sec 111 MBytes 930 Mbits/sec
[ 5] 8.00-9.00 sec 111 MBytes 933 Mbits/sec
[ 5] 9.00-10.00 sec 111 MBytes 929 Mbits/sec
[ 5] 10.00-10.00 sec 265 KBytes 885 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate
[ 5] 0.00-10.00 sec 1.09 GBytes 934 Mbits/sec receiver
------------------------------------------------------------ Client Side

4 Advanced Network Configuration
4.1 Static IP Configuration
1) Temporary Configuration (Lost after Reboot)
# Configure ETH0 static IP
sudo ifconfig end0 192.168.1.100 netmask 255.255.255.0 up
# Add default gateway
sudo route add default gw 192.168.1.1 end0
# Configure DNS
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf2) Permanent Configuration
Edit network configuration file:
# Edit network interface configuration
sudo nano /etc/network/interfaces
# Add the following content
auto end0
iface end0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4
auto end1
iface end1 inet static
address 192.168.2.100
netmask 255.255.255.04.2 Network Bridge Configuration
Create a network bridge to bridge two network ports:
# Install bridge tool
sudo apt-get install bridge-utils
# Create bridge
sudo brctl addbr br0
# Add network ports to bridge
sudo brctl addif br0 end0
sudo brctl addif br0 end1
# Enable bridge
sudo ifconfig br0 up
# Configure bridge IP
sudo ifconfig br0 192.168.1.100 netmask 255.255.255.04.3 VLAN Configuration
Configure VLAN for network isolation:
# Install VLAN tool
sudo apt-get install vlan
# Load 8021q module
sudo modprobe 8021q
# Create VLAN interfaces
sudo vconfig add end0 100
sudo vconfig add end0 200
# Configure VLAN interface IP
sudo ifconfig end0.100 192.168.100.1 netmask 255.255.255.0 up
sudo ifconfig end0.200 192.168.200.1 netmask 255.255.255.0 up5 Network Monitoring and Diagnosis
5.1 Network Status Monitoring
# View network interface statistics
cat /proc/net/dev
# View network connection status
netstat -tuln
# View routing table
route -n
# View ARP table
arp -a
# Real-time monitoring of network traffic
sudo iftop -i end05.2 Network Performance Test
1) Bandwidth Test
# Server side (Development board)
iperf3 -s -p 5201
# Client side (PC)
iperf3 -c 192.168.1.100 -p 5201 -t 30 -i 1
# UDP Test
iperf3 -c 192.168.1.100 -u -b 1000M -t 102) Latency Test
# Ping test
ping -c 100 -i 0.01 192.168.1.1
# High-precision test using hping3
sudo hping3 -c 1000 -i u100 192.168.1.15.3 Network Packet Capture Analysis
# Install tcpdump
sudo apt-get install tcpdump
# Capture packets on specified interface
sudo tcpdump -i end0 -w capture.pcap
# View packets in real-time
sudo tcpdump -i end0 -n
# Filter specific protocols
sudo tcpdump -i end0 tcp port 806 Troubleshooting
1) Network Port Connection Failure
Check Steps:
# Check interface status
sudo ethtool end0
# Check cable connection
sudo ethtool end0 | grep "Link detected"
# Check driver loading
lsmod | grep stmmac
# Restart network service
sudo systemctl restart networking2) Slow Network Speed
Possible Causes and Solutions:
# Check negotiation speed
sudo ethtool end0 | grep Speed
# Force Gigabit speed
sudo ethtool -s end0 speed 1000 duplex full autoneg off
# Check network congestion
sudo netstat -i
# Optimize network parameters
echo 1 > /proc/sys/net/ipv4/tcp_window_scaling3) Packet Loss
Diagnosis and Solution:
# View packet loss statistics
cat /proc/net/dev | grep end0
# Check network backlog
cat /proc/sys/net/core/netdev_max_backlog
# Increase backlog size
echo 5000 > /proc/sys/net/core/netdev_max_backlog4) IP Conflict
Solution:
# Check IP conflict
sudo arping -D -I end0 192.168.1.100
# Release and renew IP
sudo dhclient -r end0
sudo dhclient end0