🛠 Gigabit Ethernet natif et administration à distance en SSH
Objectives
Leverage the major new feature of the Pi 4B: native Gigabit Ethernet in the SoC (dedicated RGMII link to a Broadcom PHY), much faster than the 300 Mbit/s limit imposed by USB on the 3B+. Configure the network, measure the actual throughput, and administer the board via SSH without a screen.
Hardware
- Raspberry Pi 4B (2 GB or more recommended), RJ45 cable, box/router
- Official 5.1 V 3 A power supply
- A computer with an SSH client
Complete code
# Cote Pi : activer SSH (sudo raspi-config -> Interface Options -> SSH) puis :
ip -br addr # noter l'IP de eth0
sudo apt install ethtool iperf3
sudo ethtool eth0 # Speed: 1000Mb/s attendu
# Benchmark (serveur iperf3 -s sur un PC du meme reseau) :
iperf3 -c 192.168.1.10 # viser ~940 Mbit/s
# Cote PC : connexion et cles
ssh pi@192.168.1.50
ssh-copy-id pi@192.168.1.50 # authentification par cle
scp rapport.txt pi@192.168.1.50:~/
Expected verification
ethtool indicates Speed: 1000Mb/s; iperf3 approaches 940 Mbit/s upstream and downstream, the signature of native GbE (the 3B+ caps out at ~300). After ssh-copy-id, the SSH connection succeeds without a password.
Common errors
- Expecting throughput over Wi-Fi: the Pi's 802.11ac is only class 120 Mb/s, plug in the RJ45.
- Relying on a dynamic IP that changes: reserve the address on the router (static DHCP lease).
- Weak power supply: below 4.63 V the undervoltage detector triggers, causing throttling and SD card corruption.
- Forgetting to enable SSH before unplugging the screen: you then need a screen or to rewrite the SD card.
- Not changing the default password before exposing the machine.
Other tutorials for this board
Code examples for this board
led_blink.pyPythonbutton_led.pyPythonservo_sweep.pyPythondht_temp.pyPythonoled_i2c.pyPythonmcp3008_read.pyPython