openstackAllInOne单网卡flat网络搭建

环境准备

1.linuxCentOS-7-x86_64-DVD-1810,虚拟机vmware workstations15
2.网络使用NAT,虚注意拟网络编辑器的NAT网关


2019-01-04 15_51_49-AllInOne - VMware Workstation.png

3.linux网卡/etc/sysconfig/network-scripts/ifcfg-ens32配置为

TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens32"
UUID="02b991e4-00ec-4685-933d-24ccae423aed"
DEVICE="ens32"
ONBOOT="yes"
IPADDR="192.168.200.141"
PREFIX="24"
GATEWAY="192.168.200.2"
DNS1="192.168.200.2"

可以ping通百度即可

安装packstack

1.hostnamectl set-hostname controller
2./etc/hosts添加 192.168.200.141 controller
3.yum install -y https://rdoproject.org/repos/rdo-release.rpm
4.yum install -y openstack-packstack
5.systemctl stop NetworkManager && systemctl disable NetworkManager并且systemctl stop firewalld&& systemctl disable firewalld
6.setenforce 0
7修改/etc/selinux/config中

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

8.yum update -y 后重启

正式安装开始,想要云主机可以被secureCRT连接,需要这么安装

1.packstack --allinone --provision-demo=n --os-neutron-ovs-bridge-mappings=extnet:br-ex --os-neutron-ovs-bridge-interfaces=br-ex:eth0 --os-neutron-ml2-type-drivers=vxlan,flat
eth0改为自己网卡名字ens32,这样安装会自动配置好网桥
其实也可以这么装packstack --allinone --provision-demo=n 需要安装完自己配置网桥,没有测试云主机是否可以ping通,读者自行测试
2.等待半小时后安装完成出现 **** Installation completed successfully ****** 安装完毕
3.cat /root/keystonerc_admin可知道用户名密码
export OS_USERNAME=admin
export OS_PASSWORD='09cca9f5ac2e4da9'
4.输入网址http://192.168.200.141/dashboard登陆
5.点击管理员-系统-系统信息,产看各项服务是否激活

2019-01-04 16_36_17-系统信息 - OpenStack Dashboard.png

6.安装完成后,/etc/sysconfig/network-scripts/ifcfg-ens32改变为

DEVICE=ens32
NAME=ens32
DEVICETYPE=ovs
TYPE=OVSPort
OVS_BRIDGE=br-ex
ONBOOT=yes
BOOTPROTO=none

并且自动增加了一个配置/etc/sysconfig/network-scripts/ifcfg-br-ex

PROXY_METHOD="none"
BROWSER_ONLY="no"
DEFROUTE="yes"
UUID="02b991e4-00ec-4685-933d-24ccae423aed"
ONBOOT="yes"
IPADDR="192.168.200.141"
PREFIX="24"
GATEWAY="192.168.200.2"
DEVICE=br-ex
NAME=br-ex
DEVICETYPE=ovs
OVSBOOTPROTO="static"
TYPE=OVSBridge
OVS_EXTRA="set bridge br-ex fail_mode=standalone"

通过网页创建云主机

1.创建一个新项目demo


2019-01-04 16_43_18-项目 - OpenStack Dashboard.png

2.创建一个新用户libaojia


2019-01-04 16_42_49-NVIDIA GeForce Overlay.png

3.创建外网 管理员-网络-网络-创建网络 创建flat外网


2019-01-04 16_54_55-网络 - OpenStack Dashboard.png
2019-01-04 16_55_41-网络 - OpenStack Dashboard.png
2019-01-04 16_56_20-网络 - OpenStack Dashboard.png

是管理员下的网络

4.退出admin用户,以libaojia用户登录
5.项目-网络-网络-创建网络 创建租户内网


2019-01-04 17_01_54-网络 - OpenStack Dashboard.png
2019-01-04 17_02_03-网络 - OpenStack Dashboard.png
2019-01-04 17_02_37-网络 - OpenStack Dashboard.png

6.项目-网络-路由-新建路由


2019-01-04 17_03_58-路由 - OpenStack Dashboard.png

点击router 接口-增加接口


2019-01-04 17_04_22-router - OpenStack Dashboard.png

7.项目-网络-安全组 default 管理规则 删除所有默认规则 增加所有有ICMP tcp udp 出人口任何规则


2019-01-04 17_06_43-管理安全组规则:default (10c982c5-edb4-4cec-9958-c241dfa95169) - OpenStack Dashboard.png

8.下载镜像地址http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img 上传镜像

2019-01-04 17_09_16-镜像 - OpenStack Dashboard.png

9.创建实例


2019-01-04 17_12_04-实例 - OpenStack Dashboard.png

2019-01-04 17_12_16-实例 - OpenStack Dashboard.png
2019-01-04 17_12_24-实例 - OpenStack Dashboard.png

10.控制台登录 用户名cirros 密码cubswin:)


2019-01-04 17_14_05-cirrosinstance - OpenStack Dashboard.png

11.绑定浮动ip


2019-01-04 17_15_13-实例 - OpenStack Dashboard.png

12.使用secureCRT连接192.168.200.113,可以ping通百度


2019-01-04 17_17_38-192.18.200.113 - SecureCRT.png

参考文献

https://www.rdoproject.org/install/packstack/
https://www.rdoproject.org/networking/neutron-with-existing-external-network/
https://blog.csdn.net/songqier/article/details/78709002
https://blog.csdn.net/songqier/article/details/78729567

你可能感兴趣的:(openstackAllInOne单网卡flat网络搭建)