Vorbereitende Vorbereitung
Bereiten Sie zwei virtuelle Centos7-Maschinen vor, von denen zwei mit zwei Netzwerkkarten (nur NAT und Host) konfiguriert sind, und zwei virtuelle Bereiche mit mehreren Festplatten, konfigurieren Sie IP-Adresse und Hostnamen, synchronisieren Sie die Systemzeit, deaktivieren Sie Firewall und Selinux und ändern Sie die IP-Adresse Und Hostnamenzuordnung
ip | Hostname |
---|---|
ens33 (NAT): 192.168.29.145 ens37 (nur Host): 192.168.31.135 | Regler |
ens33 (NAT): 192.168.29.146 ens37 (nur Host): 192.168.31.136 | Computer |
Ausführliche Informationen zum Konfigurationsprozess von OpenStack finden Sie unter: https://editor.csdn.net/md/?articleId=107760621
Duales Gateway für die Konfiguration der virtuellen Maschine (am Beispiel des Controllers)
Ändern Sie die Netzwerkkonfiguration
[root@controller ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens33
DEVICE=ens33
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.29.145
NETMASK=255.255.255.0
GATEWAY=192.168.29.2
DNS1=192.168.29.2
[root@controller ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens37
DEVICE=ens33
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.31.135
NETMASK=255.255.255.0
Starten Sie das Netzwerk neu
[root@controller ~]# systemctl restart network
Konfigurieren Sie das Dual-Gateway
[root@controller ~]# vi /etc/iproute2/rt_tables
252 e1
251 e0
Statische Route hinzufügen
[root@controller ~]# ip route flush table e0
[root@controller ~]# ip route add default via 192.168.29.2 dev ens33 src 192.168.29.145 table e0
[root@controller ~]# ip route add 127.0.0.0/8 dev lo table e0
[root@controller ~]# ip rule add from 192.168.29.145 table e0
[root@controller ~]# ip route flush table e1
[root@controller ~]# ip route add default via 192.168.31.1 dev ens37 src 192.168.31.135 table e1
[root@controller ~]# ip route add 127.0.0.0/8 dev lo table e1
[root@controller ~]# ip rule add from 192.168.31.135 table e1
Konfigurieren Sie, dass beim Start automatisch statische Routen geschrieben werden
[root@controller ~]# vi /etc/rc.local
ip route flush table e0
ip route add default via 192.168.29.2 dev ens33 src 192.168.29.145 table e0
ip route add 127.0.0.0/8 dev lo table e0
ip rule add from 192.168.29.145 table e0
ip route flush table e1
ip route add default via 192.168.31.1 dev ens37 src 192.168.31.135 table e1
ip route add 127.0.0.0/8 dev lo table e1
ip rule add from 192.168.31.135 table e1
[root@controller ~]# chmod +x /etc/rc.d/rc.local
[root@controller ~]# systemctl start rc-local.service
Konfiguration des Controller-Knotens Neutron Dual-Netzwerkkarte
Ändern Sie die Konfigurationsdatei
[root@controller ~]# vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
physical_interface_mappings = public:ens33,internet:ens37
[root@controller ~]# vi /etc/neutron/plugins/ml2/ml2_conf.ini
flat_networks = public,internet
Starten Sie den Dienst neu
systemctl restart neutron-server.service neutron-linuxbridge-agent.service
Computerknotenkonfiguration Neutron Dual Network Card
Ändern Sie die Konfigurationsdatei
[root@computer ~]# vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
physical_interface_mappings = public:ens33,internet:ens37
Starten Sie den Dienst neu
[root@computer ~]# systemctl restart neutron-linuxbridge-agent.service
Informationen zum Bereitstellen des Cloud-Hosts finden Sie unter: https://blog.csdn.net/xixixilalalahaha/article/details/107759415