Здраствуйте!
Прошу оказать помощь вот в каком вопросе - есть тестовая схема, в которой клиенты не получают адреса по DHCP.
В роли опорного коммутатора выступает D-link DGS 3610-26G с адресом XXX.XXX.138.202 (vlan 10), на котором нужно реализовать DHCP relay. По схеме, которую нужно реализовать, на каждый коммутатор доступа идет один отдельный влан (3601, 3602 и т.д.), а Д-линк должен релеить пакеты из клиентских вланов в влан сервера. DHCP сервер настроен на FREEbsd с адресом YY.YY.40.138 (vlan 100). В роли свитчей доступа выступают edge-core 3510ma dc с настроенным option 82, к которым подключают клиентов (Vlan 3601, 3602). С Д-линка адрес dhcp сервера пингуется.
Конфиг DGS 3610-26G :
vlan 1
vlan 10
name mgmt
vlan 100
name serv
vlan 3601
vlan 3602
!
service dhcp
ip helper-address YY.YY.40.138
!
!
interface GigabitEthernet 0/13
switchport mode trunk
switchport trunk allowed vlan remove 1-9,11-3600,3602-4094
!
interface GigabitEthernet 0/14
switchport mode trunk
switchport trunk allowed vlan remove 1-9,11-3601,3603-4094
!
!
interface GigabitEthernet 0/24
switchport mode trunk
switchport trunk allowed vlan remove 1-9,11-99,101--4094
storm-control broadcast level 5
mtu 9216
spanning-tree bpdufilter enable
description magistral
!
interface VLAN 261
no ip proxy-arp
ip address XXX.XXX.138.202 255.255.255.0
!
interface VLAN 262
no ip proxy-arp
!
interface VLAN 3601
no ip proxy-arp
ip address 192.168.2.1 255.255.255.0
!
interface VLAN 3602
no ip proxy-arp
ip address 192.168.3.1 255.255.255.0
!
!
ip route 0.0.0.0 0.0.0.0 XXX.XXX.138.1
!
end
DHCP.conf
# dhcpd.conf
default-lease-time 720000;
max-lease-time 720000;
min-lease-time 720000;
option domain-name-servers YY.YY.40.4;
autoritative;
log-facility local7;
shared-network "clients-test" {
subnet 192.168.2.0 netmask 255.255.255.0 {
option routers 192.168.2.1;
class "VLAN3601-port1" {
match if binary-to-ascii(16, 8, ":", suffix(option agent.remote-id, 6))= "70:72:cf:4a:7a:10"
and binary-to-ascii(10, 8, "", suffix( option agent.circuit-id, 1))= "1";
}
pool { range 192.168.2.20 ; allow members of "VLAN3601-port1"; }
class "VLAN3601-port2" {
match if binary-to-ascii(16, 8, ":", suffix(option agent.remote-id, 6))= "70:72:cf:4a:7a:10"
and binary-to-ascii(10, 8, "", suffix( option agent.circuit-id, 1))= "2";
}
pool { range 192.168.2.21 ; allow members of "VLAN3601-port2"; }
}
subnet 192.168.3.0 netmask 255.255.255.0 {
option routers 192.168.3.1;
class "VLAN3602-port1" {
match if binary-to-ascii(16, 8, ":", suffix(option agent.remote-id, 6))= "70:72:cf:4a:64:40"
and binary-to-ascii(10, 8, "", suffix( option agent.circuit-id, 1))= "1";
}
pool { range 192.168.3.20 ; allow members of "VLAN3602-port1"; }
}
subnet XXX.XXX.138.0 netmask 255.255.255.0 { }
subnet YY.YY.40.128 netmask 255.255.255.224 { }
}
if exists agent.circuit-id
{
log(info, concat("Lease for "
," IP ", binary-to-ascii(10, 8, ".", leased-address)
," MAC ", binary-to-ascii(16, 8, ":", suffix(option agent.remote-id, 6))
," port ", binary-to-ascii(10, 8, "", suffix( option agent.circuit-id, 1))
," VLAN ", binary-to-ascii(10, 16, "", substring(option agent.circuit-id, 2, 2))
)
);
}
Пример настройки edge-core 3510ma dc:
<stackingDB>00</stackingDB>
!<stackingMac>01_70-72-cf-4a-7a-10_01</stackingMac>
!
vlan database
VLAN 1 name DefaultVlan media ethernet state active
VLAN 10 media ethernet state active
VLAN 3601 media ethernet state active
!
interface ethernet 1/1
switchport allowed vlan add 3601 untagged
!
interface ethernet 1/8
switchport allowed vlan add 1 untagged
switchport mode trunk
switchport allowed vlan add 1,10,3601 tagged
ip dhcp snooping trust
!
interface vlan 1
ip address dhcp
!
interface vlan 10
ip address XXX.XXX.138.203 255.255.255.0
!
ip default-gateway XXX.XXX.138.1
!
ip dhcp snooping
ip dhcp snooping vlan 3601
ip dhcp snooping information option
!
!
interface vlan 1
!
interface vlan 10
!
end
DHCP Discover пакеты доходят до DGS-3610 - он их релеит на адрес сервера, но почему-то DHCPOFFER от сервера не доходят к клиенту. Вот что пишет в своих логах сервер:
Nov 30 12:29:55 serv dhcpd: Lease for IP 192.168.2.21 MAC 70:72:cf:4a:7a:10 port 2 VLAN 3601
Nov 30 12:29:55 serv dhcpd: DHCPDISCOVER from 00:00:f0:88:9c:84 (computer-44410b) via 192.168.2.1
Nov 30 12:29:55 serv dhcpd: DHCPOFFER on 192.168.2.21 to 00:00:f0:88:9c:84 (computer-44410b) via 192.168.2.1
Nov 30 12:30:00 serv dhcpd: Lease for IP 192.168.2.21 MAC 70:72:cf:4a:7a:10 port 2 VLAN 3601
Nov 30 12:30:00 serv dhcpd: DHCPDISCOVER from 00:00:f0:88:9c:84 (computer-44410b) via 192.168.2.1
Nov 30 12:30:00 serv dhcpd: DHCPOFFER on 192.168.2.21 to 00:00:f0:88:9c:84 (computer-44410b) via 192.168.2.1
Nov 30 12:30:09 serv dhcpd: Lease for IP 192.168.2.21 MAC 70:72:cf:4a:7a:10 port 2 VLAN 3601
Nov 30 12:30:09 serv dhcpd: DHCPDISCOVER from 00:00:f0:88:9c:84 (computer-44410b) via 192.168.2.1
Nov 30 12:30:09 serv dhcpd: DHCPOFFER on 192.168.2.21 to 00:00:f0:88:9c:84 (computer-44410b) via 192.168.2.1
Nov 30 12:30:25 serv dhcpd: Lease for IP 192.168.2.21 MAC 70:72:cf:4a:7a:10 port 2 VLAN 3601
Nov 30 12:30:25 serv dhcpd: DHCPDISCOVER from 00:00:f0:88:9c:84 (computer-44410b) via 192.168.2.1
Nov 30 12:30:25 serv dhcpd: DHCPOFFER on 192.168.2.21 to 00:00:f0:88:9c:84 (computer-44410b) via 192.168.2.1
А вот что в логах 3610:
*Nov 30 12:31:06: %7: [DHCP_SNP]:recv dhcp packet
*Nov 30 12:31:06: %7: [DHCP_SNP]:pkt info dst-mac:ffff.ffff.ffff,src-mac 0000.f0
88.9c84
*Nov 30 12:31:06: %7: [DHCP_SNP]:pkt info src-ip:0.0.0.0,dst-ip:255.255.255.255
from port 13
*Nov 30 12:31:06: %7: [DHCP_SNP]:Packet type : DHCP Discover
*Nov 30 12:31:06: %7: [DHCP_SNP]:op = 1 htype = 1 hlen = 6 hops = 0xid = 1c80
cf58 secs = 7424 flags = 8000
*Nov 30 12:31:06: %7: [DHCP_SNP]:ciaddr = 0.0.0.0 yiaddr = 0.0.0.0 siaddr = 0.
0.0.0 giaddr = 0.0.0.0 chaddr = 0000.f088.9c84
*Nov 30 12:31:06: %7: [DHCP_SNP]:start deal input request process
*Nov 30 12:31:06: %7: [DHCP_SNP]:forword dest mac ffff.ffff.ffff to every trust
port
*Nov 30 12:31:06: %7: [DHCP_SNP]:forword request packet to port 24,vid = 3601 pk
t_len 368
*Nov 30 12:31:06: %7: [DHCP_SNP]:output process recv request pkt
*Nov 30 12:31:06: %7: dhcpd listen on udp port 67
*Nov 30 12:31:06: %7: recvmsg:dest_ip=255.255.255.255,src_netif=VLAN 3601,intf_i
ndex=7697,len=24
*Nov 30 12:31:06: %7: recvmsg:l2_index = 13
*Nov 30 12:31:06: %7: recvmsg:vrf_index = 0
*Nov 30 12:31:06: %7: recv dhcp packet from 0.0.0.0(7697), len=326
*Nov 30 12:31:06: %7: dhcp packet process, from 0.0.0.0.
*Nov 30 12:31:06: %7: [DHCP RELAY]dhcp relay receive request packet.
*Nov 30 12:31:06: %7: [DHCP RELAY]dhcp relay get first ip 192.168.2.1 at nif 769
7 ret 0
*Nov 30 12:31:06: %7: [DHCP RELAY]dhcp_relay_get_agent_base_info ret -2
*Nov 30 12:31:06: %7: [DHCP RELAY]get switch type 2
*Nov 30 12:31:06: %7: [DHCP RELAY]send to server ХХ.ХХ.40.138
*Nov 30 12:31:06: %7: [DHCP RELAY]get source ip (192.168.2.1) success
*Nov 30 12:31:06: %7: [DHCP RELAY]relay request unicast
*Nov 30 12:31:06: %7: [DHCP_SNP]:output process recv request pkt
Вот что показал сниффер на сервере:
TIME: 2011-11-30 12:26:12.215
IP: ХХ.ХХ.40.138 (5c:f3:fc:26:bb:da) > 192.168.2.1 (00:1f:6d:92:7c:1b)
OP: 2 (BOOTPREPLY)
HTYPE: 1 (Ethernet)
HLEN: 6
HOPS: 1
XID: 1ff1b866
SECS: 3584
FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 192.168.2.21
SIADDR: 0.0.0.0
GIADDR: 192.168.2.1
CHADDR: 00:00:f0:88:9c:84:00:00:00:00:00:00:00:00:00:00
SNAME: .
FNAME: .
OPTION: 53 ( 1) DHCP message type 2 (DHCPOFFER)
OPTION: 54 ( 4) Server identifier ХХ.ХХ.40.138
OPTION: 51 ( 4) IP address leasetime 720000 (1w1d8h)
OPTION: 1 ( 4) Subnet mask 255.255.255.0
OPTION: 3 ( 4) Routers 192.168.2.1
OPTION: 6 ( 4) DNS server ХХ.ХХ.40.4
OPTION: 82 ( 18) Relay Agent Information
Circuit-ID 00:04:0e:11:01:02 Circuit-ID 02:08 Remote-ID 00:06:70:72:cf:4a:7a:10
---------------------------------------------------------------------------
Не судите строго, возможно допустил ошибку, но из-за отсутствия опыта не могу ее обнаружить.