You are not logged in.

#1 2008-04-30 10:58:04

ecraven
Member
Registered: 2008-04-30
Posts: 5

dhcp fallback

hey,
i'd like eth0 to try dhcp, and if it doesn't receive an answer within 10s or so, fall back to an address i specify! how do i do this?
(i'd like to specify something like eth0="dhcp eth0 192.168...." in rc.conf)

thanks wink

Offline

#2 2008-04-30 11:33:33

keratos
Member
Registered: 2008-04-27
Posts: 138

Re: dhcp fallback

ifconfig reports (or not) a DHCP leased address.

A simple script could be written that retrieves the IP, if not set then the script could call ifconfig

'man bash'
'man ifconfig'

Offline

#3 2008-04-30 14:07:09

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: dhcp fallback

Yes, you will need to custom-make something for this - your suggested rc.conf solution will not work with our network init script. /etc/rc.local would be a good place for whatever you decide to do.

Hmm.. looking at it from a different angle, if you're happy with a static IP some of the time, why not just use a static IP all the time?

Offline

#4 2008-04-30 17:37:43

keratos
Member
Registered: 2008-04-27
Posts: 138

Re: dhcp fallback

tomk wrote:

Hmm.. looking at it from a different angle, if you're happy with a static IP some of the time, why not just use a static IP all the time?

This is the obvious question really isnt it.

I mean, surely a static IP if a better solution ... after all ISPs charge for the privilage, and whats more, static ISPs make network config so simple and LAN setup + firewall admin are a breeze.

Why do you want DHCP anyway?

Offline

Board footer

Powered by FluxBB