Mam następujący problem. Posiadam komputer z dwiema kartami sieciowymi eth1, która jest podłączona do internetu i eth0, która jest podpięta do sieci wewnętrznej. Chciałbym na tym komputerze uruchomić serwer dhcp dla sieci wewnętrznej w taki sposób, aby w zależności od tego jaki adres MAC ma komputer kliencki w sieci wewnętrznej to otrzymywał odpowiedni adres IP z konkretnej podsieci. W tym celu utworzyłem następującą konfigurację:
/etc/network/interfaces
Kod: Zaznacz cały
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# WAN INTERFACE <-- NIEISTOTNY
auto eth1
iface eth1 inet dhcp
#LAN_1 INTERFACE
auto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
#LAN_2 INTERFACE
auto eth0:0
iface eth0:0 inet static
address 192.168.2.1
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
Kod: Zaznacz cały
# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/isc-dhcp-server by the maintainer scripts
#
# This is a POSIX shell fragment
#
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth0 eth0:0"
Kod: Zaznacz cały
shared-network test {
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.1;
range 192.168.1.2 192.168.1.20;
}
subnet 192.168.2.0 netmask 255.255.255.0 {
option routers 192.168.2.1;
option subnet-mask 255.255.255.0;
range 192.168.2.2 192.168.2.20;
}
}
host user1 {hardware ethernet 00:C0:9F:70:2A:40; fixed-address 192.168.1.20;}
host user2 {hardware ethernet 00:19:99:25:04:F6; fixed-address 192.168.2.20;}
Kod: Zaznacz cały
reboot isc-dhcp-server
Kod: Zaznacz cały
No subnet declaration for eth0:0 (no IPv4 addresses).
Ignoring requests on eth0:0. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface eth0:0 is attached. **
Czy ktokolwiek mógłby mi z tym pomóc? Ewentualnie, jeśli faktycznie się nie da, to, czy ktoś zna sposób obejścia wymienionego problemu bez wkładania dodatkowej karty sieciowej do komputera?