Disable static IP access automatically once DHCP is enabled
by rk_25 from LinuxQuestions.org on (#5H5FQ)
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?


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?