Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What happens when the openstack kilo version of the virtual machine cannot ping the extranet?

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail what happens when the openstack kilo version of the virtual machine is unable to ping the extranet, and the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.

I. brief introduction

The second time to build the Openstack environment, this time it is not built on our own VM virtual machine. Various errors occurred in the process of building the environment. This is just for recording:

Second, the test environment

Hardware: two X86 servers, 6 network cards

System: Centos7.2 system, openstack version is kilo

Because there are two machines, the architecture is relatively compact:

Bdc217:controller 、 compute1

Bdc218:network 、 compute2

III. Network card configuration

Both machines have 6 network cards, and the configuration is as follows

Bdc217:

Bond0: binding of two network cards

IPADDR=192.168.8.217

NETMASK=255.255.0.0

GATEWAY=192.168.5.2

Bond2: three network cards are bound as storage networks

192.168.13.217

Enp4s0f0: not configured (originally intended as a tunnel network)

Bdc218:

Bond0: binding of two network cards

IPADDR=192.168.8.218

NETMASK=255.255.0.0

GATEWAY=192.168.5.2

Bond2: three network cards are bound as storage networks

192.168.13.218

Enp4s0f0: external network as a network node

# cat / etc/sysconfig/network-scripts/ifcfg-enp4s0f0TYPE=EthernetBOOTPROTO=noneNAME=enp4s0f0DEVICE=enp4s0f0ONBOOT=yes

Description:

(1) external network: provide Internet service and external login openstack for CVM

(2) Management network: communication between three nodes, such as keystone, authentication, RabbitMQ message queue, etc.

(3) Tunnel network: virtual machine data communication between network nodes and computing nodes, such as DHCP, L2, L3.

In fact, the management network and the tunnel network can use the same network card.

Error record 1. Virtual machine creation failed

The newly created virtual machine is always in the error state

The solution is as follows:

Check more logs, especially those on the network.

My solution: check the neutron configuration file, reconfigure neutron, restart neutron services (such as ovs, etc.)

2. Virtual machine cannot get IP

The appearance of this error is that it takes too long to start the CVM, because you have been checking and checking the CVM console log, and you will find the following error, and there will be a series of failed that seems to be 20.

Starting network...udhcpc (v1.18.5) startedSending discover...Sending discover...Sending discover...No lease, failingWARN: / etc/rc3.d/S40-network failed

The solution is as follows:

Because I used the GRE network mode when I configured it, I checked the ml2_conf.ini configuration file for many times and kept an eye on local_ip, but later I found that I was careless. When configuring IP, the ip address was configured incorrectly when configuring the network card, but the configuration file was not wrong.

Therefore, the gre tunnel is open, but still can not get the ip, modify the ip settings of the network card, the problem will be solved.

3. The virtual machine cannot access the public network

The virtual machine can obtain IP normally, and it can also connect the system node and network node with ping and ssh, but it cannot ping the extranet.

Network creation process:

