安装架构介绍
本文旨在通过自己搭建类似neutron (openvswitch + gre) 实现SDN 的环境,学习了解其工作原理,模拟核心原理,比如:同一租户自定义网络 instance 互通,手动为instance 分配 floating ip 等相关内容。
虚拟网络
需要新建3个虚拟网络Net0、Net1和Net2,其在virtual box 中对应配置如下。
Net0:
Network name: VirtualBox host-only Ethernet Adapter#2
Purpose: administrator / management network
IP block: 10.20.0.0/24
DHCP: disable
Linux device: eth0
Net1:
Network name: VirtualBox host-only Ethernet Adapter#3
Purpose: public network
DHCP: disable
IP block: 172.16.0.0/24
Linux device: eth1
Net2:
Network name: VirtualBox host-only Ethernet Adapter#4
Purpose: Storage/private network
DHCP: disable
IP block: 192.168.4.0/24
Linux device: eth2
虚拟机
需要新建2个虚拟机VM1和VM2,其对应配置如下。
VM1:
Name : network1
vCPU:1
Memory :1G
Disk:30G
Network:net1,net2,net3
VM2:
Name: compute1
vCPU:1
Memory :1G
Disk:30G
Networks:net1,net2,net3
Linux interface设置
network1
eth0:10.20.0.201 (management network)
eht1:172.16.0.201 (public/external network)
eht2:192.168.4.201 (private network,gre tunning)
compute1
eth0:10.20.0.202 (management network)
eht1:(disabled)
eht2:192.168.4.202 (private network,gre tunning)
模拟安装网络节点(Network1)
模拟Network 节点相关实现,比如L3、dhcp-agent实现,为了模拟多节点网络情况,这里Network同时也模拟一个计算节点,模拟M2 openvswitch 实现,上面运行instance1。
网络接口配置
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=10.20.0.201
NETMASK=255.255.255.0
vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=172.16.0.201
NETMASK=255.255.255.0
vi /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.4.201
NETMASK=255.255.255.0
重启网络服务