Koozali.org: home of the SME Server

Force eth1 to try and get IP from ISP

Dan Williams

Force eth1 to try and get IP from ISP
« on: February 24, 2003, 06:50:23 PM »
Hi,
In Alberta Canada Telus (one of our ISP's) require that the MAC address of the NIC connecting to the ADSL modem be registered with them.
I have done this and it works, EXCEPT when we power down, or re-boot the server.
No errors or anything, just does not get an IP from Telus.
Our resolution is to log in to the console and do this:
/etc/rc.d/init.d/network restart
This works flawlessly every time but is very inconvenient.
Is there a way after the server boot up to have it continue to try and renew that connection to Telus on eth1? Or has someone else has the same problems with a better solution?
Thanks,
Dan

Jon Blakely

Re: Force eth1 to try and get IP from ISP
« Reply #1 on: February 24, 2003, 11:52:27 PM »
Dan

The easiest way would be to add the line

/etc/rc.d/init.d/network restart

to /etc/rc.d/rc.local

This will force a network restart when you power up or reboot

Jon

Dan Williams

Re: Force eth1 to try and get IP from ISP
« Reply #2 on: February 24, 2003, 11:57:05 PM »
Hi Jon,
Will doing this force it to request an IP on eth1 until it gets it?
This won't loop, or mess anything up will it?
What if, perhaps the ISP is down, and this command stays running? It would mess up access to user home directories and open files?
Dan

Ronald Tanis

Re: Force eth1 to try and get IP from ISP
« Reply #3 on: February 25, 2003, 10:31:37 AM »
Try dhcpd eth1

this will get you an ip adres from the server

With regards,
Ronald

jeroen

Re: Force eth1 to try and get IP from ISP
« Reply #4 on: February 25, 2003, 11:19:17 PM »
Ronald Tanis wrote:
>
> Try dhcpd eth1
>
> this will get you an ip adres from the server
>
> With regards,
> Ronald

Getting the following error when trying this:
No subnet declaration for eth1 (xxx.xxx.xxx.xxx).
Please write a subnet declaration in your dhcpd.conf file for the
network segment to which interface eth1 is attached.
exiting.

jeroen

Dan Williams

Re: Force eth1 to try and get IP from ISP
« Reply #5 on: February 27, 2003, 03:16:09 AM »
Hi Ronald,
Where would a person put this script?
All I want to assure is that if the client's Server has to be rebooted that it will continue to request an IP for eth1 from the ISP.?

Dan Williams

Re: Force eth1 to try and get IP from ISP
« Reply #6 on: March 01, 2003, 05:09:56 PM »
Hi Ronald,
Sorry to bother you on this, I just do not want to render anything not useable.
In the file /*etc/rc.local* where do I add this part "dhcpd eth1"
At the end of the file (immediately after the last line?)
And, will this try and run until it gets the IP from the ISP, or just run once?
Thanks,
Dan

Robert

Re: Force eth1 to try and get IP from ISP
« Reply #7 on: March 05, 2003, 07:21:12 PM »
dhcpd is the command to start the DHCP server daemon. The command to start the DHCP client daemon is dhcpcd. However, you shouldn't put either command in rc.local. Depending on your server's configuration these services will already be started by /etc/rc.d/init.d/network and /etc/rc.d/init.d/dhcpd. Do 'ps -A |grep dhcp' to see if they're running. If you're not getting an IP from your ISP, the problem is probably not that dhcpcd isn't running. Have a look at /var/log/messages to see what the real problem is.