PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : DHCP config unterschiedliche adressen an eth0 und eth1



basti1985
05.08.09, 11:16
ist es irgendwie möglich einem dhcp server begreiflich zu machen, dasss wenn anfragen über eth0 kommen adress pool 1 und bei anfragen über eth1 pool 2 zu benutzen ?

client anfragen an eth1 kommen von einem dhcp-relay (192.168.1.254) ...
und diese brauchen unbedingt adressen die im 192.168.1.xx bereich liegen
bekommen aber derzeit adressen die im 192.168.0.xx liegen, es sei den ich binde die adresse an die mac (was nicht wirklich eine alternative darstellt, bei 50-70 clients)

anfragen die der dhcp server an eth0 beantwortet hingegen sollen und müssen weiter 192.168.0.xx adressen bekommen

muell200
05.08.09, 11:45
ist es irgendwie möglich einem dhcp server begreiflich zu machen, dasss wenn anfragen über eth0 kommen adress pool 1 und bei anfragen über eth1 pool 2 zu benutzen ?


mhh.. auf die schnelle 2 dhcp server starten
einerauf eth1
einer auf eth0

m.o.o.
05.08.09, 11:46
Wie schaut denn deine dhcpd.conf bis jetzt aus?
Mein Wissen ist nur theoretisch, aber kann man das nicht mit der subnet-Option angeben?

basti1985
05.08.09, 11:56
dhcp.conf


cat /etc/dhcp3/dhcpd.conf
#
# Debian Edu configuration masterfile
#
# Contents of this file should be in
#
# /etc/dhcp3/dhcpd.conf
#
#
# DHCP configuration for Debian Edu server
#
# $Id: dhcpd-debian-edu.conf 34207 2007-06-04 15:32:49Z pere $

# New option necessary for dhcp3
ddns-update-style none;
#WPAD autoconfiguration
option wpad-url code 252 = text;
authoritative;

shared-network INTERNAL {

default-lease-time 1800; #30 m
max-lease-time 3600; #1 h

option subnet-mask 255.255.254.0;
option broadcast-address 10.0.3.255;
option routers gateway;
option domain-name-servers tjener;
option domain-name "intern";
option ntp-servers ntp;
option wpad-url "http://10.0.2.2/wpad.dat";

# Log to the main server
option log-servers tjener;

# If you use window clients, comment out the following lines.
# Samba wins support has to be turned on (wins support = yes)
#
# # WINS server
option netbios-name-servers tjener;
option netbios-node-type 8;


#Automatic assigning addresses to workstations
#There is room for approxmatly 400 workstations.

subnet 10.0.2.0 netmask 255.255.254.0 {
range 10.0.2.100 10.0.3.242;
}

# Group defines thinclientservers
# Add the hardware address to the thinclientserver here
# To add an other thinclientserver, use "host ltspserver00" as an example
# fixed address area for thin client servers is 10.0.2.10 to 10.0.2.29

# Added by Sebastian (2009-07-14)
# 2nd Terminal-Server
group {
host ltspserver00 {
hardware ethernet 00:50:04:EE:89:8E;
fixed-address ltspserver00;
}

host ltspserver01 {
hardware ethernet 00:00:00:00:00:00;
fixed-address ltspserver01;
}
# 20 printers are defined as printer00 to printer19 on 10.0.2.30-49
# Provide a static address using dhcp by adding their MAC addresses here

# Added by Dirk Heuschkel (2009-07-20) Konica change static IP 10.0.2.10 to DHCP
# Erster Drucker wird der Konica Minolta Di2510
host printer00 {
hardware ethernet 00:0D:02:31:B8:2F;
fixed-address printer00;
}
# Added by Dirk Heuschkel (2009-07-29) Oki C5700 (Colorlaser)
host printer01 {
hardware ethernet 00:80:87:0b:9d:93;
fixed-address printer01;
}

host printer02 {
hardware ethernet 00:00:00:00:00:00;
fixed-address printer02;
}

host printer03 {
hardware ethernet 00:00:00:00:00:00;
fixed-address printer03;
}
# 50 workstations are defined as static00 to static49 on 10.0.2.50-99
# Provide a static address using dhcp by adding their MAC addresses here

host static00 {
hardware ethernet 00:d0:59:cf:2a:7f;
fixed-address static00;
}
host static01 {
hardware ethernet 00:00:00:00:00:00;
fixed-address static01;
}
host static02 {
hardware ethernet 00:00:00:00:00:00;
fixed-address static02;
}
host static03 {
hardware ethernet 00:00:00:00:00:00;
fixed-address static03;
}
}
}

