|
From: Lee G. <ra...@ze...> - 2006-08-24 13:15:14
|
> Yup... I wish there was a 'partial dhcp' implementation - something
> where I could say, "hey, give me the current gateway and dns servers".
> I have a few computers that travel, their IPs don't change but the
> gateway and dns info do....
There are two possible solutions for this problem: a client-side and
a server-side one.
client-side:
In /etc/network/interfaces, add a post-up line, for example
iface eth0 inet dhcp
post-up ifconfig eth0 XX.XX.XX.XX
What it does, after dhclient gets all the info and sets the
interface up, it changes the IP adress to XX.XX.XX.XX.
server-side:
Add following lines to your /etc/dhcp(3)/dhcpd.conf:
# Declaration of the subnet
subnet 10.0.0.0 netmask 255.0.0.0 {
host mybox {
hardware ethernet XX:XX:XX:XX:XX:XX;
fixed-address YYY.YYY.YYY.YYY;
}
}
This only works if you have ISC dhcp server running. X is your mac
address and Y is your "static" IP.
The server-side solution is IMHO better because the client-side one
will overwrite you IP everytime it updates its lease. If your lease
time is too short, it may be more of a pita than any help.
Greetings,
Lee
|