Comprehensive data protection for all workloads
Post Reply
brintaz
Lurker
Posts: 2
Liked: never
Joined: Oct 31, 2012 10:25 am
Full Name: Fabrizio Brintazzoli
Contact:

Re-IP linux server

Post by brintaz »

Hi! Does anybody knows how to apply Re-IP rules to linux server? Thank you!
Vitaliy S.
VP, Product Management
Posts: 27371
Liked: 2799 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Re-IP linux server

Post by Vitaliy S. »

Hi Fabrizio, re-IP is only supported for Windows VMs at this time. Thank you!
tsightler
VP, Product Management
Posts: 6035
Liked: 2860 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Re-IP linux server

Post by tsightler »

You can use a simple in-guest script to do this outside of Veeam itself. This exact process varies based on the specific Linux distribution, but I previously used a simple script that I included in rc.local that would attempt to ping the default gateway, and if it failed, it updated to the secondary IP address. I think there was an example posted to this forum previously.
Gostev
Chief Product Officer
Posts: 31804
Liked: 7298 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Re-IP linux server

Post by Gostev » 2 people like this post

Below is Tom's post from internal forums regarding this:

At my old job we used a script in rc.local (for the non-linux versed, it's run during each boot). The script would attempt to ping the default gateway and, if it failed, would swap the network configuration and restart the network services. It was something like this:

Code: Select all

#!/bin/sh
TARGET=`ip route | awk '/default via/ {print $3}'`
RET=`ping -c $PACKETS $TARGET 2> /dev/null | awk '/packets received/ {print $4}'`

if [ "$RET" -ne "$PACKETS" ]; then
     echo "Gateway unreachable...swapping to secondary network."
     mv /etc/sysconfig/network /etc/sysconfig/network.pri
     mv /etc/sysconfig/network.sec /etc/sysconfig/network 
     service network restart
else
      echo "Network is up via $TARGET"
fi
The above is just a concept, our actual script was a quite a bit more sophisticated, but the point is it's pretty easy to deal with the issue.
brintaz
Lurker
Posts: 2
Liked: never
Joined: Oct 31, 2012 10:25 am
Full Name: Fabrizio Brintazzoli
Contact:

Re: Re-IP linux server

Post by brintaz »

Thank you very much !!! :-) Fabrizio
tsightler
VP, Product Management
Posts: 6035
Liked: 2860 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Re-IP linux server

Post by tsightler »

This particular script was used with Redhat based variants, probably RHEL4 and RHEL5. It would likely need some tweaks and changes for newer versions or other distros like Ubuntu.
pwjohnston
Novice
Posts: 7
Liked: never
Joined: Mar 18, 2014 3:38 pm
Contact:

Re: Re-IP linux server

Post by pwjohnston »

Does anyone know of a script that would Re-IP Linux (SLES & RHEL) from the DR side with say PowerCLI or VIX API?
tsightler
VP, Product Management
Posts: 6035
Liked: 2860 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Re-IP linux server

Post by tsightler » 2 people like this post

I haven't tested this with recent RHEL variants, but PowerCLI has a Set-VMGuestNetworkInterface command that certainly worked back in the RHEL5 days and actually was extensible with custom scripts for other Linux. It's use was relatively simple:

Code: Select all

$cred = Get-Credential
$interface = Get-VMGuestNetworkInterface -VM lnx01 -GuestCredential ($cred) | ?{ $_.Ip -like "192.168.1.*"}
Set-VMGuestNetworkInterface -VMGuestNetworkInterface $interface -Ip 192.168.2.10 -Netmask 255.255.255.0 -Gateway 192.168.2.1 -GuestCredential $cred
So this would attempt to find an interface currently in the 192.168.1.0 subnet and would change the IP address of that interface to 192.168.2.10. Obviously you could get more complex to do cooler things like network mapping. I tested this in my lab on a RHEL5 VM (vSphere 5.5 infrastructure) and the IP changed. You must of course have VMware tools installed in the guest VM.
pwjohnston
Novice
Posts: 7
Liked: never
Joined: Mar 18, 2014 3:38 pm
Contact:

Re: Re-IP linux server

Post by pwjohnston »

Awesome, thanks tsightler!
Nir
Lurker
Posts: 1
Liked: never
Joined: Dec 02, 2014 3:07 pm
Full Name: Nir
Contact:

[MERGED] Re-IP scripts for Linux

Post by Nir »

Hello everyone,

I'm trying to come up with a Bash-based solution for Re-IP functionality in Linux.
Has anyone here succeeded in creating a working Re-IP functionality for Linux systems, specifically RHEL 6 and 7?

I've been looking around and found https://www.vmware.com/support/develope ... rface.html
Which states it works only on various Windows systems and on RHEL 5.

If anyone has a working solution I would greatly appreciate it if you would be willing to share it with me.


Thanks in advance,
Nir.
jeffsterv
Novice
Posts: 6
Liked: never
Joined: May 09, 2016 2:41 pm
Full Name: Jeff
Contact:

Re: Re-IP linux server

Post by jeffsterv »

Now that I have a requirement to do this and it's been almost five years since this the topic was brought up... does anyone know if-and-or-when the feature will be supported?
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Re-IP linux server

Post by veremin »

We cannot provide any comments regarding future product versions. So, for now the in-guest re-ip script is the only way to go. Thanks.
joebranca
Enthusiast
Posts: 52
Liked: never
Joined: Oct 28, 2015 9:36 pm
Full Name: Joe Brancaleone
Contact:

Re: Re-IP linux server

Post by joebranca »

Are there any updated best practices or planned functionality for the topic of re-IP on Linux replicas? Someone posted a script above that worked pretty well until we started deploying RHEL8, so I'm just wondering how folks are handling some kind of automated network reconfigs for Linux failover processes.
joebranca
Enthusiast
Posts: 52
Liked: never
Joined: Oct 28, 2015 9:36 pm
Full Name: Joe Brancaleone
Contact:

Re: Re-IP linux server

Post by joebranca »

Following up on my inquiry last week, have Veeam engineers or any users come up with an updated Linux script solution that works with RHEL 8 commands and resolves the hardware address conflict created by the failed over and power up Veeam process?

In the Linux script under RHEL 8, neither bouncing the network services nor NetworkManager services have any effect on network interface changes performed dynamically using the nmcli command.

In the new (DR) environment, the HWADDR paramenter in the ifcfg-<DEVICE> (e.g. ifcfg-ens192) file is initializzed to the old (PROD) hardware address but in the new (DR) environment, a different hardware address is assigned. This hardware address conflict is preventing the network interface from coming up and allowing the Linux script to perform its re-IP steps.
joebranca
Enthusiast
Posts: 52
Liked: never
Joined: Oct 28, 2015 9:36 pm
Full Name: Joe Brancaleone
Contact:

Re: Re-IP linux server

Post by joebranca »

bump
RomanK
Veeam Software
Posts: 745
Liked: 191 times
Joined: Nov 01, 2016 11:26 am
Contact:

Re: Re-IP linux server

Post by RomanK »

Hello Joe,

I have asked our QA engineer in case they have some scripts for RHEL 8 but unfortunately without luck. No best practices either. However, the topic is interesting, I cannot promise a lot but we'll research.

Thanks
Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 122 guests