OpenStack-Queens-environment preparation-network configuration

 

controller

In order to facilitate the construction later, here the name of the virtual machine is changed to controller

hostnamectl set-hostname controller

Ctrl+D re-login to take effect

Modify the network card configuration file

The first network card is used as the management network, and there is no need to set up a gateway.

vi /etc/sysconfig/network-scripts/ifcfg-ens33

BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.100.10
PREFIX=24

The second network card is used as an external network, and the gateway needs to be configured and DNS is set

vi /etc/sysconfig/network-scripts/ifcfg-ens34

BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.200.10
PREFIX=24
GATEWAY=192.168.200.2
DNS1=114.114.114.114
DNS2=8.8.8.8

Restart the network card

systemctl restart network

Write hosts analysis

echo 192.168.100.10 controller >> /etc/hosts
echo 192.168.100.20 compute >> /etc/hosts

 Turn off the firewall firewalld

systemctl stop firewalld.service
systemctl disable firewalld.service

Close selinux

vi /etc/selinux/config

SELINUX=disabled

To make the settings take effect, you can choose to restart or:

setenforce 0

 

compute

Modify virtual machine name

hostnamectl set-hostname compute

Modify the network card configuration

vi /etc/sysconfig/network-scripts/ifcfg-ens33

BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.100.20
PREFIX=24

 

vi /etc/sysconfig/network-scripts/ifcfg-ens34

BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.200.20
PREFIX=24
GATEWAY=192.168.200.2
DNS1=114.114.114.114
DNS2=8.8.8.8

Write hosts analysis

echo 192.168.100.10 controller >> /etc/hosts
echo 192.168.100.20 compute >> /etc/hosts

Turn off the firewall firewalld

systemctl stop firewalld.service
systemctl disable firewalld.service

Close selinux

vi /etc/selinux/config

SELINUX=disabled

To make the settings take effect, you can choose to restart or:

setenforce 0

Verify operation 

Network Time Protocol (NTP)

controller

Install package

yum install chrony

Edit the /etc/chrony.conf file to configure the clock source synchronization server

vi /etc/chrony.conf

server time.windows.com iburst
allow 192.168.100.0/24

Set the NTP service to start at boot

systemctl enable chronyd.service
systemctl start chronyd.service

compute

Install package

yum install chrony

Edit the /etc/chrony.conf file to configure the clock source synchronization server

vi /etc/chrony.conf

server controller iburst

Set the NTP service to start at boot

systemctl enable chronyd.service
systemctl start chronyd.service

Verify operation 

controller

chronyc sources

210 Number of sources = 1
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^* 13.65.88.161                  2   6    17     3    -10ms[  -35ms] +/-  200ms

compute

chronyc sources

210 Number of sources = 1
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^* controller                    3   6    17     2  -1841ns[  -12us] +/-  367ms

 

Guess you like

Origin blog.csdn.net/qq_41419761/article/details/82967379