5. Create the first network to create an external network # source admin-openrc.sh# neutron net-create ext-net-router:external\-provider:physical_network external-provider:network_type flatCreated a new network:+--+-- -+ | Field | Value | +-- +-- + | admin_state_up | True | | id | c05070a1-9a4a-40d7-aa53-f1e38c6616e8 | | mtu | 0 | name | ext-net | | provider:network_type | flat | Provider:physical_network | external | | provider:segmentation_id | | router:external | True | | shared | False | | status | ACTIVE | | subnets | tenant_id | df206060f35a48b78d06aa1a9ec9c10c | + -- + create a subnet on the external network # neutron subnet-create ext-net 192.168.12.0 Universe 24-- name ext-subnet\-- allocation-pool start=192.168.12.100 End=192.168.12.200\-disable-dhcp-gateway 192.168.12.1Created a new subnet:+-+---+ | Field | Value | | +-+-- + | allocation_pools | {"start": "192.168.12.100" "end": "192.168.12.200"} | | cidr | 192.168.12.0 take 24 | | dns_nameservers | | enable_dhcp | False | | gateway_ip | | 192.168.12.1 | | host_routes | id | d9a05de1-4c7d-4c05-b324-a65cbd182b83 | | ip_version | 4 | | | ipv6_address_mode | | ipv6_ra_mode | name | ext-subnet | | network_id | cbd0e9ab-07d4-49bf | -b1ef-67914fbaaf20 | | subnetpool_id | tenant_id | df206060f35a48b78d06aa1a9ec9c10c | +-- -+ create a tenant network # source demo-openrc.sh# neutron net-create demo-netCreated a new network:+-+--+ | Field | Value | | +-+ | admin_state_up | True | | id | dc14ee5b-4bb6-4773-89f3-c1c4c064315a | | mtu | 0 | | | name | demo-net | | router:external | False | | shared | False | | status | ACTIVE | | subnets | | | tenant_id | 23652ebf5833435aa243e1a7665cb9dc | +-+-+ create a subnet under the tenant network # neutron subnet-create demo-net 10.10.1.0 dns-nameserver 24\-- name demo-subnet-- subnet | 8.8.4.4-- gateway 10.10.1.1Created a new subnet:+-+-+ | Field | Value | +- -+-+ | allocation_pools | {"start": "10.10.1.2" "end": "10.10.1.254"} | | cidr | 10.10.1.0 and24 | | dns_nameservers | 8.8.4.4 | | enable_dhcp | True | | gateway_ip | 10. 10.1.1 | | host_routes | | id | f4758b79-5a53-4f9d-9838-5e372802da3f | | ip_version | 4 | | ipv6_address_mode | | | ipv6_ra_mode | | name | demo-subnet | | network_id | dc14ee5b-4bb6-4773-89f3-c1c4c064315a | | subnetpool_id | | | tenant_id | 23652ebf5833435aa243e1a7665cb9dc | +-+-+ create a route for the tenant network | And add external network and tenant network to it.

Create a rout

# neutron router-create demo-routerCreated a new router:+---+--+ | Field | Value | +- -+-+ | admin_state_up | True | | external_gateway_info | | id | fbb96045-517d-4956-990a-01668151a70e | | name | | demo-router | | routes | status | ACTIVE | | tenant_id | 23652ebf5833435aa243e1a7665cb9dc | + -- +

Add subnets routed to demo tenants

# neutron router-interface-add demo-router demo-subnetAdded interface b5153ea2-4ed5-4c68-b599-29fc48d251b7 to router demo-router.

Add routes to external networks and use them as gateways

# neutron router-gateway-set demo-router ext-netSet gateway for router demo-router

The configuration process of the entire network completely follows the steps of the official documentation, but after the instance is created, it is still unable to ping the external network. Finally, it is found that there is a configuration problem with the network card, because the default gateway is 192.168.5.2. Only with this gateway can you connect to the extranet, but the steps to create a subnet on the external network are

# neutron subnet-create ext-net 192.168.12.0 Compact 24-name ext-subnet\

-- allocation-pool start=192.168.12.100,end=192.168.12.200\

-- disable-dhcp-- gateway 192.168.12.1

The gateway can only choose the ip of 12 network segments, but cannot be changed to 5.2. finally, the subnet of the external network is modified to 5 network segments, and the gateway is also modified to 5.2. it is found that ping can be connected to the public network.

In addition, the subnet mask should also be noted. / 24 indicates that 255.255.255.0 is three 255. while the subnet mask of the test environment is 255.255.0.0, which results in that the non-12 IP address range cannot ping floating IP, and the statement that creates the subnet is changed to

# neutron subnet-create ext-net 192.168.5.0 neutron subnet-create ext-net 16-- name ext-subnet\

-- allocation-pool start=192.168.5.100,end=192.168.5.200\

-- disable-dhcp-- gateway 192.168.5.2

In this way, a new instance is created. After a floating IP is bound, the CVM can access both the public network and its own PC.

About the openstack kilo version of the virtual machine can not ping extranet is what is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report