OVH Network IP Failover

carlosepc

Cadet
Joined
Jun 4, 2020
Messages
6
I recently installed the last version of FreeNAS, but I am having issues setting the network. I have an OVH server with Proxmox VE Platform; inside I create a Virtual Server with one of the IP Failover attached to the MAC address assigned from the OVH Console. Now I use the configuration that they provide in the Network OVH Guide, and also examples posted in this forum. Also, I try to do it in the same way that I use in other FreeBSD servers, but in this case, every time that tries to do the same, when I reboot the configuration disappears.

I will provide the steps that I was doing below, but I just want to know if you know a better way to set the network without using the FreeNAS GUI and make persistent this configuration.

This is the setting that OVH Provide:

FreeBSD 12.0
Open a terminal on your virtual machine. Once connected, open the virtual machine’s network configuration file, which is located in /etc/rc.conf. Edit the file so that it includs the configuration below (please remember to replace our variables with your own values. In this example, the inteface name is em0; Adjust if necessary.):

ifconfig_em0="inet FAILOVER_IP netmask 255.255.255.255 broadcast FAILOVER_IP"
static_routes="net1 net2"
route_net1="-net GATEWAY_IP/32 -interface em0"
route_net2="default GATEWAY_IP"

This also what I tried, I used this configuration in regular FreeBSD and pfSense, and work perfectly.

route add -net 198.x.x.254/32 -ifcace em0
route add default 198.x.x.254

Now I create this to run this automatic in the initialization.
create a script ex. route.sh in /usr/local/etc/rc.d/

#!/bin/sh
route add -net 198.x.x.254/32 -ifcace em0
route add default 198.x.x.254

After this make an executable:
chmod +x /usr/local/etc/rc.d/route.sh


Please if you know a way yo make this to work, I am fighting with this for days.

Thanks in advance
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
you must use the UI for any of this to persist, but it should all be perfectly doable ...
 

carlosepc

Cadet
Joined
Jun 4, 2020
Messages
6
you must use the UI for any of this to persist, but it should all be perfectly doable ...
Patrick if you see the example that I add above, I need to do it without the GUI because in order to add the specific routes to work using the OVH IP FAilover the GUI don't allow me to use nothing of this.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
But you can set the ifconfig in the UI, can't you? Then configure your script as a post-startup task (again in the UI) and you should be all set.
 

carlosepc

Cadet
Joined
Jun 4, 2020
Messages
6
Thanks so much Patrick, I didn't know that I can run scripts from the GUI... I add two command there....for OVH
Post Init 5 sec timeout:
route add -net 54.x.x.254/32 -iface vtnet0
Post init 10 sec timeout:
route add default 54.x.x.254

Regards
Carlos Pruna
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Timeout does not mean that the system will wait as long before executing the command. It means the system will wait X seconds for the completion before killing the process.

So better put these commands in a shell script int the correct order (didn't you already do that?) and configure the shell script as the post-startup job.
 

TheMSG

Cadet
Joined
May 15, 2022
Messages
5
Hi everyone. I'd like to revive this thread.

A bit of personal background: I'm an experienced software engineer with 15+ years of experience, always have been working with Linux, mostly Ubuntu. I started renting a dedicated servers with OVH and using Proxmox about 5 years ago. Network is far from being my strength, and I'm struggling with my TrueNAS Core 13 installation.

As a reference, here's the config file I'd be using if I were to configure a new Ubuntu Server which uses netplan (IP's are fake):
Code:
network:
    version: 2
    ethernets:
        ens18:
            addresses:
                - 105.29.51.54/32
            nameservers:
                addresses:
                    - 1.1.1.1
                    - 8.8.8.8
                search: []
            optional: true
            routes:
                - to: 0.0.0.0/0
                  via: 68.74.101.254
                  on-link: true


When I boot my TrueNAS vm, I end up in the "Console Setup" menu, and clearly, everything I need to complete the network configuration is available there. Like I said, network setup isn't my strength at all, so after several hours of trying my best, my vm still has no Internet access.

This is the menu I'm talking about:

Any kind of help would be much appreciated! Thank you.
 

Volts

Patron
Joined
May 3, 2021
Messages
210
TrueNAS doesn't support creation of the "-interface em0" style route in either the Console Setup or the Web UI.

Spray-routing on Ethernet is weird but increasingly common for this type of hosting. Make a Jira request!

The IP address itself can be configured via Console Setup (or the Web UI).
The weird routes can be added in a post-startup script.
 

Volts

Patron
Joined
May 3, 2021
Messages
210
There are some speling erors in OPs post.

I think the script should look like this.
Replace 1.2.3.4 and (possibly) em0 as appropriate.

Code:
#!/bin/sh
route add 1.2.3.4 -interface em0
route add default 1.2.3.4


Test the route ... commands in the shell before creating a script and making it a post-startup job.

Use netstat -rn to view the routing table.
It should be possible to ping the gateway after the first route is installed.
The gateway should be visible in arp -an after pinging it.
 

Volts

Patron
Joined
May 3, 2021
Messages
210
That's a slightly different configuration. If that works - great - it means OVH supports a few different types of configuration. Cool.
 
Top