0

I just can't get to assigning a public IPv6 address to my oracle instance running CentOS 7.

I have assigned IPv6 range to the subnet, and another VM running Ubuntu successfully gets the assigned IPv6.

Output of ifconfig :

ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9000 inet 10.0.0.240 netmask 255.255.255.0 broadcast 10.0.0.255 inet6 fe80::17ff:fe01:b1b2 prefixlen 64 scopeid 0x20<link> ether 02:00:17:01:b1:b2 txqueuelen 1000 (Ethernet) RX packets 1298 bytes 1235123 (1.1 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1207 bytes 810530 (791.5 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 
2
  • Check your logs. Commented Jun 11, 2021 at 10:58
  • Which log exactly ? Commented Jun 11, 2021 at 15:14

3 Answers 3

0

I had the exact same issue. On Oracle Cloud you must assign a /128 IPv6 address to the VM and once this is done you can rely on dhclient to get it set up:

dhclient -6 ens3 
1
  • 1
    The VM successfully picked up the IP, but not the default gateway. I still can't ping any IPv6 address through the VM ! Also, the IP is released on reboot. I am unable to make any changes to /etc/sysconfig/network-scripts/ifcfg-ens3 permanent. Please guide me further. Commented Jun 16, 2021 at 17:56
0
  1. Run systemctl disable rhel-import-state to prevent overwriting /etc/sysconfig/network-script/ifcfg-ens3
  2. Add DHCPV6C=yes to ifcfg-ens3
  3. In "Networking -> Virtual Cloud Networks -> <your vcn> -> Security List Details" add Ingress and Egress rules for IPv6. At least egress.
  4. Reboot and enjoy
3
  • please update your answer as I believe he wants to have a static address Commented Jul 14, 2021 at 16:46
  • Doing the above, now I do get an IPv6 address on ens3, however there's no internet connectivity. ping6 to any address fails with : network is unreachable. Commented Nov 6, 2021 at 17:12
  • Here's my ifcfg-ens3 contents : NAME="ens3" DEVICE="ens3" ONBOOT=yes NETBOOT=yes UUID="80ccc011-c41d-496a-adc3-xxxxxxx" IPV6INIT=yes DHCPV6C=yes BOOTPROTO=dhcp TYPE=Ethernet NM_CONTROLLED=no Commented Nov 6, 2021 at 17:21
0

I met the same issue on both CentOS 7.9 & Oracle Linux 7.9 in Oracle Cloud. And found the root cause is the OS doesn't set the default IPv6 gateway based on the router advertisement. The issue is disappeared after we set the default gateway properly.

Here is the script to get the IPv6 address and set the default gateway, say names configure_ipv6.sh:

#!/bin/bash # 检查是否具有 root 权限 if [[ $EUID -ne 0 ]]; then echo "Error: This script must be run as root" 1>&2 exit 1 fi # 指定要使用的网络接口。Please change to your interface name INTERFACE="ens3" # 使用 dhclient 获取 IPv6 配置信息 dhclient -6 $INTERFACE # 使用 rdisc6 获取路由通告信息 output=$(rdisc6 $INTERFACE 2>/dev/null) # 提取 fe80 开头的链路本地地址作为默认网关 ipv6_gateway=$(echo "$output" | grep -oP 'fe80::[0-9a-f:]{1,39}') # 检查是否成功获取到网关地址 if [[ -z "$ipv6_gateway" ]]; then echo "Error: Could not find IPv6 gateway address from rdisc6 output." exit 1 fi echo "Found IPv6 gateway: $ipv6_gateway" # 添加默认 IPv6 路由 ip -6 route add default via "$ipv6_gateway" dev "$INTERFACE" # 检查是否成功添加路由 if [[ $? -eq 0 ]]; then echo "Successfully added default IPv6 route via $ipv6_gateway on $INTERFACE." else echo "Error: Failed to add default IPv6 route." fi 

Meanwhile, to run above script automatically in boot-up time, you might want to create a file named /etc/systemd/system/configure-ipv6.service with below content:

[Unit] Description=Configure IPv6 address and Add IPv6 Default Route via Script After=network-online.target Wants=network-online.target [Service] Type=oneshot ExecStart=/PATH/TO/YOUR/SCRIPT/configure_ipv6.sh # Check the answer for the content RemainAfterExit=true [Install] WantedBy=multi-user.target 

and then run below CLI to make sure it would be ran in boot-up time:

sudo systemctl daemon-reload sudo systemctl enable configure-ipv6 

Check the status:

sudo systemctl status configure-ipv6 
0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.