diff --git a/documentation/sonic/FAQ_SONiC.md b/documentation/sonic/FAQ.md similarity index 100% rename from documentation/sonic/FAQ_SONiC.md rename to documentation/sonic/FAQ.md diff --git a/documentation/sonic/SONiC_Testing.md b/documentation/sonic/Testing.md similarity index 87% rename from documentation/sonic/SONiC_Testing.md rename to documentation/sonic/Testing.md index b552e919..4fcb1a16 100644 --- a/documentation/sonic/SONiC_Testing.md +++ b/documentation/sonic/Testing.md @@ -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 # 202311 + ./download-gns3a.sh # 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 diff --git a/documentation/sonic/testbed/gns3-testbed.md b/documentation/sonic/testbed/GNS3_bgp_basic.md similarity index 97% rename from documentation/sonic/testbed/gns3-testbed.md rename to documentation/sonic/testbed/GNS3_bgp_basic.md index cdd47c7f..8358a4f1 100644 --- a/documentation/sonic/testbed/gns3-testbed.md +++ b/documentation/sonic/testbed/GNS3_bgp_basic.md @@ -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 @@ -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 _frr.conf /etc/sonic/frr/frr.conf sudo chown 300:300 /etc/sonic/frr/frr.conf diff --git a/documentation/sonic/testbed/GNS3_bgp_unified.md b/documentation/sonic/testbed/GNS3_bgp_unified.md new file mode 100644 index 00000000..b78068c4 --- /dev/null +++ b/documentation/sonic/testbed/GNS3_bgp_unified.md @@ -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 _frr_unified.json file to the switch + sudo config load _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 diff --git a/documentation/sonic/testbed/leaf1_frr.conf b/documentation/sonic/testbed/configs/leaf1_frr.conf similarity index 100% rename from documentation/sonic/testbed/leaf1_frr.conf rename to documentation/sonic/testbed/configs/leaf1_frr.conf diff --git a/documentation/sonic/testbed/leaf2_frr.conf b/documentation/sonic/testbed/configs/leaf2_frr.conf similarity index 100% rename from documentation/sonic/testbed/leaf2_frr.conf rename to documentation/sonic/testbed/configs/leaf2_frr.conf diff --git a/documentation/sonic/testbed/spine_frr.conf b/documentation/sonic/testbed/configs/spine_frr.conf similarity index 100% rename from documentation/sonic/testbed/spine_frr.conf rename to documentation/sonic/testbed/configs/spine_frr.conf diff --git a/documentation/sonic/testbed/configs/sw1_frr_unified.json b/documentation/sonic/testbed/configs/sw1_frr_unified.json new file mode 100644 index 00000000..59b1973b --- /dev/null +++ b/documentation/sonic/testbed/configs/sw1_frr_unified.json @@ -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": {} + } +} \ No newline at end of file diff --git a/documentation/sonic/testbed/configs/sw2_frr_unified.json b/documentation/sonic/testbed/configs/sw2_frr_unified.json new file mode 100644 index 00000000..ec1e79ac --- /dev/null +++ b/documentation/sonic/testbed/configs/sw2_frr_unified.json @@ -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": {} + } +} \ No newline at end of file diff --git a/documentation/sonic/testbed/gns3-testbed.png b/documentation/sonic/testbed/images/GNS3_bgp_basic.png similarity index 100% rename from documentation/sonic/testbed/gns3-testbed.png rename to documentation/sonic/testbed/images/GNS3_bgp_basic.png diff --git a/documentation/sonic/testbed/images/GNS3_bgp_unified.png b/documentation/sonic/testbed/images/GNS3_bgp_unified.png new file mode 100644 index 00000000..28993168 Binary files /dev/null and b/documentation/sonic/testbed/images/GNS3_bgp_unified.png differ