I am going to upgrade my network from 64 to 128 IPs. Of course I don't want to change it manually on all 40+ VMs. I plan to use an ansible ad-hoc command with sed -i and then use the same to restart the interfaces. I have tried but and I have found - thank you guys - a solution how to replace the slash in the address, but I still need to carry the last octet of the IP address as a variable into the output. This here works but only partially
What I want:
My partially-working sed command with escaped slashes:
sed 's/address\ 220.127.116.11\/26/address\ 18.104.22.168\/27/g' interfaces.bak
How do I keep the '3' in this example?