OVN启动 ovn-central 和 ovn-controller
文档说明: 只是记录关键点
实验环境: linux debian 11 + virtualbox
3台虚拟机
192.168.10.251 (central)
192.168.3.249 (node1)
192.168.3.250 (node2)
什么是SD-WAN?
什么是智能接入网关
什么是 SD-WAN(新版)
控制平面: 北向 云管理系统 CMS (OVN北向数据库接收CMS)
转发(数据平面)平面: 南向 OVS (东西向流量 和南北向流量)
ovn 原理图
CMS
|
|
+-----------|-----------+
| | |
| OVN/CMS Plugin |
| | |
| | |
| OVN Northbound DB |
| | |
| | |
| ovn-northd |
| | |
+-----------|-----------+
|
|
+-------------------+
| OVN Southbound DB |
+-------------------+
|
|
+------------------+------------------+
| | |
HV 1 | | HV n |
+---------------|---------------+ . +---------------|---------------+
| | | . | | |
| ovn-controller | . | ovn-controller |
| | | | . | | | |
| | | | | | | |
| ovs-vswitchd ovsdb-server | | ovs-vswitchd ovsdb-server |
| | | |
+-------------------------------+ +-------------------------------+
ovn-central
启动 ovn-central
#!/bin/bash
set -exu
__DIR__=$(cd "$(dirname "$0")";pwd)
cd ${__DIR__}
export PATH=$PATH:/usr/local/share/openvswitch/scripts
export PATH=$PATH:/usr/local/share/ovn/scripts
ovn-ctl start_northd # center need
ovn-nbctl set-connection ptcp:6641
ovn-sbctl set-connection ptcp:6642
ovn-nbctl show
ovn-sbctl show
sleep 2
netstat -antp | grep 6641
netstat -antp | grep 6642
ovn-central-stop-and-reset
关闭ovn-central 并且重置已配置信息
#!/bin/bash
__DIR__=$(cd "$(dirname "$0")";pwd)
cd ${__DIR__}
export PATH=$PATH:/usr/local/share/openvswitch/scripts
export PATH=$PATH:/usr/local/share/ovn/scripts
set -exu
{
ovn-ctl stop_northd
} || {
echo $?
}
# 不想重置配置,这两句命令不要写
rm -rf /usr/local/etc/ovn/ovnnb_db.db
rm -rf /usr/local/etc/ovn/ovnsb_db.db
ovn-controller
启动ovn-controller,每个节点都需要启动
#!/bin/bash
__DIR__=$(cd "$(dirname "$0")";pwd)
cd ${__DIR__}
export PATH=$PATH:/usr/local/share/openvswitch/scripts
export PATH=$PATH:/usr/local/share/ovn/scripts
set -exu
proc_num=$(ps -ef | grep 'ovn-controller unix:/usr/local/var/run/openvswitch/db.sock' | grep -v grep | wc -l)
test $proc_num -gt 0 && ( echo 'ovn-controller is running '; exit 0 )
ipv6=$(ip -6 address show | grep inet6 | awk '{print $2}' | cut -d'/' -f1 | sed -n '2p')
ipv4=$(ip -4 address show | grep inet | grep -v 127.0.0 | awk '{print $2}' | cut -d'/' -f1 | sed -n '1p')
CENTRAL_IP=192.168.3.251
EXTERNAL_IP="$ipv4,$ipv6"
LOCAL_IP="$ipv4,$ipv6"
ENCAP_TYPE=geneve
id_file=system-id.conf
test -s $id_file || cat /proc/sys/kernel/random/uuid > $id_file
chassis_name=$(cat $id_file)
ovs-ctl start --system-id=${chassis_name}
ovs-vsctl set Open_vSwitch . \
external_ids:ovn-encap-ip="$EXTERNAL_IP" \
external_ids:local_ip="$LOCAL_IP" \
external_ids:ovn-encap-type="$ENCAP_TYPE" \
external_ids:system-id=${chassis_name} \
external_ids:ovn-remote="tcp:${CENTRAL_IP}:6642" \
external_ids:ovn-nb="tcp:$CENTRAL_IP:6641"
ovn-ctl start_controller
ovs-vsctl --columns external_ids list open_vswitch
ovs-ctl status
关闭ovn-controller
关闭ovn-controller 和重置配置
#!/bin/bash
__DIR__=$(cd "$(dirname "$0")";pwd)
cd ${__DIR__}
export PATH=$PATH:/usr/local/share/openvswitch/scripts
export PATH=$PATH:/usr/local/share/ovn/scripts
set -exu
{
ovs-ctl stop
ovn-ctl stop_controller
} || {
echo $?
}
#ovs-etc-dir:
# /usr/local/etc/openvswitch
# /usr/local/etc/ovn
# 不想重置配置,这两句命令不要写
rm -rf /usr/local/etc/openvswitch/conf.db
rm -rf /usr/local/etc/ovn/conf.db
参考文档
- OVN 架构
- 快速安装OVN 和OVS
- ovn-ovs-demo-in-container ovn-central 和 ovn-controller 配置例子
- 容器基于OVN实现跨主机通信实验一
- 未来网络白皮书——白盒交换机技术白皮书.pdf
- SDN: 软件定义网络
- 什么是软件定义网络 (SDN)?
- CloudFabric是华为推出的数据中心网络SDN解决方案
- 华为HiSec安全解决方案采取IPDRR(风险识别、安全防御、安全检测、安全响应和安全恢复)模式
- 什么是NetStream
- 什么是网络安全态势感知?
- 什么是高级持续性威胁(APT)?
- 什么是零信任?
- Proxmox PVE
- NAT介绍以及穿透各种类型nat的技术实现包括对称型nat
- 【译】 NAT 穿透是如何工作的:技术原理及企业级实践