WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Static IP changed to dynamic  (Read 3047 times)

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Static IP changed to dynamic
« on: February 12, 2013, 07:20:56 PM »
Hi all,

I've got mc 3.8.4 running samba 3.4.5 as a file server, its stable.

The server is configured to use a static ip address at boot up.
The server changed its ip address from this static address yesterday and grabbed the next available dynamic address from the ADSL modem router that is at the heart of our small office network.
This happened once a few week's ago and now its happened again, I thought I'd make a post about it.

Config Details:

File : /opt/bootlocal.sh
Code: [Select]
sudo sh /opt/eth0.sh
File : /opt/eth0.sh
Code: [Select]
#!/bin/sh
pkill udhcpc
ifconfig eth0 10.1.1.151 netmask 255.0.0.0 broadcast 10.255.255.255 up
route add default gw 10.1.1.1
echo nameserver 10.1.1.1 > /etc/resolv.conf

Any suggestions are welcome.
Live long and prosper.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Static IP changed to dynamic
« Reply #1 on: February 12, 2013, 08:41:17 PM »
Use the nodhcp boot code.

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: Static IP changed to dynamic
« Reply #2 on: February 12, 2013, 10:02:01 PM »
Ok, I'll do that.

Is mc getting a new IP address for that reason ?
Live long and prosper.

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: Static IP changed to dynamic
« Reply #3 on: February 13, 2013, 06:54:28 AM »
I was always under the impression that without nodhcp the dhcp client is only started once and if you kill it like remus did I don't see where it would get restarted.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Static IP changed to dynamic
« Reply #4 on: February 13, 2013, 10:04:28 AM »
Unless it is still running, there could be no IP assignment.
Check all the scripts in /opt and make sure nothing restarts it.

Offline xyz-worx

  • Jr. Member
  • **
  • Posts: 69
Re: Static IP changed to dynamic
« Reply #5 on: February 13, 2013, 01:12:21 PM »
Hi Remus,

I do nearly the same - using TC 3.8.4 to run a web server (not Apache, only Monkey).
To get always the same IP-address I use my router (a rather old DLink DI-524).
Via DHCP-configuration this router has the ability to deliver always the same IP-address
for a specific PC by using the MAC-address of the ethernet card of this PC. They call
somewhat like 'static DHCP configuration' and 'cloning'.
Maybe you can take a look at the administration of your router, if it has a similar functionality.
My TC works in that way without any special scripts or additional configuration.

Regards

xyz-worx

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Static IP changed to dynamic
« Reply #6 on: February 13, 2013, 04:14:25 PM »
Any chance this could occur in case the interface is not up yet at the time of running that script?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: Static IP changed to dynamic
« Reply #7 on: February 13, 2013, 04:52:42 PM »
That might be it,
with this running in the background it would be a race
[ -z "$DHCP_RAN" ] && /etc/init.d/dhcp.sh &

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: Static IP changed to dynamic
« Reply #8 on: February 13, 2013, 07:26:57 PM »
I've used qremaster to create a custom mc 3.8.4 boot cd with the following boot codes.

syslog showapps nodhcp noautologin

Other than that the boot cd is stock with no merged tce folder or extensions.

This is a bit of a problem, as the server is used by several windows xp machines in a client - server database relationship.

I'm happy to help with any testing, just for specific info, and I'll try to provide it.
Live long and prosper.