Od dłuższego czasu walczę z konfiguracją DHCP na dwie podsieci, która to pierwsza będzie mieć dostęp do internetu i adresy IP będą przydzielane na sztywno przez dhcpd. A druga podsieć będzie przydzielać IP dynamicznie (również przez dhcpd), i nie będzie mieć dostępu do internetu tylko po lanie.
Wszystko działa jeżeli chodzi o autoryzowane MAC-ki. Nie działa w przypadku gdy MAC ADDRESS nie jest dodany do listy wówczas DHCPD powinien przydzielić mu z drugiej puli (subneta), a tego nie robi.
Na obecną chwilę skonfigurowałem to w ten sposób:
Kod: Zaznacz cały
# dhcpd.conf
#
authoritative;
shared-network Inter {
# ETH 1
subnet 192.168.5.0 netmask 255.255.255.0 {
default-lease-time 600;
option domain-name-servers 62.179.1.63, 62.179.1.62;
option routers 192.168.5.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.5.255;
host GW { # Nasz Komputer
hardware ethernet 00:1F:D0:84:72:2C;
fixed-address 192.168.5.6;
}
host Laptop-WIFI { # Wspolny
hardware ethernet 00:15:c5:0c:1e:9a;
fixed-address 192.168.5.10;
}
host TEL { # Linksys_i_tel
hardware ethernet 00:1D:7E:D5:72:4B;
fixed-address 192.168.5.100;
}
host Paulina { #
hardware ethernet 00:19:db:20:5b:6b;
fixed-address 192.168.5.7;
}
}
# Obcy - nieautoryzowani
# ETH 1:101
subnet 10.10.0.0 netmask 255.255.255.0 {
range 10.10.0.10 10.10.0.100;
default-lease-time 600;
option routers 10.10.0.1;
option subnet-mask 255.255.255.0;
option broadcast-address 10.10.0.255;
}
}
/etc/default/dhcp-server
Kod: Zaznacz cały
INTERFACES="eth1 eth1:101"
Kod: Zaznacz cały
eth1 Link encap:Ethernet HWaddr 00:30:4f:35:2c:2d
inet addr:192.168.5.1 Bcast:192.168.5.255 Mask:255.255.255.0
inet6 addr: fe80::230:4fff:fe35:2c2d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5045508 errors:86 dropped:0 overruns:0 frame:66
TX packets:7737866 errors:0 dropped:0 overruns:3 carrier:0
collisions:0 txqueuelen:1000
RX bytes:984167791 (984.1 MB) TX bytes:390144545 (390.1 MB)
Interrupt:11 Base address:0xd000
eth1:101 Link encap:Ethernet HWaddr 00:30:4f:35:2c:2d
inet addr:10.10.0.1 Bcast:10.10.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:11 Base address:0xd000
Kod: Zaznacz cały
Mar 20 18:16:08 S-Home dhcpd: No subnet declaration for eth1:101 (0.0.0.0).
Mar 20 18:16:08 S-Home dhcpd: ** Ignoring requests on eth1:101. If this is not what
Mar 20 18:16:08 S-Home dhcpd: you want, please write a subnet declaration
Mar 20 18:16:08 S-Home dhcpd: in your dhcpd.conf file for the network segment
Mar 20 18:16:08 S-Home dhcpd: to which interface eth1:101 is attached. **
# OFFTOPIC
Ponadto chciałbym zrobić to wszystko (ale to później) na IPv6 wstępnie bawię się konfiguracją, lecz mój dhcp3 tj. nie miał możliwości obsługiwania adresów v6 przy konfiguracji:
Kod: Zaznacz cały
# dhcpd.conf
#
subnet6 2001:xxx:12a::/48 {
range6 2001:xxx:12a::129 2001:xxx:12a::254;
option dhcp6.name-servers fec0:0:0:1::1;
option dhcp6.domain-search "domena.pl";
host ws {
host-identifier option dhcp6.client-id 00-01-00-01-14-8D-1A-28-00-1F-D0-84-72-2C;
fixed-address6 2001:xxx:12a::110; }
}
Kod: Zaznacz cały
# /etc/init.d/dhcp3-server restart
dhcpd self-test failed. Please fix the config file.
The error was:
Internet Systems Consortium DHCP Server V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
/etc/dhcp3/dhcpd.conf line 4: semicolon expected.
subnet6 2001:
^
Configuration file errors encountered -- exiting