VLAN network supports ipv6 switch and virtual machine configuration

foreword

This article mainly introduces the configuration of switches and virtual machines that support IPv6 in the OpenStack VLAN network.
Simply put (it will be used to create an ipv6 subnet below)
neutron supports ipv6, and there are two important attributes
1. ipv6_address_mode is used for how the client obtains an ipv6 address
2. ipv6_ra_mode is used for notification of routers in the subnet, using icmpv6 messages To achieve, the message type is 134

These two attributes can be set to the following three values
​​1, slaac, stateless address automatic configuration, the client configures the local address through the RA message returned by the router
2, dhcpv6-stateful, ip address and dns and other information are obtained from the dhcp server
3, dhcpv6-stateless, the ip address is obtained from the router RA message, and the information such as dns is obtained from the dhcp server

We currently support dhcpv6-stateful+dhcpv6-stateful

1. Create a VLAN network and configure the switch

1. Plan and create a VLAN network on OpenStack

First create a VLAN network on OpenStack, the VLAN number is 2305, as shown in the following figure:

openstack network create vlan2305 --provider-network-type vlan --project test01 --provider-physical-network physnet1 --provider-segment 2305 --availability-zone-hint az-1

insert image description here
There are two subnets under VLAN2305, vlan-subnet and ipv6-subnet, as shown in the following figure:

openstack subnet create --project test01 --subnet-range 192.168.100.0/24 --gateway 192.168.100.1  --network vlan2305 vlan-subnet

insert image description here
ipv6-subnet network open dhcpv6-stateful+dhcpv6-stateful

openstack subnet create --project inspurtest10 --ip-version 6 --subnet-range 2402::/64 --gateway 2402::1 --network vlan2305 --ipv6-ra-mode dhcpv6-stateful --ipv6-address-mode dhcpv6-stateful  ipv6-subnet

insert image description here

2. Configure VLAN on the switch

Configure the vlan number corresponding to the network and the network segments of the two subnets.
insert image description here

Two, Ubuntu virtual machine configuration

1. Create a virtual machine

insert image description here

2. Check the port on OpenStack

You can see that the port information bound to the virtual machine is as follows: the port is bound to two IPs, one v4 address 192.168.100.54, one v6 address 2402::135
insert image description here

3. Log in to the virtual machine to configure the network card

3.1 After logging in to the virtual machine, it was found that the virtual machine did not obtain the ipv6 address corresponding to the port on openstack.

insert image description here

3.2 Enter the network card configuration directory, there is no static IP configured in the virtual machine

cd /etc/netplan/

insert image description here

3.3 Configure the ipv6 address for the network card

vi 50-cloud-init.yaml

insert image description here
Execute netplan apply to make the network card configuration take effect, as shown in the figure below: the virtual machine has obtained the ipv6 address.

netplan apply

insert image description here

3.4 Verify the connectivity of the ipv6 virtual machine

As shown in the figure below: the virtual machine can communicate with the ping gateway and the intranet IP of the virtual machine on the same subnet.
insert image description here

insert image description here
insert image description here


Summarize

The above is what I will talk about today. This article mainly introduces the switch and virtual machine configuration that the OpenStack VLAN network supports ipv6, and understands the commands for creating a VLAN in OpenStack, the network card configuration of the virtual machine, and the connectivity verification of the ipv6 virtual machine.


Warm reminder ❤

If you encounter any problems during the operation, you can directly follow and private message me, send an error report, and I will reply as soon as I see it.

Guess you like

Origin blog.csdn.net/qq_25919879/article/details/128004713