Adalbert Prokop wrote:
Peter Horst wrote on Sunday 30 September 2007:
> I have a Fedora machine I'm using as a home server, without a keyboard
> or monitor. I'd like to set it up such that upon rebooting it first
> checks to see if there is a DHCP server on the network, and if so,
> grabs an ip address from it. But if there isn't one, it assigns itself
> a static address. Is this doable?
Yes, it's possible, but I agree with Jacques and Ed, that it is not
desirable. A server should use a static address. So much for an advise.
What you want is possible using dhclient hooks. Those are scripts called
by dhclient. Depending on the status dhclient provides to them they can
do anything a script can do. "man dhclient-script" is your friend.
I use those scripts on my notebook to setup IPv4LL addresses (local link
adresses, 169.254.0.0) if there is no DHCP server available. Together
with Avahi they make ad-hoc networks really easy.
I attach both dhclient-hooks as example how to use hooks. They both live
in /etc and should be executable.
[Warning: second question attached :-) ]
Thanks for all the help and advice - sorry, I could have described the
situation better - the actual problem I'm trying to solve here has to do
with trying to find a wireless router that I can use with my Linux
server (with a static address).
I used to have a Linksys WRT54GX4, which was great until it stopped
working, and I had to spend hours on the phone with customer service
reps dumber than me, and the RMA replacement arrived DOA. The Linksys
had the ability to function as a switch (wrong word?) - that is, it
would pass traffic straight through to two machines on my internal
network, both of which had static, public IP addresses - one, the
server, connected via CAT5, and the other, a Windows laptop, connected
wirelessly.
Because of the customer-services & quality-control issues Linksys was
having, I tried switching to a Zyxel X-550 wireless router.
Unfortunately it does not seem to have the ability to cope properly with
public IP addresses on my internal network.
So I thought that if it were an simple matter to configure my Linux
server in the way I've described, it would make the (temporary) process
of fiddling around with various bits of networking equipment easier.
So, all that being said, do you have any technical recommendations?
Hope I have adequately described the problem...
Thanks -