shared-network THINCLIENTS {
default-lease-time 432000; # 5 d
max-lease-time 432000; # 5 d

option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers ltspserver;
option domain-name-servers tjener;
option domain-name "intern";
option root-path "/opt/ltsp/i386";

option ntp-servers ntp;

# Log to the LTSP server, and let it forward the messages.
option log-servers ltspserver;

filename "/var/lib/tftpboot/ltsp/i386/pxelinux.0";

## Changes done by Sebastian (2009-07-21)
# subnet 192.168.0.0 for clients on tjener
# subnet 192.168.1.0 for cleints on TS

subnet 192.168.0.0 netmask 255.255.255.0 {
# At least some thin clients will work out of the box, appearing as
# ltsp200 to ltsp253.
# We still recommend defining fixed mac adress to ip adress mappings,
# cf. examples and explanations below.
range 192.168.0.200 192.168.0.253 ;
# pxelinux in etch is very slow without this setting.
next-server 192.168.0.254;
}

## 2nd subnet on TS

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.200;
next-server 192.168.1.254;
option routers 192.168.1.254;
}

group {
next-server 192.168.0.254;
use-host-decl-names on;
option log-servers ltspserver ;

################################################## ################################
#
# We recommend defining fixed mac adress (a.k.a. hardware ethernet adress) to
# ip adress mappings.
#
# Entries for actual use (ltsp010 to ltsp019) below:
#
# NOTE: After editing entries below, dhcpd MUST BE RESTARTED by the below
# commands and THE THIN CLIENT IN QUESTION BE REBOOTED for changes
# to take effect:
#
# /etc/init.d/dhcp3-server stop; /etc/init.d/dhcp3-server start
#
#
host ltsp010 {
hardware ethernet 00:00:39:00:27:95;
fixed-address ltsp010;
filename "/var/lib/tftpboot/ltsp/i386/pxelinux.0";
}
host ltsp011 {
hardware ethernet 00:d0:59:a8:c1:d0;
fixed-address ltsp011;
filename "/var/lib/tftpboot/ltsp/i386/pxelinux.0";
}
host ltsp012 {
hardware ethernet 00:d0:59:cf:37:d0;
fixed-address ltsp012;
filename "/var/lib/tftpboot/ltsp/i386/pxelinux.0";
}
host ltsp013 {
hardware ethernet 00:d0:59:d7:09:f1;
fixed-address ltsp013;
filename "/var/lib/tftpboot/ltsp/i386/pxelinux.0";
}
host ltsp014 {
hardware ethernet 00:d0:59:ce:0b:73;
fixed-address ltsp014;
filename "/var/lib/tftpboot/ltsp/i386/pxelinux.0";
}
host ltsp015 {
hardware ethernet 00:d0:59:b5:2d:83;
fixed-address ltsp015;
filename "/var/lib/tftpboot/ltsp/i386/pxelinux.0";
}
host ltsp016 {
hardware ethernet 00:d0:59:b6:0c:fc;
fixed-address ltsp016;
filename "/var/lib/tftpboot/ltsp/i386/pxelinux.0";
}
host ltsp017 {
hardware ethernet 00:d0:59:d7:82:aa;
fixed-address ltsp017;
filename "/var/lib/tftpboot/ltsp/i386/pxelinux.0";
}
host ltsp018 {
hardware ethernet 00:d0:59:a8:4e:25;
fixed-address ltsp018;
filename "/var/lib/tftpboot/ltsp/i386/pxelinux.0";
}

host ltsp019 {
hardware ethernet 00:d0:59:b8:7b:dc;
fixed-address ltsp019;
filename "/var/lib/tftpboot/ltsp/i386/pxelinux.0";
}
host ltsp020 {
hardware ethernet 00:d0:59:d7:83:69;
fixed-address ltsp020;
filename "/var/lib/tftpboot/ltsp/i386/pxelinux.0";
}
host ltsp021 {
hardware ethernet 00:90:27:8a:fe:47;
fixed-address ltsp021;
filename "/var/lib/tftpboot/ltsp/i386/pxelinux.0";
}
host ltsp022 {
hardware ethernet 00:d0:b7:2d:18:47;
fixed-address ltsp022;
filename "/var/lib/tftpboot/ltsp/i386/pxelinux.0";
}

# ltsp host on TS2

host ltsp025 {
hardware ethernet 00:50:ba:f8:89:51;
fixed-address 192.168.1.25;
filename "/var/lib/tftpboot/ltsp/i386/pxelinux.0";
option routers 192.168.1.254;
next-server 192.168.1.254;

}

host ltsp026 {
hardware ethernet 00:05:5d:d9:48:fe;
fixed-address 192.168.1.26;
filename "/var/lib/tftpboot/ltsp/i386/pxelinux.0";
option routers 192.168.1.254;
next-server 192.168.1.254;
option subnet-mask 255.255.255.0;

}

}
}

host ltsp025 und host ltsp026 sind nur testweise da mit eingetragen wäre natürlich schon wenn diese per deflaut diese adresse bekommen (ohne mac bindung)

drcux
05.08.09, 22:26
ist es irgendwie möglich einem dhcp server begreiflich zu machen, dasss wenn anfragen über eth0 kommen adress pool 1 und bei anfragen über eth1 pool 2 zu benutzen ?

Ja, das ist sogar normal, wenn du den DHCP auf zwei Adressen lauschen lässt. Zum dhcpd kann ich nur nix sagen, weil mir der zu "groß" ist, stehe mitlerweile auf dnsmasq... ;)