一、因为我只是需要操作ovsdb,所以对版本没什么要求,直接就用下面的方法安装了(有需要的可以去官网下载对应版本自己配置编译安装)
参考博客:最详细的Ubuntu+OVS安装使用教程_ubuntu20.04 open vswitch-CSDN博客
1、更新软件源
#sudo apt-get update
2、卸载bridge模块
rmmod bridge
3、安装openvswitch
#sudo apt-get install openvswitch-switch(这步我没出现问题)
4、验证
#sudo ovs-vsctl show
(这一步我报错了:xxxxx/db.sock: database connection failed (No such file or directory))
- 步骤四报错的解决方案如下:
按顺序执行下面命令:
ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \
--remote=db:Open_vSwitch,Open_vSwitch,manager_options \
--private-key=db:Open_vSwitch,SSL,private_key \
--certificate=db:Open_vSwitch,SSL,certificate \
--bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \
--pidfile --detach
ovs-vsctl --no-wait init
ovs-vswitchd --pidfile --detach