Re-IP linux server

Availability for the Always-On Enterprise

Re-IP linux server

Veeam Logoby brintaz » Wed Oct 31, 2012 10:48 am

Hi! Does anybody knows how to apply Re-IP rules to linux server? Thank you!
brintaz
Lurker
 
Posts: 2
Liked: never
Joined: Wed Oct 31, 2012 10:25 am
Full Name: Fabrizio Brintazzoli

Re: Re-IP linux server

Veeam Logoby Vitaliy S. » Wed Oct 31, 2012 12:03 pm

Hi Fabrizio, re-IP is only supported for Windows VMs at this time. Thank you!
Vitaliy S.
Veeam Software
 
Posts: 19087
Liked: 1054 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov

Re: Re-IP linux server

Veeam Logoby tsightler » Wed 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.
tsightler
Veeam Software
 
Posts: 4659
Liked: 1680 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: Re-IP linux server

Veeam Logoby Gostev » Wed 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.
Gostev
Veeam Software
 
Posts: 21039
Liked: 2266 times
Joined: Sun Jan 01, 2006 1:01 am
Full Name: Anton Gostev

Re: Re-IP linux server

Veeam Logoby brintaz » Wed Oct 31, 2012 1:05 pm

Thank you very much !!! :-) Fabrizio
brintaz
Lurker
 
Posts: 2
Liked: never
Joined: Wed Oct 31, 2012 10:25 am
Full Name: Fabrizio Brintazzoli

Re: Re-IP linux server

Veeam Logoby tsightler » Wed 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.
tsightler
Veeam Software
 
Posts: 4659
Liked: 1680 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: Re-IP linux server

Veeam Logoby pwjohnston » Thu 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?
pwjohnston
Novice
 
Posts: 7
Liked: never
Joined: Tue Mar 18, 2014 3:38 pm

Re: Re-IP linux server

Veeam Logoby tsightler » Thu 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.
tsightler
Veeam Software
 
Posts: 4659
Liked: 1680 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: Re-IP linux server

Veeam Logoby pwjohnston » Fri Apr 04, 2014 6:16 pm

Awesome, thanks tsightler!
pwjohnston
Novice
 
Posts: 7
Liked: never
Joined: Tue Mar 18, 2014 3:38 pm

[MERGED] Re-IP scripts for Linux

Veeam Logoby Nir » Tue 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/developer/PowerCLI/PowerCLI41U1/html/Get-VMGuestNetworkInterface.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.
Nir
Lurker
 
Posts: 1
Liked: never
Joined: Tue Dec 02, 2014 3:07 pm
Full Name: Nir

Re: Re-IP linux server

Veeam Logoby jeffsterv » Fri 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?
jeffsterv
Lurker
 
Posts: 2
Liked: never
Joined: Mon May 09, 2016 2:41 pm
Full Name: Jeff

Re: Re-IP linux server

Veeam Logoby v.Eremin » Sat 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.
v.Eremin
Veeam Software
 
Posts: 12579
Liked: 906 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to Veeam Backup & Replication



Who is online

Users browsing this forum: Bing [Bot], nmdange, Yahoo [Bot] and 32 guests