• This topic has 1 reply, 2 voices, and was last updated March 2, 2022 by Ben N.

Re-ip script

  • can someone help, I’m doing a poc and have one vm inside a vpg and trying to test the failover re-ip script. on the DR ZVM I have my c:\scripts\failover_reip.ps1 script.

    which I’ve added to the post-recovery script on the vpg. I’m trying it work, the script is very simple and just changes the first 2 octets of the original ip. below is the script. can someone point me in the right direction. when it failsover to the new network which is on completely different subnet and portgroup, there is no connectivity until its re-ip.

     

    $ip = Get-NetIPAddress | Where-Object {$_.IPAddress -like “10.100*”}
    $ipbefore = $ip.IPv4Address
    $octets = $ipbefore.Split(“.”)
    $octets[0] = “192”
    $octets[1] = “168”
    $ipafter = $octets -join “.”
    #################################################
    $ipconfig = Get-NetIPConfiguration -InterfaceIndex $ip.ifIndex
    $gw = $ipconfig.ipv4defaultgateway.nexthop
    $gwoctects = $gw.split(“.”)
    $gwoctects[0] = “10”
    $gwoctects[1] = “106”
    $gwafter = $gwoctects -join “.”
    Remove-NetIPAddress -IPAddress $ipbefore -InterfaceIndex $ip.ifIndex -DefaultGateway $gw -PrefixLength 24 -Confirm:$false

    New-NetIPAddress -InterfaceIndex $ip.ifIndex -IPAddress $ipafter -PrefixLength 24 -DefaultGateway $gwafter
    Set-DnsClientServerAddress -InterfaceIndex $ip.ifIndex -ServerAddresses (“10.100.160.107″,”10.0.0.2”)
    #Remove-NetIPAddress -IPAddress $ipbefore -InterfaceIndex $ip.ifIndex -DefaultGateway $gwoctects -PrefixLength 24
    ipconfig /registerdns

    Hello Romelito,
    Ben from Zerto support here.

    We will be happy to assist you with Re-IP issues,
    Can you please open a support case with us?
    Thank you and have a nice day

The forum ‘Support Q & A’ is closed to new topics and replies.