Skip to content

Commit

Permalink
Update SONiC docs (#53)
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
  • Loading branch information
matofeder authored Oct 7, 2024
1 parent cb8bfa8 commit 82b696f
Show file tree
Hide file tree
Showing 11 changed files with 224 additions and 7 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ outdated and refers to the depreciated SoNiC P4 Software switch image).
```bash
wget https://sonic.software/download-gns3a.sh
chmod +x download-gns3a.sh
./download-gns3a.sh <release number> # 202311
./download-gns3a.sh <release number> # master
```
* The above will download the latest image for the giver release number and create a GNS3 appliance file named e.g. `SONiC-202012-27914.gns3a`
* Note that the 202405 release of SONiC VS image is not working due to [#19399](https://github.com/sonic-net/sonic-buildimage/issues/19399)
* The release 202311 has also some bugs, like [#13317](https://github.com/sonic-net/sonic-buildimage/issues/13317) but works "better" then 202405 (if you can live without sonic-cli)
* The above will download the latest image for the giver release number and create a GNS3 appliance file named e.g. `SONiC-master-656617.gns3a`
* Note that you may observe some issues with the stable SONiC VS builds:
* `202405` release, e.g. [#19399](https://github.com/sonic-net/sonic-buildimage/issues/19399)
* `202311` release, e.g. [#13317](https://github.com/sonic-net/sonic-buildimage/issues/13317)
* Keep in mind that these and other issues may cause some unexpected behaviour of SONiC
* From this point you can follow the instructions provided in https://pine-networks.com/blog/setting-up-sonic-on-gns3/.
* Skip the initial instructions and start with the importing of appliance file you generated above e.g. `SONiC-202012-27914.gns3a`
* Skip the initial instructions and start with the importing of appliance file you generated above e.g. `SONiC-master-656617.gns3a`
* Once you import the SONiC image you can create a new project or open the existing one and start using the SONiC
appliance in GNS3 by dragging the SONiC appliance into the main window of your GNS3 project
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The setup includes three SONiC switches (Spine, Leaf1, Leaf2) with community ima

The guide also covers a basic BGP L3 underlay configuration using FRR.

![sonic-gns3-testbed.png](gns3-testbed.png)
![GNS3_basic.png](images/GNS3_basic.png)

## SONiC GNS3 testbed portable project

Expand Down Expand Up @@ -74,7 +74,7 @@ To walk through the configuration, follow the steps outlined below.
```
* Save the interfaces configuration by running `config save -y` after making changes
* Configure FRR BGP
* Find the FRR config files `leaf1_frr.conf`, `leaf2_frr.conf`, `spine_frr.conf`, and apply them as follows:
* Find the FRR config files `configs/leaf1_frr.conf`, `configs/leaf2_frr.conf`, `configs/spine_frr.conf`, and apply them as follows:
```bash
sudo cp <sonic-sw>_frr.conf /etc/sonic/frr/frr.conf
sudo chown 300:300 /etc/sonic/frr/frr.conf
Expand Down
75 changes: 75 additions & 0 deletions documentation/sonic/testbed/GNS3_bgp_unified.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# SONiC GNS3 testbed - unified FRR configuration

This tutorial walks you through setting up and configuring a testbed environment in the GNS3 simulation platform.
The setup includes just two SONiC switches (SW1, SW2) with community images and two PCs connected to them.

The guide also covers an unnumbered BGP L3 underlay configuration using unified FRR and BGP unnumbered.

![GNS3_basic.png](images/GNS3_bgp_unified.png)

## Prerequisites

* GNS3
* Select the installer for your favourite OS: https://www.gns3.com/software/download
* SONiC GNS3 appliance
* Follow instructions [here](../general.md#gns3-simulation-environment)
* The tutorial is intended to use SONiC community images. It was tested with community image SONiC master build 656617

## SONiC GNS3 configuration

* Drag and drop the SONiC switches and PCs, and wire them as shown in the architecture diagram
* Remove arbitrary config defaults
* The SONiC community image includes a default configuration that enables various ports and assigns arbitrary IP addresses
to them. Replace this configuration with another default setting that avoids arbitrary configurations.
For this purpose, we can use a predefined config template:
```bash
sudo su -
sonic-cfggen -H --preset l3 -k Force10-S6000 > /etc/sonic/config_db.json
config reload -y
```
* Configure switches
* Find the FRR unified config files `configs/sw1_frr_unified.json`, `configs/sw1_frr_unified.json`, and apply them as follows:
```bash
# copy <sonic-sw>_frr_unified.json file to the switch
sudo config load <sonic-sw>_frr_unified.json -y
docker restart bgp
# if you want to make the config persistent save it to the /etc/sonic.config_db.json
sudo config save -y
```
* Configure PC1 and PC2
* Configure PC's IP address and proper gateway
```text
PC1> ip 192.168.100.100/24 192.168.100.1
PC2> ip 192.168.200.100/24 192.168.200.1
```
## Validate the testbed
* Validate the interfaces' setup
* Connect to, for example, the switch 1 console (the default credential for login is admin/YourPaSsWoRd) and verify
the IPv6 link local mode is enabled for Ethernet4 (due to BGP unnumbered, for details read e.g. [this](https://support.edge-core.com/hc/en-us/articles/900002377366--Enterprise-SONiC-BGP-Unnumbered))
```yaml
$ show ipv6 link-local-mode | grep Enabled
| Ethernet4 | Enabled |
```
* Validate whether you see UP/UP state of connected interfaces via e.g. `$ show int status`
* Explore interfaces configuration via `show runningconfiguration interfaces` or via `sudo cat /etc/sonic/config_db.json`
* Validate the BGP configuration
* Connect to, for example, the Spine switch and verify the routes propagated by the BGP protocol
```bash
$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric,
> - selected route, * - FIB route, q - queued route, r - rejected route
C>*10.0.0.1/32 is directly connected, Loopback0, 03:02:15
B>*10.0.0.2/32 [20/0] via fe80::2047:61ff:feb2:b715, Ethernet4, 03:01:59
C>*10.1.0.1/32 is directly connected, Loopback0, 03:02:15
C>*192.168.100.0/24 is directly connected, Ethernet8, 03:02:15
B>*192.168.200.0/24 [20/0] via fe80::2047:61ff:feb2:b715, Ethernet4, 03:01:59
```
* Explore BGP configuration via `show runningconfiguration bgp`
* Open console of the PC1 or PC2 and try to `ping` the whole infrastructure
* SONiC switches should be reachable e.g. via its Loopback IPs and PC1 via 192.168.100.100 and PC2 via IP 192.168.200.100
File renamed without changes.
File renamed without changes.
File renamed without changes.
70 changes: 70 additions & 0 deletions documentation/sonic/testbed/configs/sw1_frr_unified.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"DEVICE_METADATA": {
"localhost": {
"docker_routing_config_mode": "unified",
"frr_mgmt_framework_config": "true",
"hostname": "sw1",
"mac": "0c:2e:02:80:00:01"
}
},
"INTERFACE": {
"Ethernet4": {
"ipv6_use_link_local_only": "enable"
},
"Ethernet8": {},
"Ethernet8|192.168.100.1/24": {}
},
"LOOPBACK_INTERFACE": {
"Loopback0": {},
"Loopback0|10.0.0.1/32": {},
"Loopback0|fd0c:cc24:75a0:1::1/128": {}
},
"BGP_GLOBALS": {
"default": {
"local_asn": "65001",
"log_nbr_state_changes": "true",
"router_id": "10.0.0.1"
}
},
"BGP_PEER_GROUP": {
"default|core": {
"peer_group_name": "core",
"admin_status": "true",
"asn": "external",
"peer_type": "external"
}
},
"BGP_NEIGHBOR": {
"default|Ethernet4": {
"peer_group_name": "core"
}
},
"BGP_NEIGHBOR_AF": {
"default|core|ipv4_unicast": {
"admin_status": "true",
"route_map_in": [
"ALLOW"
],
"route_map_out": [
"ALLOW"
]
},
"default|core|ipv6_unicast": {
"admin_status": "true",
"route_map_in": [
"ALLOW"
],
"route_map_out": [
"ALLOW"
]
}
},
"ROUTE_MAP": {
"ALLOW|1": {
"route_operation": "permit"
}
},
"ROUTE_REDISTRIBUTE": {
"default|connected|bgp|ipv4": {}
}
}
70 changes: 70 additions & 0 deletions documentation/sonic/testbed/configs/sw2_frr_unified.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"DEVICE_METADATA": {
"localhost": {
"docker_routing_config_mode": "unified",
"frr_mgmt_framework_config": "true",
"hostname": "sw2",
"mac": "0c:2e:02:80:00:02"
}
},
"INTERFACE": {
"Ethernet4": {
"ipv6_use_link_local_only": "enable"
},
"Ethernet8": {},
"Ethernet8|192.168.200.1/24": {}
},
"LOOPBACK_INTERFACE": {
"Loopback0": {},
"Loopback0|10.0.0.2/32": {},
"Loopback0|fd0c:cc24:75a0:1::2/128": {}
},
"BGP_GLOBALS": {
"default": {
"local_asn": "65002",
"log_nbr_state_changes": "true",
"router_id": "10.0.0.2"
}
},
"BGP_PEER_GROUP": {
"default|core": {
"peer_group_name": "core",
"admin_status": "true",
"asn": "external",
"peer_type": "external"
}
},
"BGP_NEIGHBOR": {
"default|Ethernet4": {
"peer_group_name": "core"
}
},
"BGP_NEIGHBOR_AF": {
"default|core|ipv4_unicast": {
"admin_status": "true",
"route_map_in": [
"ALLOW"
],
"route_map_out": [
"ALLOW"
]
},
"default|core|ipv6_unicast": {
"admin_status": "true",
"route_map_in": [
"ALLOW"
],
"route_map_out": [
"ALLOW"
]
}
},
"ROUTE_MAP": {
"ALLOW|1": {
"route_operation": "permit"
}
},
"ROUTE_REDISTRIBUTE": {
"default|connected|bgp|ipv4": {}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 82b696f

Please sign in to comment.