Skip to content

Quick Start

Yanzhao Zhang edited this page May 3, 2023 · 9 revisions

Description

This guide details the steps to install a SONiC image on your supported switch.

Download Image

We have one SONiC Image per ASIC vendor. You can download SONiC Image here

You can also build SONiC from source and the instructions can be found here.

Installation

Install SONiC ONIE Image

  1. Connect to switch via serial console.

  2. (Optional) Some switches may come with a NOS which will require you to uninstall the existing NOS first before you install SONiC. To do so, simply boot into ONIE and select Uninstall OS:

                         GNU GRUB  version 2.02~beta2+e4a1fe391
     +----------------------------------------------------------------------------+
     |*ONIE: Install OS                                                           | 
     | ONIE: Rescue                                                               |
     | ONIE: Uninstall OS  <----- Select this one                                 |
     | ONIE: Update ONIE                                                          |
     | ONIE: Embed ONIE                                                           |
     +----------------------------------------------------------------------------+
    
          Use the ^ and v keys to select which entry is highlighted.          
          Press enter to boot the selected OS, `e' to edit the commands       
          before booting or `c' for a command-line.                           
    
  3. Reboot the switch into ONIE and select 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                                                           |
     +----------------------------------------------------------------------------+
    
          Use the ^ and v keys to select which entry is highlighted.          
          Press enter to boot the selected OS, `e' to edit the commands       
          before booting or `c' for a command-line.                           
    
  4. Install SONiC. Here, we assume you have uploaded SONiC image onto a http server (192.168.2.10). Once you are in ONIE, you can first configure a management IP (192.168.0.2/24)and default gateway (192.168.0.1) for your switch, and then install the SONiC image from the 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
    

Note: There are many options to install SONiC ONIE image on a ONIE-enabled switch. For more installation options, visit the ONIE Quick Start Guide.

When NOS installation finishes, the box will reboot into SONiC by default.

                    GNU GRUB  version 2.02~beta2+e4a1fe391

+----------------------------------------------------------------------------+
|*SONiC-OS-7069cef                                                           | 
| ONIE                                                                       | 
+----------------------------------------------------------------------------+

SONiC Login prompt. Use username admin and password YourPaSsWoRd to login for the first time.

Debian GNU/Linux 8 sonic ttyS0

sonic login: 

Note: By default, the SONiC console baud rate is 9600. You may need to change the baud rate in case you cannot see anything from the console after reboot.

SONiC Welcome Message of the Day:

You are on
  ____   ___  _   _ _  ____
 / ___| / _ \| \ | (_)/ ___|
 \___ \| | | |  \| | | |
  ___) | |_| | |\  | | |___
 |____/ \___/|_| \_|_|\____|

-- Software for Open Networking In the Cloud --

Unauthorized access and/or use are prohibited.
All access and/or use are subject to monitoring.

admin@sonic:~$ 

Install SONiC on Arista hardware

  • This section is only applicable if you plan to install SONiC on Arista switches.

Installing SONiC on Arista hardware uses the same steps you would use to upgrade a normal EOS image. Arista has its own bootloader called Aboot. It expects an image in the SWI format which is a different packaging mechanism than the one used by ONIE. The SWI image to use depends on the switching asic used. Refer to this list.

Download the appropriate SONiC SWI image on the box, select to boot from the image and then reload the box.

eos#copy http://192.168.2.10/sonic-aboot-broadcom.swi flash:
Copy completed successfully.
eos(config)#boot system flash:sonic-aboot-broadcom.swi
eos(config)#reload
System configuration has been modified. Save? [yes/no/cancel/diff]:no
Proceed with reload? [confirm] [type enter]

Broadcast message from root@eos
        (unknown) at 8:22 ...

..... (boot messages)


Debian GNU/Linux 8 sonic ttyS0

sonic login:

Alternatively this operation can be done from EOS bash shell.

eos#bash
bash# cd /mnt/flash
bash# wget http://192.168.2.10/sonic-aboot-broadcom.swi
bash# sed -Ei 's/SWI=.*/SWI=flash:sonic-aboot-broadcom.swi/' boot-config
bash# reboot

... (boot messages)

sonic login:

These same steps can be used to recover an Arista switch stuck in Aboot via the console. This can happen if the image was broken or the boot-config file inadvertently removed. For network configuration in Aboot either use udhcpc or add a static IP address.

Configuration

SONiC is managing configuration in a single source of truth - a redisDB instance that we refer as ConfigDB. Applications subscribe to ConfigDB and generate their running configuration correspondingly.

Details about ConfigDB and schema design, please find it here

Before Sep 2017, we were using an XML file named minigraph.xml to configure SONiC devices. For historical documentation, please refer to Configuration with Minigraph

Command line

SONiC includes commands that allow user to show platform, transceivers, L2, IP, BGP status, etc.

Clone this wiki locally