OVN简单部署

部署OVN实验环境

网络拓扑

### Central节点
# cat ifcfg-eth0
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
NAME=eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=192.168.30.100
NETMASK=255.255.255.0
GATEWAY=192.168.30.2
DNS1=114.114.114.114

### Node节点
# cat ifcfg-eth0
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
NAME=eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=192.168.30.101
NETMASK=255.255.255.0
GATEWAY=192.168.30.2
DNS1=114.114.114.114

安装软件包

### Central节点
# wget -O /etc/yum.repos.d/ovs.repo https://copr.fedorainfracloud.org/coprs/leifmadsen/ovs-stable-release/repo/epel-7/leifmadsen-ovs-stable-release-epel-7.repo
# yum install -y openvswitch-ovn-central.x86_64 openvswitch-ovn-host.x86_64
# systemctl enable ovn-northd openvswitch ovn-controller
# systemctl start ovn-northd ovn-controller
### 关闭防火墙和SELINUX
# systemctl stop firewalld
# systemctl disable firewalld

### Node节点
# wget -O /etc/yum.repos.d/ovs.repo https://copr.fedorainfracloud.org/coprs/leifmadsen/ovs-stable-release/repo/epel-7/leifmadsen-ovs-stable-release-epel-7.repo
# yum install -y openvswitch.x86_64 openvswitch-ovn-host.x86_64
# systemctl enable openvswitch ovn-controller
# systemctl start ovn-controller
### 关闭防火墙和SELINUX
# systemctl stop firewalld
# systemctl disable firewalld

配置OVN

### Central节点
# ovn-nbctl set-connection ptcp:6641:192.168.30.100
# ovn-sbctl set-connection ptcp:6642:192.168.30.100
# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd
tcp        0      0 192.168.30.100:6641     0.0.0.0:*               LISTEN      1488/ovsdb-server
tcp        0      0 192.168.30.100:6642     0.0.0.0:*               LISTEN      1496/ovsdb-server
# ovs-vsctl set open . external-ids:ovn-remote=tcp:192.168.30.100:6642
# ovs-vsctl set open . external-ids:ovn-encap-type=geneve
# ovs-vsctl set open . external-ids:ovn-encap-ip=192.168.30.100
# netstat -antp | grep ovn-controller
tcp        0      0 192.168.30.100:38926    192.168.30.100:6642     ESTABLISHED 1482/ovn-controller

### Node节点
# ovs-vsctl set open . external-ids:ovn-remote=tcp:192.168.30.100:6642
# ovs-vsctl set open . external-ids:ovn-encap-type=geneve
# ovs-vsctl set open . external-ids:ovn-encap-ip=192.168.30.101
# netstat -antp | grep ovn-controller
tcp        0      0 192.168.30.101:42020    192.168.30.100:6642     ESTABLISHED 1484/ovn-controller
posted @ 2017-10-14 11:22  银魔术师  阅读(1756)  评论(0编辑  收藏  举报