🛠 Piloter le Pi 2 en SSH et stabiliser son réseau

Raspberry Pi 2 Model B (2015) — Board Sheet · intermediaire · Schéma : IMG-model-2b-intermediaire-3-model2b-ssh-reseau.svg — Raspberry Pi 2 Model B relié en Ethernet 100 Mbps au routeur, ordinateur portable connecté en SSH, adresse MAC épinglée

Objectives

Install and secure SSH access to the Raspberry Pi 2, understand its network specifics (10/100 Ethernet via the LAN9514 combo chip, no built-in WiFi), and fix the known issue on v1.2 boards: the random MAC address on every boot, which breaks DHCP leases and firewall rules.

Hardware

Complete code

# 1. Activer SSH : sudo raspi-config -> Interface -> SSH -> Oui
#    (sur l'image neuve : creer un fichier vide nomme ssh dans la partition boot)
sudo systemctl enable --now ssh

# 2. Recuperer l'adresse IP obtenue par DHCP
ip -4 addr show eth0 | grep inet

# 3. Cartes v1.2 : epingler une MAC fixe (sinon elle change a chaque boot)
MAC="b8:27:eb:12:34:56"
sudo sed -i "s/\s*rootwait/& smsc95xx.macaddr=${MAC}/" /boot/cmdline.txt
sudo reboot

# 4. Apres redemarrage : verifier puis se connecter depuis un autre poste
ip link show eth0 | grep ether
ssh pi@192.168.1.50

# 5. Debit maximal attendu (bus USB 2.0 partage, Ethernet 100 Mbps)
iperf3 -c 192.168.1.10

Expected verification

After activation, sshd is running (systemctl status ssh) and the connection succeeds from the other machine. After applying the macaddr fix, the same MAC address reappears on every reboot and the DHCP lease remains stable. iperf3 should approach 90 Mbit/s: this is the hardware limit of the 100 Mbps link and the shared USB bus, not a defect.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials