Introduction

OVH, a leading hosting provider, often requires custom network configurations for its failover IPs and gateways. However, users frequently face challenges like unreachable gateways or invalid nexthop errors, especially in Ubuntu. This guide provides practical solutions for resolving these issues and optimizing your OVH network configuration.


1. Common OVH Gateway Issues

a. Unreachable Gateway

  • Symptom: When attempting to ping the gateway, you see:
    bash
    ping: connect: Network is unreachable
  • Cause: The OVH gateway often resides outside the assigned IP subnet, requiring special handling (e.g., proxy ARP).

b. Nexthop Has Invalid Gateway

  • Symptom: Adding a default route fails with:
    bash
    Error: Nexthop has invalid gateway.
  • Cause: The system cannot resolve the gateway due to OVH’s unique networking setup.

2. Key Steps to Troubleshoot OVH Gateway Issues

a. Verify Failover IP Configuration

  1. Log in to the OVH control panel.
  2. Ensure your failover IP is associated with a virtual MAC address.
  3. Assign the virtual MAC to your server’s network interface:
    bash
    sudo ip link set dev ens18 address <VIRTUAL_MAC>

b. Add the Default Route with Scope Link

  1. Force the system to treat the gateway as link-scoped:
    bash
    sudo ip route add default via 148.113.1.254 dev ens18 scope link

c. Enable Proxy ARP

  1. Temporarily enable it:
    bash
    echo 1 | sudo tee /proc/sys/net/ipv4/conf/ens18/proxy_arp
  2. Make it persistent:
    bash
    sudo nano /etc/sysctl.conf

    Add:

    plaintext
    net.ipv4.conf.ens18.proxy_arp = 1
  3. Apply the changes:
    bash
    sudo sysctl -p

d. Use Static ARP for Gateway

  1. If the gateway does not resolve, manually add its MAC address:
    bash
    sudo arp -s 148.113.1.254 <GATEWAY_MAC>

e. Check Network Configuration

  1. Ensure the correct IP and gateway:
    bash
    ip addr show
    ip route
  2. Test connectivity:
    bash
    ping 148.113.1.254

3. FAQs

1. Why is the OVH gateway outside my IP subnet?

  • OVH uses proxy ARP to route traffic through its infrastructure, requiring special configurations.

2. What is proxy ARP, and why is it needed?

  • Proxy ARP allows the server to respond to ARP requests on behalf of the gateway, enabling communication outside the subnet.

3. How do I fix “Nexthop has invalid gateway”?

  • Add the gateway with scope link:
    bash
    sudo ip route add default via <GATEWAY_IP> dev <INTERFACE> scope link

4. Why is my OVH failover IP not working?

  • Ensure the IP is assigned to a virtual MAC and that the MAC is set on the interface.

5. Can I switch to DHCP to fix this?

  • No, OVH requires static IP configuration for its failover IPs.

4. Conclusion

Troubleshooting OVH gateway issues in Ubuntu requires a combination of proper IP assignment, proxy ARP configuration, and static routes. By following these steps, you can ensure seamless connectivity for your servers. If you’re setting up VMs on OVH, don’t miss our Proxmox VM configuration guide for detailed steps and best practices.