• Webconn Technology
    • GPU Server
      • Dedicated GPU Servers with NVIDIA RTX/A100 GPUs for accelerated AI training, rendering, and scientific computing. Features CUDA cores, 24GB-141GB VRAM, and parallel processing. Pre-configured with TensorFlow/PyTorch.

      • nvidia rtx A6000
    • Dedicated Server
      • Experience blazing-fast speeds & ironclad security with your own dedicated server. No shared resources. Fully customizable plans for gaming, e-commerce, and big data. Start now!

      • datacenter
    • Shared Hosting
      • Get user-friendly DirectAdmin shared hosting for your website. Enjoy an intuitive control panel, one-click app installs, and reliable performance. Perfect for blogs, small business sites, and portfolios.

      • shared hosting web
    • Domains
      • Search and register the perfect domain name for your website. Get a memorable .com, .net, .org or niche TLD to start building your brand online. Includes free privacy protection.

    • VPS
      • Experience the power of a dedicated server without the high cost. Our VPS hosting guarantees CPU, RAM, and storage for your site, ensuring optimal performance and stability.

      • data center
  • Blog
  • Dashboard

How to add Equal Cost Multipath Route [ECMP] to IP Routing?

You can add ECMP routes with the following command.

ip route add 172.16.0.0/24 
    nexthop via 10.0.1.1 dev ethX weight 1 
    nexthop via 10.0.2.1 dev ethY weight 1

Alternatively, you can use two separate commands, the second of which appends to the existing route.

ip route add 172.16.0.0/24 nexthop via 10.0.1.1 dev ethX weight 1
ip route append 172.16.0.0/24 nexthop via 10.0.2.1 dev ethY weight 1

You can either add all the nexthops at once or append them to an existing route to create an ECMP route.

The above steps show how to use CONFIG_IP_ROUTE_MULTIPATH if it is enabled in the kernel.

Note: You can use the above steps if adding two routes results in an error as below.

# ip route add DESTINATION via GATEWAY1 dev NET1 metric 1000
# ip route add DESTINATION via GATEWAY2 dev NET2 metric 1000
RTNETLINK answers: File exists

Comments

Leave a Reply