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 » Oct 31, 2012 10:48 am

Hi! Does anybody knows how to apply Re-IP rules to linux server? Thank you!

Vitaliy S.
Product Manager
Posts: 22760
Liked: 1519 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Re-IP linux server

Post by Vitaliy S. » Oct 31, 2012 12:03 pm

Hi Fabrizio, re-IP is only supported for Windows VMs at this time. Thank you!

tsightler
VP, Product Management
Posts: 5378
Liked: 2211 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Re-IP linux server

Post by tsightler » Oct 31, 2012 12:29 pm

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
SVP, Product Management
Posts: 24431
Liked: 3405 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Re-IP linux server

Post by Gostev » Oct 31, 2012 12:50 pm 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 » Oct 31, 2012 1:05 pm

Thank you very much !!! :-) Fabrizio

tsightler
VP, Product Management
Posts: 5378
Liked: 2211 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Re-IP linux server

Post by tsightler » Oct 31, 2012 1:19 pm

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 » Apr 03, 2014 8:20 pm

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: 5378
Liked: 2211 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Re-IP linux server

Post by tsightler » Apr 03, 2014 9:24 pm 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 » Apr 04, 2014 6:16 pm

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 » Dec 02, 2014 3:17 pm

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 » Feb 17, 2017 4:57 pm

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: 16669
Liked: 1390 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Re-IP linux server

Post by veremin » Feb 18, 2017 10:19 am

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.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 32 guests