Re: basic question about assigning ip address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- 
Bye,
Adalbert

"Mach was the greatest intellectual fraud in the last ten years." "What 
about X?" "I said `intellectual'." ;login, 9/1990

Attachment: dhclient-enter-hooks
Description: application/shellscript

Attachment: dhclient-exit-hooks
Description: application/shellscript

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux