WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: how to disable udhcpc (/etc/init.d/dhcp.sh) ?  (Read 1467 times)

Offline lovelypp

  • Jr. Member
  • **
  • Posts: 51
how to disable udhcpc (/etc/init.d/dhcp.sh) ?
« on: March 21, 2023, 08:28:09 PM »
I want to use static ip when bootup.  but when bootup, it always get a dynamic ip.
thanks!

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1499
Re: how to disable udhcpc (/etc/init.d/dhcp.sh) ?
« Reply #1 on: March 21, 2023, 08:44:45 PM »
The nodhcp boot code does just that.

You'll probably have to write a script or add a boot time command to bootlocal.sh to set your static ip.


Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11589
Re: how to disable udhcpc (/etc/init.d/dhcp.sh) ?
« Reply #2 on: March 21, 2023, 09:52:11 PM »
Hi lovelypp
I have the attached script in my  /opt  directory. I call it
from  /opt/bootlocal.sh  like this:
Code: [Select]
/opt/eth0.sh
The  pkill udhcpc  line disables  dhcp.
Adjust the  nameserver  lines to point where you want your DNS look-ups to be handled.


Offline lovelypp

  • Jr. Member
  • **
  • Posts: 51
Re: how to disable udhcpc (/etc/init.d/dhcp.sh) ?
« Reply #3 on: March 27, 2023, 06:22:11 AM »
thanks.
I use the nodhcp bootcode and it solved.