Here is my scenario:
A is a provisioning server and B is an client. Whenever there is any change in B’s setup, it uploads the appropriate config file to A.
I am working as an automation engineer to automate it. One of the scenario says to disconnect A from network or stop the server A. perform some changes to B and make sure that B failed to upload the files to provisioning server A.
To automate it, the simple way to stop the server A and do the appropriate actions.
Since A and B are also used for other purposes by other parties so I can not either disconnect A or B from network OR stop the server at A.
So, I am looking forward for any solution so that I can simulate the host (provisioning server) unreachable scenario. So when B will send an update to A it will fail but in actual A is running as usual.
Please suggest me some way to achieve it.
I am using Perl as a programming language but I am fine if solution is available in other language.
I’ve done this before using a null route. This is something that best done from the shell with the ip command.
Depending on your use case, an unreachable route may work better, as it returns ICMP-unreachable instead of discarding the packets, although they tend to have the same effect.
And for thoroughness, if you really wanted to simulate a host-unreachable situation (vs a network-unreachable), you would have to do that at the firewall level.