From Web Design to ERP — Your IT Partner

Troubleshooting Common OVH Gateway Issues in Ubuntu

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

Copy code

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

Copy code

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

Log in to the OVH control panel.

Ensure your failover IP is associated with a virtual MAC address.

Assign the virtual MAC to your server's network interface:

bash

Copy code

sudo ip link set dev ens18 address <VIRTUAL_MAC>

b. Add the Default Route with Scope Link

Force the system to treat the gateway as link-scoped:

bash

Copy code

sudo ip route add default via 148.113.1.254 dev ens18 scope link

c. Enable Proxy ARP

Temporarily enable it:

bash

Copy code

echo 1 | sudo tee /proc/sys/net/ipv4/conf/ens18/proxy_arp

Make it persistent:

bash

Copy code

sudo nano /etc/sysctl.conf

Add:

plaintext

Copy code

net.ipv4.conf.ens18.proxy_arp = 1

Apply the changes:

bash

Copy code

sudo sysctl -p

d. Use Static ARP for Gateway

If the gateway does not resolve, manually add its MAC address:

bash

Copy code

sudo arp -s 148.113.1.254 <GATEWAY_MAC>

e. Check Network Configuration

Ensure the correct IP and gateway:

bash

Copy code

ip addr show

ip route

Test connectivity:

bash

Copy code

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

Copy code

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.