All Products
Search
Document Center

Alibaba Cloud Linux:What do I do if I cannot query or configure the routing information of an Alibaba Cloud Linux 2 instance?

Last Updated:Dec 08, 2023

This topic describes the cause of the following issue and how to resolve the issue: You cannot query or configure the routing information of an Elastic Compute Service (ECS) instance that runs Alibaba Cloud Linux 2.

Problem description

You cannot query or configure the routing information of an instance that meets the following conditions:

  • Image: aliyun-2.1903-x64-20G-alibase-20190507.vhd or earlier

  • Kernel: kernel-4.19.34-11.al7 or earlier

Symptoms:

  • You cannot query the existing route table that is used by the instance. Sample scenario:

    Note

    The following commands are provided for reference only. Modify the commands based on your actual business requirements.

    1. Run the following command to create a route table:

      ip -4 route add default via 192.168.0.253 dev eth1 table 1001
    2. Run the following command to view information of the route table. After you run the command, the command output does not contain information of the route table.

      ip route list table 1001
    3. Run the following command to re-create a route table:

      ip -4 route add default via 192.168.0.253 dev eth1 table 1001

      After you run the command, the command output contains the File exists error message.

      RTNETLINK answers: File exists
  • You cannot configure policy-based routes for the instance. After you run the following command to create a policy-based route for the instance, the command output contains the Operation not supported error message.

    ip -4 rule add from 192.168.0.68 loopup 1001

Cause

Policy-based routes must use the CONFIG_IP_MULTIPLE_TABLES module. However, the CONFIG_IP_MULTIPLE_TABLES module is disabled for the kernel version kernel-4.19.34-11.al7 or earlier.

Solution

Configure and enable the modules that are required by policy-based routes for the kernel version kernel-4.19.36-12.al7.x86_64 or later.

CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_FIB_RULES=y
# CONFIG_NET_VRF is not set

To resolve the issue, upgrade your kernel version to kernel-4.19.36-12.al7.x86_64 or later.