查看本地网络信息
ipconfig /all
无线局域网适配器 WLAN:
连接特定的 DNS 后缀 . . . . . . . :
描述. . . . . . . . . . . . . . . : Qualcomm Atheros QCA9377 Wireless Network Adapter
物理地址. . . . . . . . . . . . . : F8-A2-D6-DD-EF-87
DHCP 已启用 . . . . . . . . . . . : 是
自动配置已启用. . . . . . . . . . : 是
本地链接 IPv6 地址. . . . . . . . : fe80::b4ff:13e9:7436:43c7%17(首选)
IPv4 地址 . . . . . . . . . . . . : 192.168.12.42(首选)
子网掩码 . . . . . . . . . . . . : 255.255.255.0
获得租约的时间 . . . . . . . . . : 2020年7月28日 11:50:33
租约过期的时间 . . . . . . . . . : 2020年8月7日 11:50:32
默认网关. . . . . . . . . . . . . : 192.168.12.1
DHCP 服务器 . . . . . . . . . . . : 192.168.12.1
DHCPv6 IAID . . . . . . . . . . . : 133735126
DHCPv6 客户端 DUID . . . . . . . : 00-01-00-01-25-66-B6-A1-E8-6A-64-77-88-2E
DNS 服务器 . . . . . . . . . . . : 192.168.111.2
TCPIP 上的 NetBIOS . . . . . . . : 已启用
修改网卡信息
vim /etc/sysconfig/network-scripts/ifcfg-ens33
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=ens33 DEVICE=ens33 ONBOOT=yes IPADDR=192.168.12.81 PREFIX=24 GATEWAY=192.168.12.1 DNS1=192.168.111.2
安装net-tools
yum install net-tools
查看当前的网络和系统信息
ifconfig
ens33: flags=4163
mtu 1500
inet 192.168.12.81 netmask 255.255.255.0 broadcast 192.168.12.255
inet6 fe80::9553:5536:f45:18c6 prefixlen 64 scopeid 0x20
ether 00:0c:29:4c:80:99 txqueuelen 1000 (Ethernet)
RX packets 9389 bytes 10903212 (10.3 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3304 bytes 231962 (226.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73
mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
使用root用户更新系统
yum update
重启服务器
shutdown -r now
修改hostname(可选)
如果后续需要将all-in-one扩展成多节点时,配置节点间通信,都会用到这个hostname。并且all-in-one的机器节点将会作为多节点中的controller节点,这里我们将hostname更改为controller。
hostnamectl set-hostname controller
安装vim
yum install vim
修改hosts
vim /etc/hosts
#127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 controller
::1 controller
注销用户并重新登录
logout
安装RDO库
# yum repository
yum install https://www.rdoproject.org/repos/rdo-release.rpm
安装packstack(自动化的OpenStack安装程序)
yum install openstack-packstack
关掉NetworkManager并disable掉(防止这个服务更改我们的网络配置)
systemctl stop NetworkManager
systemctl disable NetworkManager
关掉SELinux
vim /etc/selinux/config
# SELINUX=enforcing SELINUX=disabled
关掉firewall
systemctl stop firewalld && systemctl disable firewalld
安装并升级pip3
yum -y install python3-pip
pip3 install --upgrade pip
一路回车,最后yes。 通过这个源安装很慢,安装过程中如果出现yum下载失败,重新执行packstack –allinone就行。
packstack –allinone
认证服务(出现~(keystone_admin)为验证成功)
source keystonerc_admin
查看账号密码
cat keystonerc_admin
unset OS_SERVICE_TOKEN
export OS_USERNAME=admin
export OS_PASSWORD=‘966314853b644a9d’
export OS_REGION_NAME=RegionOne
export OS_AUTH_URL=http://192.168.12.81:5000/v3
export PS1=’[\u@\h \W(keystone_admin)]$ ’export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_IDENTITY_API_VERSION=3
export OS_USERNAME(账号)=admin
export OS_PASSWORD(密码)=’******************’
export OS_AUTH_URL(登录网址)=http://192.168.12.81/dashboard/auth/login/?next=/dashboard/
查看网卡信息
ifconfig
br-ex: flags=4163
mtu 1500
inet 172.24.4.1 netmask 255.255.255.0 broadcast 0.0.0.0
inet6 fe80::f4da:87ff:fe1a:c141 prefixlen 64 scopeid 0x20
ether f6:da:87:1a:c1:41 txqueuelen 1000 (Ethernet)
RX packets 5 bytes 140 (140.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 656 (656.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0ens33: flags=4163
mtu 1500
inet 192.168.12.81 netmask 255.255.255.0 broadcast 192.168.12.255
inet6 fe80::20c:29ff:fe4c:8099 prefixlen 64 scopeid 0x20
ether 00:0c:29:4c:80:99 txqueuelen 1000 (Ethernet)
RX packets 346100 bytes 407630230 (388.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 128990 bytes 10885257 (10.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73
mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 576888 bytes 85788392 (81.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 576888 bytes 85788392 (81.8 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
备份ifcfg-ens33
cp /etc/sysconfig/network-scripts/ifcfg-ens33 /root/ifcfg-ens33.bak
创建br-ex的网络接口文件,并修改ifcfg-ens33和ifcfg-br-ex
生成br-ex的网卡配置文件
cp /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts/ifcfg-br-ex
修改ifcfg-ens160的内容为:
vim /etc/sysconfig/network-scripts/ifcfg-ens33
DEVICE=ens33
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSPort
OVS_BRIDGE=br-ex
修改ifcfg-br-ex的内容为:
原始复制生成的ifcfg-br-ex内容为:
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=ens33
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.12.81
PREFIX=24
GATEWAY=192.168.12.1
DNS1=192.168.111.2
现在修改为:
OTPROTO=none
DEFROUTE=yes
NAME=br-ex
DEVICE=br-ex
ONBOOT=yes
PREFIX=24
PEERDNS=no
NM_CONTROLLED=no
IPADDR=192.168.12.81
GATEWAY=192.168.12.1
DNS1=192.168.111.2
将ens33接入br-ex,并重启操作系统Network服务
ovs-vsctl add-port br-ex ens160
systemctl restart network
查看网络信息
ifconfig
br-ex: flags=4163
mtu 1500
inet 192.168.12.81 netmask 255.255.255.0 broadcast 192.168.12.255
inet6 fe80::f4da:87ff:fe1a:c141 prefixlen 64 scopeid 0x20
ether 00:0c:29:4c:80:99 txqueuelen 1000 (Ethernet)
RX packets 15515 bytes 1375491 (1.3 MiB)
RX errors 0 dropped 11 overruns 0 frame 0
TX packets 88 bytes 8670 (8.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0ens33: flags=4163
mtu 1500
inet6 fe80::20c:29ff:fe4c:8099 prefixlen 64 scopeid 0x20
ether 00:0c:29:4c:80:99 txqueuelen 1000 (Ethernet)
RX packets 430177 bytes 417788322 (398.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 130599 bytes 11073192 (10.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73
mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 2014440 bytes 229555677 (218.9 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2014440 bytes 229555677 (218.9 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Br-ex获取了外网IP,使用命令可以看到ens33现在是作为一个port attached到了br-ex
ovs-vsctl show
f95539df-eb6a-4ab2-b677-fd41d6ac46a5
Manager “ptcp:6640:127.0.0.1”
is_connected: true
Bridge br-ex
Port br-ex
Interface br-ex
type: internal
Port “patch-provnet-dbecd2ee-eb5f-4ab2-aef8-e92074644c4b-to-br-int”
Interface “patch-provnet-dbecd2ee-eb5f-4ab2-aef8-e92074644c4b-to-br-int”
type: patch
options: {peer=“patch-br-int-to-provnet-dbecd2ee-eb5f-4ab2-aef8-e92074644c4b”}
Port “ens33”
Interface “ens33”
Bridge br-int
fail_mode: secure
Port “patch-br-int-to-provnet-dbecd2ee-eb5f-4ab2-aef8-e92074644c4b”
Interface “patch-br-int-to-provnet-dbecd2ee-eb5f-4ab2-aef8-e92074644c4b”
type: patch
options: {peer=“patch-provnet-dbecd2ee-eb5f-4ab2-aef8-e92074644c4b-to-br-int”}
Port br-int
Interface br-int
type: internal
ovs_version: “2.12.0”
首先引入环境变量设置:
source /root/keystonerc_admin
nova service-list
neutron agent-list
后续操作可参考https://blog.csdn.net/songqier/article/details/78729567
参考资料
https://blog.csdn.net/songqier/article/details/78709002
https://blog.51cto.com/yancyliu/1912141
https://www.cnblogs.com/lizhewei/p/11511845.html
https://blog.csdn.net/songqier/article/details/78729567