reminder:
The content described in this article is dependent and may differ from the expectation due to different soft and hard conditions, so please take the actual situation as the criterion for reference only.
Oracle Cloud Oracle Cloud has fully opened IPv6 around April 15 (previously only in GOV government regions), all cloud infrastructures (Oracle Cloud Infrastructure, OCI) support IPv6.
For us, to put it simply, the virtual machine (Compute Instance) can also allocate IPv6. The operation is very simple. No restart is required. It is free to use. Does Oracle support IPv4/IPv6 dual stack become more popular?
Related articles:
Oracle Cloud Oracle Cloud Object Storage ObjectStorage API (OCI) Detailed Instructions
Oracle Cloud Oracle Cloud announced to provide lifelong free VPS, object storage, database and other services, with tutorial evaluation
IPv6 allocation can be divided into two situations: one is to create a new host instance, and the other is to allocate IPv6 to the created instance.
For the first case, when creating a host instance, check IPv6:
The second situation is the focus of this article. The general process is: ① Assign CIDR → ② Configure subnet → ③ Configure route → ④ Configure security rules → ⑤ Assign IPv6. The first four steps are described in detail below Network>Virtual Cloud Network>Virtual Cloud Network Details
The last step is in the VNIC Details
Middle operation:
Assign CIDR
Path: Network>Virtual Cloud Network>Virtual Cloud Network Details>CIDR Block, directly click Add IPv6 CIDR Block
That is, an IPv6 address block of/56 size will be allocated by default:
Configure Subnet
Path: Network>Virtual Cloud Network>Virtual Cloud Network Details>Subnet, click three points on the right of the subnet, and then click Edit:
Check Enable IPv6 CIDR Block
, fill in any hexadecimal number of 00-FF, and then save it. Here, an IPv6 address block with the size of/64 will be allocated:
Configure Routes
Path: Network>Virtual Cloud Network>Virtual Cloud Network Details>Routing Table, click Add Routing Rule
, set and save according to the screenshot example:
For IPv4/IPv6 dual stack to work properly, the following two routes should be available (::/0, 0.0.0.0/0):
Configure security rules
Path: Network>Virtual Cloud Network>Virtual Cloud Network Details>Network Security Group. To add outbound rules and inbound rules, click Add Rule
, set according to the screenshot example (open all) and save:
The IPv4/IPv6 dual stack should have the following two rules (::/0, 0.0.0.0/0) to work normally:
Assign IPv6
Path: Calculation>Instance>Instance Details>Additional VNIC>VNIC Details, click Assign IPv6 address
, fill in the IPv6 address suffix in the box, and then click Assign:
Test IPv6
Now the host instance should have obtained the IPv6 address (some systems may need to be updated manually). Test it:
It can be seen that PING is available, and the PING value is very low. It is very likely that Google is directly connected to the computer room.
In the actual test, it is found that none of the machine rooms in the three networks are directly connected to IPv6, so it is useless?
Problem points
1、 NotAuthorizedOrNotFound
Confirm that IPv6 is not checked for the instance that has been activated, and this error will appear for the account that has passed the 30 day trial period. You can re create a subnet and check IPv6 (IPv4 will change), or you can directly add IPv6 through auxiliary means.
Without deleting the subnet allocation IPv6 method, accounts that have passed the probation period can also achieve:
I、 Click Cloud Shell in the upper right corner of the console:
II、 Get compartment_id:
In Cloud Shell, enter:
oci iam compartment list
III、 Get subnet_id:
Enter in Cloud Shell( [compartment_id]
Replace with the one queried in the previous step compartment_id
):
oci network subnet list --compartment-id [compartment_id]
Note that if there are multiple subnets, multiple IDs will be obtained here to identify the operation.
IV、 Get CIDR block address
V、 Assign IPv6 to subnet
Enter in Cloud Shell( [subnet_id]
Replace with the one found in step III subnet_id
, [cidr]
Replace with the IPv6 CIDR block added in the previous step. Note that the block size allocated to the subnet is /64
, not /56
):
oci network subnet update --subnet-id [subnet_id] --ipv6-cidr-block [cidr]
If the allocation is successful as shown in the figure, then refer to the above steps to configure routes, configure security rules, and allocate IPv6.
For pure command line operations, refer to《 Oracle Cloud Oracle Cloud uses API (OCI) to allocate and enable native IPv6 detailed instructions - prompt NotAuthorizedOrNotFound can also operate 》The advantage is faster and more convenient.
2. IPv6 address cannot be assigned
That is, IPv6 has been allocated in the management console step by step, but the host still does not have IPv6.
This problem exists in some compact versions of the system. In fact, the network already supports IPv6, but it fails to obtain IPv6 finally. At this time, we can directly assign the IPv6 address to the network card:
root@oc-kr :~# ifconfig ens3 inet6 add [IPv6]/64 up
Note that [IPv6] is changed to the actual IPv6 address, and the suffix is fixed as /64
, The default network cards of Oracle's native Linux images are all ens3
。
You can also try to use the following methods to enable IPv6 (for earlier versions, for reference, do not copy):
root@oc-kr :~# echo "net.ipv6.conf.all.disable_ipv6 = 0" >> /etc/sysctl.conf root@oc-kr :~# echo "net.ipv6.conf.default.disable_ipv6 = 0" >> /etc/sysctl.conf root@oc-kr :~# echo "net.ipv6.conf.ens3.disable_ipv6 = 0" >> /etc/sysctl.conf root@oc-kr :~# echo "net.ipv6.conf.lo.disable_ipv6 = 0" >> /etc/sysctl.conf root@oc-kr :~# sysctl -p net.ipv6.conf.all.disable_ipv6 = 0 net.ipv6.conf.default.disable_ipv6 = 0 net.ipv6.conf.ens3.disable_ipv6 = 0 net.ipv6.conf.lo.disable_ipv6 = 0 root@oc-kr :~# dhclient -6
Or write the IPv6 address directly into the network card configuration file (take CentOS as an example, for reference, do not copy it):
root@oc-kr :~# vim /etc/sysconfig/network-scripts/ifcfg-ens3 DEVICE="ens3" BOOTPROTO="dhcp" ONBOOT="yes" TYPE="Ethernet" NM_CONTROLLED="no" IPV6_AUTOCONF="yes" IPV6INIT="yes" NOZEROCONF="yes" IPV6ADDR_SECONDARIES="2001::f001/64" ZONE=public
For Ubuntu system, please refer to the following configuration:
root@oc-kr :~# vim /etc/netplan/50-cloud-init.yaml # This file is generated from information provided by the datasource. Changes # to it will not persist across an instance reboot. To disable cloud-init's # network configuration capabilities, write a file # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following: # network: {config: disabled} network: ethernets: ens3: dhcp4: true dhcp6: false match: macaddress: 02:00:17:01:2e:* addresses: - 2603:c022:8001:*:*:*:*:*/128 set-name: ens3
be careful, macaddress
MAC address after, and addresses
Please change the IPv6 address to the address you applied for.
Reference article
1、《 IPv6 on Oracle Cloud Infrastructure 》
2、《 Oracle Cloud Infrastructure Documentation - IPv6 Addresses 》