LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   DHCP with fixed IPs (https://www.linuxquestions.org/questions/slackware-14/dhcp-with-fixed-ips-303094/)

alithenake 03-18-2005 04:42 AM

DHCP with fixed IPs
 
Hello guys

Please, can you give me any advice regarding this problem: I would like to set-up a network with the following settings:

1. A Slackware 10.1 server connected to Internet with 2 NICs. One to the Internet, the other to the internal network.

2. on the Green interface (internal network) I want to set up a DHCP

3. a client that is connected to the internal network, based on his MAC address will receive always the same IP

4. also, I must have an allow list and only the MACs from that allow list will receive an IP and will connect to internet. Other MACs must be refused and not be granted access to internet.

How to do that ?

Thanks in advance.

egag 03-18-2005 05:52 AM

on the server you can run dnsmasq: it's a dhcp- and cashing dns- server.
it's easy to setup, just take a look at the file /etc/dnsmasq.conf.
edit that file ( there are many examples there ), and make /etc/rc.d/rc.dnsmasq executable.

you'll also have to configure ip-tables to forward package from eth0 to eth1 and vv.

egag

wes103 03-18-2005 07:53 AM

Well, for question 2, you could use dhcpd from http://www.isc.org. You can limit what interfaces it listens on by adding them to the startup commandline, ie "dhcpd eth2".

As for question 3, in their dhcpd v2.0pl5 (admittedly very old, but still does what I need) you would add a line like:

host mymachine {
hardware ethernet XX:XX:XX:XX:XX:XX;
fixed-address YYY.YYY.YYY.YYY;
}

Where mymachine is pretty much just a name field for your sake, but the X's need to change to the MAC address you want fixed, and the Y's need to be the IP address you want to fix it to.

Question 4 seems to want to use the allow and deny keywords mentioned in the man page for dhcpd.conf. I've not used it myself, so can't do much more than point you at it.

-Bill

alithenake 03-18-2005 08:50 AM

actually I managed to do all points, except the allow list .. this is what bothers me... any help on that (with a little example?)

regards

killerbob 03-18-2005 09:02 AM

In dhcpd.conf, you'll probably have a line like:
Code:

allow unknown-clients;
Just change that to:
Code:

deny unknown-clients;
and it should work. If you don't have that line, add it anywhere in your subnet declaration.

Assuming you're using dhcpd. check out "man dhcpd.conf" for more examples of what you can do with it, such as having a specific IP pool for unknown clients, and a completely different pool for known clients. That can be useful, if you're trying to restrict access to your file and print servers, but want to be able to have lan parties where your friends will be able to access the 'net. :)


All times are GMT -5. The time now is 01:53 PM.