Help Center> Virtual Private Cloud> User Guide> Virtual IP Address> Disabling IP Forwarding on the Standby ECS

Disabling IP Forwarding on the Standby ECS

For a Linux ECS:

  1. Log in to standby ECS and run the following command to check whether the IP forwarding is enabled:

    cat /proc/sys/net/ipv4/ip_forward

    In the command output, 1 indicates it is enabled, and 0 indicates it is disabled. The default value is 0.

    • If the command output is 1, perform 2 and 3 to disable IP forwarding.
    • If the command output is 0, no further action is required.
  2. Use the vi editor to open the /etc/sysctl.conf file, change the value of net.ipv4.ip_forward to 0, and enter :wq to save the change and exit. You can also use the sed command to modify the configuration. A command example is as follows:

    sed -i '/net.ipv4.ip_forward/s/1/0/g' /etc/sysctl.conf

  3. Run the following command to make the change take effect:

    sysctl -p /etc/sysctl.conf

For a Windows ECS:

  1. Click Start, scroll down and expand the Windows System folder, click Command Prompt, and run the following command:

    ipconfig /all

    In the command output, if the value of IP Routing Enabled is No, the IP forwarding function is disabled.

  2. Press Windows and R keys together to open the Run box, and enter regedit to open the Registry Editor.
  3. Set the value of IPEnableRouter under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters to 0.
    • If the value is set to 0, IP forwarding will be disabled.
    • If the value is set to 1, IP forwarding will be enabled.