I have a linux machine configured with both static IP and DHCP. I got a requirement that when the linux machine got IP using DHCP then that linux machine should only be accessible using DHCP IP, It should never be accessible by static IP which was configured already manually.
But when DHCP is down then the linux machine needs to be accessible by static IP automatically.
For example: -> LinuxMachine is configured manually with static IP 192.168.1.1. - > the same machine is configured with DHCP(client) enabled -> Now the machine got DHCP IP 192.168.1.15 (Automatically) after bootup
Requirement is the Linux machine to be accessible by DHCP IP 192.168.1.15 only and it should not be accessible by static IP 192.168.1.1.
Is this possible to disable/enable static IP access automatically?