SONiC全名Software for Open Networking in the Cloud,是微软在2016年开源的网络操作系统,主要用于数据中心交换机。就是一种可以运行在多家网络设备上的开放操作系统。
搭建SONiC
下面我们看看SONiC的直观体验,参照https://github.com/Azure/SONiC/wiki/SONiC-P4-Software-Switch, 我们可以实验一下在Linux 虚机上安装和体验SONiC。下载解压后,你会看到:
vm-h2:~/SONiC/p4-test$ ls
install_docker_ovs.sh load_image.sh start.sh stop.sh switch1 switch2 test.sh
其中install_docker_ovs.sh 是安装docker 和ovs,我的VM里都已经安装了,就不用运行这个脚本。
load_image.sh 是生成docker image, 运行完以后,你就可以看到这个image. 这个image 存在本地,不会同步到Dockerhub.
vm-h2:~/SONiC/p4-test$ sudo docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
docker-sonic-p4 latest e60259575b99 5 days ago 449MB
ubuntu-ip latest 26965696497a 4 weeks ago 273MB
ubuntu latest c9d990395902 20 months ago 113MB
start.sh 就是启动docker, 构建实验环境,建立的拓扑如下图
![6346c3ccee57b0fd1eb13ae009fc25a5.png](https://img-blog.csdnimg.cn/img_convert/6346c3ccee57b0fd1eb13ae009fc25a5.png)
看看host1:
vm-h2:~/SONiC/p4-test$ sudo docker exec host1 ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue