splithorizon · SONiC on GNS3
Download SVG
Download PNG
splithorizon
FIELD NOTES · DISAGGREGATED NETWORKING
Getting started with
SONiC on GNS3
SONiC 202311 · GNS3 2.2.x
Paul Carvill · CCIE #16661 Emeritus
splithorizon.cloud
Open-source NOS simulation — full containerised daemon stack, no hardware required
WHAT IS SONIC
SONiC
(Software for Open Networking in the Cloud) is Microsoft's open-source NOS, born from the Azure
merchant-silicon fleet. It runs on any ASIC with a SAI driver — Broadcom, NVIDIA/Mellanox, Intel/Barefoot.
The architecture separates the control plane into containerised daemons (bgpd, lldpd, snmpd, syncd)
communicating over a central Redis database. The VS image swaps the ASIC for a software dataplane —
every daemon, CLI command, and config workflow is authentic. What you test here runs on real iron.
PREREQUISITES
SOFTWARE
GNS3 2.2.x
Server + GUI. GNS3 VM recommended for stable QEMU on any host OS.
SONiC VS image
Download
sonic-vs.img.gz
from
sonic.software
Image format conversion
Convert
.img.gz
→
.qcow2
before importing to GNS3 QEMU template.
QEMU/KVM
GNS3 VM
202311 stable
HARDWARE & HOST
RAM — ~2 GB per SONiC node
Plan your topology before adding devices. A 3-node spine-leaf needs ~6 GB available.
Virtualisation
KVM/QEMU on Linux preferred. GNS3 VM on ESXi is ideal for nested virt.
Adapter type — virtio only
Must set virtio in QEMU template. e1000 causes interface mapping failures.
Linux KVM
ESXi + VM
IMAGE PREPARATION
bash · GNS3 VM
# step 1 — decompress
gunzip
sonic-vs.img.gz
# step 2 — convert to qcow2
qemu-img convert \
-f
raw
-O
qcow2 \
sonic-vs.img \
sonic-vs.qcow2
# step 3 — verify (expect ~4–5 GB qcow2)
qemu-img info
sonic-vs.qcow2
# format: qcow2 virtual size: ~4.5G
# Then: GNS3 → Preferences → QEMU VMs → New → upload
GNS3 QEMU TEMPLATE
1
Preferences → QEMU VMs → New
Upload the qcow2 to GNS3 server images folder
2
RAM 2048 MB · vCPUs 2 · Adapter: virtio
Never use e1000 — interface mapping will break
3
Console type = telnet · boot headless
Default creds: admin / YourPaSsWoRd (202311+)
4
Wait for docker ps — all containers Up
Takes 60–90 s after boot. Don't configure before this.
5
Configure interfaces · save config
sudo config save -y
→ persists to config_db.json
ARCHITECTURE OVERVIEW
GNS3 · QEMU · virtio interfaces
bgpd
FRRouting container
lldpd
discovery container
snmpd
monitoring container
syncd
SAI proxy container
teamd / natd
LAG / NAT containers
Redis · CONFIG_DB · APP_DB · STATE_DB · ASIC_DB · COUNTER_DB
SAI interface · VS software switch
Linux kernel dataplane · vs datapath
syncd translates ASIC_DB writes to SAI calls — in VS mode this targets the kernel software switch, not real silicon.
ESSENTIAL CLI
interface config
# bring up interface
sudo config interface startup
Ethernet0
# assign IP address
sudo config interface ip add
Ethernet0
10.0.0.0/31
sudo config save -y
vtysh — FRRouting BGP config
sudo vtysh
router bgp
65001
bgp router-id
10.0.0.1
neighbor
10.0.0.0
remote-as
65000
address-family ipv4 unicast
network
192.168.1.0/24
exit-address-family
VERIFICATION
show interfaces status
Port state, speed, MTU
show ip bgp summary
BGP peer state + prefix count
show ip route
FIB — kernel + BGP routes
show arp
ARP table — confirm L2 reachability
docker ps
All containers should show Up
debugging
# watch BGP convergence
watch -n1
"show ip bgp sum"
# tail syncd logs
docker logs -f
syncd
# inspect ASIC_DB routes
redis-cli -n 1
KEYS
"ROUTE_ENTRY*"
# reload without reboot
sudo config reload -y
COMMON PITFALLS
Interface naming
GNS3 adapters map to Ethernet0, Ethernet4…
in steps of 4. Sequential numbering doesn't exist.
e0→Ethernet0 e1→Ethernet4 e2→Ethernet8
Config persistence
SONiC VS does not auto-save. Always run
config save -y
before snapshot or reboot.
No hardware offload
VS dataplane is pure software. ACLs and QoS
work logically. Don't benchmark throughput.
Default credentials changed
202311+:
admin / YourPaSsWoRd
Older builds:
admin / admin
Docker startup time
All containers take ~60–90 s to come up. Run
docker ps
and wait for all to show Up.
QEMU adapter type
virtio
only — set during template creation.
e1000
breaks interface mapping completely.
splithorizon
SONiC on GNS3 — getting started · SONiC 202311 · GNS3 2.2.x
Paul Carvill · CCIE #16661 Emeritus · splithorizon.io