1 |
Ow Mun Heng wrote: |
2 |
> |
3 |
> Yes, while those are perfectly valid solutions and I do utilise such a |
4 |
> solution for me when I switch from Home to Work/Work to Home. (which |
5 |
> does not cover yet DHCP) |
6 |
> |
7 |
> I'm hoping that there is a better way via a deny script for mac addrs. |
8 |
|
9 |
Do you reboot when you go from work to home? If so, have two grub |
10 |
kernel entries. Label one entry Home and the other Work. Have the Home |
11 |
kernel entry have an extra kernel command line option like so: |
12 |
|
13 |
title=Gentoo Linux (Home) |
14 |
root (hd0,0) |
15 |
kernel /boot/kernel-2.6.15-gentoo-r1 root=/dev/sda1 NO-DHCP |
16 |
extra boot option ^^^^^^^ |
17 |
|
18 |
Now just modify your /etc/init.d/ script for DHCP to look for NO-DHCP in |
19 |
/proc/cmdline. Now you can use grep: |
20 |
|
21 |
|
22 |
grep NO-DHCP /proc/cmdline |
23 |
FOUND=$? |
24 |
if [ $FOUND -eq 0 ]; then |
25 |
# NO-DHCP was found in boot cmdline, don't start DHCP |
26 |
else |
27 |
# NO-DHCP was NOT found in boot cmdline, start DHCP |
28 |
fi |
29 |
|
30 |
|
31 |
I have never had a need to run a DHCP server so there is probably a way |
32 |
to do it with DHCP. However, this is Linux and Linux was made for |
33 |
tinkering, so use whatever you like best. : ) |
34 |
|
35 |
Jim |
36 |
-- |
37 |
gentoo-user@g.o mailing list |