openvswitch安装部署
1.进入/etc/yum.repos.d/(存储yum源的路径)
cd /etc/yum.repos.d/
2.查看包信息并修改包格式(以便还原包)
ls
mv -f CentOS-Base.repo CentOS-base.repo.bak
3.下载阿里云数据包(curl -O大写字母O)
curl -O http://mirrors.aliyun.com/repo/Centos-7.repo
curl -O http://mirrors.aliyun.com/repo/epel-7.repo
4.清除yum源缓存,下载新缓存
yum clean all
yum makecache
5.下载安装centos-release-openstack-queens包
yum -y install centos-release-openstack-queens
6.查看yum源是否有openvswitch包并安装
yum list | grep openvswitch
yum -y install openvswitch
7.启动openvswtich并设为开机自启(到这步openvswitch就安装完了)
systemctl start openvswitch.service
systemctl enable openvswitch.service
ovs网桥配置
1.更新内核(大概需要10分钟)
yum update -y
2.添加网卡模式为nat
ifconfig (显示网络设备)
新添加的网卡一般也为ens开头具体看系统分配,我这是ens37
3.通过ovs-vsctl新建网桥share,将网卡2添加到share网桥中并查看 ,ovs-vsctl是用于查询和更新ovs-vswitchd的配置的使用工具
配置:
ovs-vsctl add-br share
ovs-vsctl add-port share ens37
查看:
ovs-vsctl show
ovs-vsctl list-br
ovs-vsctl list-ports share