Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!
Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.
Konfiguruję DHCP dla dwóch sieci:
eth1 -->10.0.0.0/255.0.0.0
eth2 -->192.168.1.0/255.0.0.0
Dla sieci eth1 działa bez problemu.
Natomiast dla sieci eth2 nie przydziela adresu po DHCP.
logi w /var/log/syslog dla zapytań na eth1:
Aug 26 12:19:56 sandol2 dhcpd: DHCPDISCOVER from 00:0d:56:13:92:a4 via eth1 Aug 26 12:19:57 sandol2 dhcpd: DHCPOFFER on 10.0.5.170 to 00:0d:56:13:92:a4 (admin-q5d5ldem7) via eth1 Aug 26 12:19:57 sandol2 dhcpd: DHCPREQUEST for 10.0.5.170 (10.0.5.1) from 00:0d:56:13:92:a4 (admin-q5d5ldem7) via eth1 Aug 26 12:19:57 sandol2 dhcpd: DHCPACK on 10.0.5.170 to 00:0d:56:13:92:a4 (admin-q5d5ldem7) via eth1 Aug 26 12:20:33 sandol2 dhcpd: DHCPINFORM from 10.0.5.170 via eth1 Aug 26 12:20:33 sandol2 dhcpd: DHCPACK to 10.0.5.170 (00:0d:56:13:92:a4) via eth1
oraz dla zapytań na eth2:
Aug 26 12:39:10 sandol2 dhcpd: DHCPDISCOVER from 00:0d:56:13:92:a4 (admin-q5d5ldem7) via eth2 Aug 26 12:39:10 sandol2 dhcpd: DHCPOFFER on 192.168.1.170 to 00:0d:56:13:92:a4 (admin-q5d5ldem7) via eth2 Aug 26 12:39:27 sandol2 dhcpd: DHCPDISCOVER from 00:0d:56:13:92:a4 (admin-q5d5ldem7) via eth2 Aug 26 12:39:27 sandol2 dhcpd: DHCPOFFER on 192.168.1.170 to 00:0d:56:13:92:a4 (admin-q5d5ldem7) via eth2
Widzę, że DHCP nie przesyła DHCPREQUEST i DHCPACK dla eth2 i z tego powodu nie przydziela adresu. Co może być tego powodem?
oto moj /etc/dhcp3/dhcpd.conf:
ddns-update-style=ad-hoc; authoritative; option domain-name "domena.pl"; option domain-name-servers 194.204.159.1,194.204.152.34; default-lease-time 21600; max-lease-time 86400; subnet 10.0.0.0 netmask 255.0.0.0 { range 10.0.5.170 10.0.5.190; option broadcast-address 10.255.255.255; option routers 10.0.5.1; } subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.170 192.168.1.190; option broadcast-address 192.168.1.255; option routers 192.168.1.1; }
Offline
1. /etc/default/dhcp3-server ustawia sie interfejsy na ktorych ma dzialac dhcp
2. skad z tego konfigu dhcpd ma wiedziec ze na eth1 daje 10.0.0.0/255.0.0.0 a na eth2 192.168.1.0/255.0.0.0?
Offline
1. w /etc/default/dhcp3-server wpisałem:
INTERFACES="eth1 eth2"
2. Skąd wie tego nie wiem, ale wie:) Może dlatego, ze interfejs eth1 ma adres 10.0.5.1/8 a eth2 192.168.1.1/24. To że wie widać po wydaniu komendy: dhcpd3
Internet Systems Consortium DHCP Server V3.1.1 Copyright 2004-2008 Internet Systems Consortium. All rights reserved. For info, please visit http://www.isc.org/sw/dhcp/ Wrote 1 leases to leases file. Listening on LPF/eth2/00:04:79:66:93:3f/192.168.1/24 Sending on LPF/eth2/00:04:79:66:93:3f/192.168.1/24 Listening on LPF/eth1/00:04:79:66:97:7f/10/8 Sending on LPF/eth1/00:04:79:66:97:7f/10/8 No subnet declaration for eth0 (x.x.x.x). ** Ignoring requests on eth0. 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 is attached. ** Sending on Socket/fallback/fallback-net There's already a DHCP server running.
Offline
saiqard - koniec arta http://dug.net.pl/tekst/31/udostepnienie_polaczenia_internetowego_(masq)/
Offline
BiExi Zrobiłem to według tego poradnika ale dhcp nie działa dla interfejsu eth1 (10.0.0.0/8).
Narazie zależy mi tylko na uruchomieniu DHCP bez udostępniania połączenia internetowego itd.
Po uruchomieniu DHCP wychodzi w logach:
Multiple interfaces match the same shared network: eth1 eth2
A przy zapytaniach z końcówki po podłączeniu do eth1:
Aug 27 10:18:17 sandol2 dhcpd: DHCPDISCOVER from 00:0d:56:13:92:a4 (admin-q5d5ldem7) via eth1 Aug 27 10:18:17 sandol2 dhcpd: DHCPOFFER on 192.168.1.170 to 00:0d:56:13:92:a4 (admin-q5d5ldem7) via eth1
A po podłączeniu do eth2:
Aug 27 10:19:19 sandol2 dhcpd: DHCPDISCOVER from 00:0d:56:13:92:a4 (admin-q5d5ldem7) via eth2 Aug 27 10:19:20 sandol2 dhcpd: DHCPOFFER on 192.168.1.170 to 00:0d:56:13:92:a4 (admin-q5d5ldem7) via eth2 Aug 27 10:19:20 sandol2 dhcpd: DHCPREQUEST for 192.168.1.170 (192.168.1.1) from 00:0d:56:13:92:a4 (admin-q5d5ldem7) via eth2 Aug 27 10:19:20 sandol2 dhcpd: DHCPACK on 192.168.1.170 to 00:0d:56:13:92:a4 (admin-q5d5ldem7) via eth2
Plik /etc/network/interfaces:
auto lo iface lo inet loopback allow-hotplug eth0 iface eth0 inet static address x.x.x.251 netmask 255.255.255.248 network x.x.x.248 broadcast x.x.x.255 gateway x.x.x.249 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 194.204.159.1 dns-search sanatoria-dolnoslaskie.pl allow-hotplug eth1 iface eth1 inet static address 10.0.5.1 netmask 255.0.0.0 allow-hotplug eth2 iface eth2 inet static address 192.168.1.1
firewall:
#!/bin/bash echo "1" > /proc/sys/net/ipv4/ip_forward echo "1" > /proc/sys/net/ipv4/conf/all/rp_filter #ladujemy moduly dla ftp modprobe ip_conntrack modprobe ip_conntrack_ftp #usuniecie wszystkich regol filtra i czyszczenie tablic iptables -F iptables -F -t nat iptables -F -t mangle #domyslnie przepuszczamy wszystko iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT #dopuszczamy prace na interfejsie lokalnym iptables -A INPUT -s 127.0.0.1 -j ACCEPT iptables -A OUTPUT -d 127.0.0.1 -j ACCEPT
/etc/default/dhcp3-server:
INTERFACES="eth1 eth2"
/etc/dhcp3/dhcpd.conf:
ddns-update-style=ad-hoc; authoritative; option domain-name "sandol2.sanatoria-dolnoslaskie.pl"; option domain-name-servers 194.204.159.1,194.204.152.34; default-lease-time 21600; max-lease-time 86400; shared-network sharedname { subnet 10.0.0.0 netmask 255.0.0.0 { range 10.0.5.170 10.0.5.190; option broadcast-address 10.255.255.255; option routers 10.0.5.1; } subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.170 192.168.1.190; option broadcast-address 192.168.1.255; option routers 192.168.1.1; } }
Offline
Twój konfig zadziała, jak na jednym kablu masz 2 podsieci. Mając 2 podsieci na różnych interfejsach konfig powinien wyglądać tak:
ddns-update-style=none; authoritative; option domain-name "sandol2.sanatoria-dolnoslaskie.pl"; option domain-name-servers 194.204.159.1,194.204.152.34; default-lease-time 21600; max-lease-time 86400; subnet 10.0.0.0 netmask 255.0.0.0 { range 10.0.5.170 10.0.5.190; option broadcast-address 10.255.255.255; option routers 10.0.5.1; } subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.170 192.168.1.190; option broadcast-address 192.168.1.255; option routers 192.168.1.1; }
Ostatnio edytowany przez pasqdnik (2009-08-27 11:32:43)
Offline
pasqdnik rzeczywiście mam 2 podsieci na różnych interfejsach, ale po zmianie konfiguracji na podaną przez Ciebie nic się nie zmienia. Czyli problem musi tkwić gdzieś indziej.
I jeśli jest tak jak mówisz, to w artykule podanym przez BiExi jest błąd w konfiguracji dhcp.conf dla 2 kart sieciowych.
Offline
SOA #1 ;)
router:~# cat /etc/dhcp3/dhcpd.conf option domain-name "XXX"; option domain-name-servers 217.30.129.149, 217.30.137.200; option routers 192.168.1.1; default-lease-time 3600; athoritative; subnet 192.168.1.0 netmask 255.255.255.240 { range 192.168.1.2 192.168.1.5; option domain-name "XXX"; option domain-name-servers 217.30.129.149, 217.30.137.200; option routers 192.168.1.1; option broadcast-address 192.168.1.15; default-lease-time 72000; max-lease-time 144000; } subnet 10.0.0.0 netmask 255.255.255.0 { range 10.0.0.3 10.0.0.10; option domain-name "XXX"; option domain-name-servers 217.30.129.149, 217.30.137.200; option routers 10.0.0.1; option broadcast-address 10.0.0.255; default-lease-time 72000; max-lease-time 144000; } host pasqdnik { hardware ethernet 00:23:54:c6:c4:52; fixed-address 192.168.1.14; } router:~#
A czy przez przypadek na eth0 nie masz adresu z puli 10.0.0.0/8 ?
Offline
A czy przez przypadek na eth0 nie masz adresu z puli 10.0.0.0/8 ?
na eth0 mam zewnętrzny adres IP 79.190.x.x
na eth1 wewnętrzny adres 192.168.1.1
na eth2 wewnętrzny adres 10.0.5.1
Dodam jeszcze że robię to na czystej instalacji debiana. Czyli zmienione są tylko te konfigi, które wypisałem w tym temacie.
Ostatnio edytowany przez saiqard (2009-08-28 07:48:47)
Offline
EDIT: Bzdura - kac.
I nie przeklepuj konfigów, tylko przeczytaj manuala do dhcpd.conf - dowiesz się co znaczy dyrektywa shared-network i jak ważne są klamerki w odpowiednich miejscach,
Some installations have physical networks on which more than one IP subnet operates. For example, if there is a site-wide requirement that 8-bit subnet masks be used, but a department with a single physical ethernet network expands to the point where it has more than 254 nodes, it may be necessary to run two 8-bit subnets on the same ethernet until such time as a new physical network can be added. In this case, the subnet declarations for these two networks must be enclosed in a shared-network declaration.
The shared-network statement is used to inform the DHCP server that some IP subnets actually share the same physical network. Any subnets in a shared network should be declared within a shared-network statement. Parameters specified in the shared-network statement will be used when booting clients on those subnets unless parameters provided at the subnet or host level override them. If any subnet in a shared network has addresses available for dynamic allocation, those addresses are collected into a common pool for that shared network and assigned to clients as needed. There is no way to distinguish on which subnet of a shared network a client should boot.
EDIT: Zmień w /etc/network/interfaces wpis dot. eth1 na
auto eth1
iface eth1 inet static
address 10.0.0.1
netmask 255.0.0.0
Powinno zabanglać, jak nie zadziała to nie wiem już czemu. Kaca mam.
Ostatnio edytowany przez pasqdnik (2009-08-28 10:33:55)
Offline
W /etc/network/interfaces jest zadeklarowany adres dla eth1 10.0.5.1 i maska 255.0.0.0, czyli sieć jest taka sama jak w dhcpd.conf: 10.0.0.0/8.
Z angielskim niestety u mnie nie jest najlepiej:(
Ale jeśli dobrze rozumie, to shared-network używa się jeśli na jednym interfejsie fizycznym chcemy zadeklarować więcej jak jedną podsieć dla DHCP.
Czyli w moim wypadku dhcpd.conf powinien wyglądać tak:
ddns-update-style=none; authoritative; option domain-name "san.pl"; option domain-name-servers 194.204.159.1,194.204.152.34; default-lease-time 21600; max-lease-time 86400; subnet 10.0.0.0 netmask 255.0.0.0 { range 10.0.5.170 10.0.5.190; option broadcast-address 10.255.255.255; option routers 10.0.5.1; } subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.170 192.168.1.190; option broadcast-address 192.168.1.255; option routers 192.168.1.1; }
Ale niestety przy tych ustawieniach dalej nie działa tak jak powinno
Ostatnio edytowany przez saiqard (2009-08-28 09:56:43)
Offline
Sprawdź kable, switche, karty sieciowe. Na wirtualnych maszynach sprawdziłem i wszystko działa.
Offline
Zmieniłem server, karty sieciowe, kable, switche i.... zadziałało:)
Wielkie dzięki wszystkim za pomoc:D
Offline