SONiC Quick Start: Install via ONIE in Minutes - 夜莺博客

SONiC Quick Start: Install via ONIE in Minutes

SONiC (Software for Open Networking in the Cloud) is the open-source, Linux-based network OS proven at hyperscale data centers, and installing it on a supported switch is surprisingly quick — the entire process happens from the ONIE bootloader with a handful of commands. This quick start guide, based on the official SONiC wiki, walks through downloading the right image, booting into ONIE, installing over HTTP, and the special case of installing on Arista hardware via Aboot, plus a note on how SONiC's ConfigDB works as the single source of truth.

Download the Right Image

SONiC publishes one image per ASIC vendor (Broadcom, Mellanox, Cavium, etc.). Download the image that matches your switch's ASIC — the wrong image simply will not boot. You can also build from source with sonic-buildimage.

Install via ONIE

Connect to the switch via serial console and boot into ONIE. If the switch ships with a proprietary NOS, first select ONIE: Uninstall OS, then reboot and select ONIE: Install OS:

GNU GRUB version 2.02~beta2+e4a1fe391
|*ONIE: Install OS    <----- Select this one
| ONIE: Rescue
| ONIE: Uninstall OS
| ONIE: Update ONIE
| ONIE: Embed ONIE

Configure a management IP and install from your HTTP server:

ONIE:/ # ifconfig eth0 192.168.0.2 netmask 255.255.255.0
ONIE:/ # ip route add default via 192.168.0.1
ONIE:/ # onie-nos-install http://192.168.2.10/sonic-broadcom.bin

When installation finishes, the switch reboots into SONiC. Log in with admin / YourPaSsWoRd on first login. If you see nothing on the console after reboot, remember the default SONiC console baud rate is 9600.

Installing SONiC on Arista Hardware

Arista switches use the Aboot bootloader and expect a SWI-format image. Install it the same way you would upgrade an EOS image:

eos#copy http://192.168.2.10/sonic-aboot-broadcom.swi flash:
eos(config)#boot system flash:sonic-aboot-broadcom.swi
eos(config)#reload

These steps also recover an Arista switch stuck in Aboot — for example, when the boot-config file was removed. In Aboot, use udhcpc or configure a static IP for network access.

How SONiC Configuration Works

SONiC manages configuration in a single source of truth — a Redis database instance called ConfigDB. Applications subscribe to ConfigDB and generate their running configuration accordingly, which is what enables the modular, containerized architecture (one container per protocol daemon). The old minigraph.xml method predates September 2017 and is kept only for historical reference.

To practice SONiC without hardware, see our SONiC configuration in GNS3 guide; for the switching side, compare with the MLNX-OS port types article and NVIDIA Air + Ansible automation walkthrough.

原文链接:https://github.com/sonic-net/SONiC/wiki/Quick-Start