Veeam – Re-visit Linux Re-IP

I wrote a blog post back in 2013 , //www.cragdoo.co.uk/veeam-replication-linux-vm-failover/, on how to Re-IP Linux VMs. This week I have been working on the same thing , for a customer’s DR replication and I’ve come across a couple of improvements/changes that can be made to make the process a little easier.

Script Update

So the 1st thing I came across is a missing ‘|’ and some funky issue with inverted commas/apostrophes , this may have been a typo or a formatting issue with the cut and paste, so here is the updated script

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

#!/bin/bash

#Ping DR bounce node

ping-c1-t1192.168.110.7&gt;/dev/dull;

if[$?-eq0];then

#Ping successful so change ip address to DR network range

ifconfig eth0172.20.2.59netmask255.255.255.0;

route add defaultgw172.20.2.1eth0;

else

#Cannot ping address so back in live environment change ip back if still set to DR

address=$(ifconfig eth0|grep"inet addr:"|cut-d:-f2|awk'{print $1}')

if[$address='172.20.2.59'];then

ifconfig eth0192.168.110.59netmask255.255.255.0;

route add defaultgw192.168.110.253eth0;

fi

fi

Runlevel

In the original post I hadn’t mentioned the location of rc.local , this is located in /etc/

While dealing with the customer setup, for some unknown reason I had been placing the link to the script in /etc/rc3.d , however the VM in question was using run level 2, you can check this by performing :-