Хотел поднять в сети DHCP с опцией 82, но вот проблема какая, все поднято, а работать не хочет. Подозреваю, что дело в конфиге, хотя не факт.
Вот что пишет tshark на попытку получить ip:
- Код: Выделить всё
# tshark -i eth0 -f "port 67 or 68" -V
tshark: Lua: Error during loading:
[string "/usr/share/wireshark/init.lua"]:45: dofile has been disabled
Running as user "root" and group "root". This could be dangerous.
Capturing on eth0
Frame 1: 347 bytes on wire (2776 bits), 347 bytes captured (2776 bits)
Arrival Time: Feb 12, 2013 15:36:57.105448000 YEKT
Epoch Time: 1360661817.105448000 seconds
[Time delta from previous captured frame: 0.000000000 seconds]
[Time delta from previous displayed frame: 0.000000000 seconds]
[Time since reference or first frame: 0.000000000 seconds]
Frame Number: 1
Frame Length: 347 bytes (2776 bits)
Capture Length: 347 bytes (2776 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ip:udp:bootp]
Ethernet II, Src: BrocadeC_74:6f:00 (00:04:80:74:6f:00), Dst: BiostarM_43:26:31 (00:30:67:43:26:31)
Destination: BiostarM_43:26:31 (00:30:67:43:26:31)
Address: BiostarM_43:26:31 (00:30:67:43:26:31)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
Source: BrocadeC_74:6f:00 (00:04:80:74:6f:00)
Address: BrocadeC_74:6f:00 (00:04:80:74:6f:00)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
Type: IP (0x0800)
Internet Protocol Version 4, Src: 10.10.0.1 (10.10.0.1), Dst: 10.10.10.98 (10.10.10.98)
Version: 4
Header length: 20 bytes
Differentiated Services Field: 0x01 (DSCP 0x00: Default; ECN: 0x01: ECT(1) (ECN-Capable Transport))
0000 00.. = Differentiated Services Codepoint: Default (0x00)
.... ..01 = Explicit Congestion Notification: ECT(1) (ECN-Capable Transport) (0x01)
Total Length: 333
Identification: 0x38a5 (14501)
Flags: 0x00
0... .... = Reserved bit: Not set
.0.. .... = Don't fragment: Not set
..0. .... = More fragments: Not set
Fragment offset: 0
Time to live: 64
Protocol: UDP (17)
Header checksum: 0x2284 [correct]
[Good: True]
[Bad: False]
Source: 10.10.0.1 (10.10.0.1)
Destination: 10.10.10.98 (10.10.10.98)
User Datagram Protocol, Src Port: bootps (67), Dst Port: bootps (67)
Source port: bootps (67)
Destination port: bootps (67)
Length: 313
Checksum: 0x2e93 [validation disabled]
[Good Checksum: False]
[Bad Checksum: False]
Bootstrap Protocol
Message type: Boot Request (1)
Hardware type: Ethernet
Hardware address length: 6
Hops: 1
Transaction ID: 0x59e12798
Seconds elapsed: 3
[Expert Info (Note/Malformed): Seconds elapsed (3) appears to be encoded as little-endian]
[Message: Seconds elapsed (3) appears to be encoded as little-endian]
[Severity level: Note]
[Group: Malformed]
Bootp flags: 0x0000 (Unicast)
0... .... .... .... = Broadcast flag: Unicast
.000 0000 0000 0000 = Reserved flags: 0x0000
Client IP address: 0.0.0.0 (0.0.0.0)
Your (client) IP address: 0.0.0.0 (0.0.0.0)
Next server IP address: 0.0.0.0 (0.0.0.0)
Relay agent IP address: 10.90.1.1 (10.90.1.1)
Client MAC address: 30:85:a9:23:10:41 (30:85:a9:23:10:41)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (t=53,l=1) DHCP Message Type = DHCP Discover
Option: (53) DHCP Message Type
Length: 1
Value: 01
Option: (t=61,l=7) Client identifier
Option: (61) Client identifier
Length: 7
Value: 013085a9231041
Hardware type: Ethernet
Client MAC address: 30:85:a9:23:10:41 (30:85:a9:23:10:41)
Option: (t=12,l=6) Host Name = "dns-\217\212"
Option: (12) Host Name
Length: 6
Value: 646e732d8f8a
Option: (t=60,l=8) Vendor class identifier = "MSFT 5.0"
Option: (60) Vendor class identifier
Length: 8
Value: 4d53465420352e30
Option: (t=55,l=12) Parameter Request List
Option: (55) Parameter Request List
Length: 12
Value: 010f03062c2e2f1f2179f92b
1 = Subnet Mask
15 = Domain Name
3 = Router
6 = Domain Name Server
44 = NetBIOS over TCP/IP Name Server
46 = NetBIOS over TCP/IP Node Type
47 = NetBIOS over TCP/IP Scope
31 = Perform Router Discover
33 = Static Route
121 = Classless Static Route
249 = Private/Classless Static Route (Microsoft)
43 = Vendor-Specific Information
Option: (t=82,l=18) Agent Information Option
Option: (82) Agent Information Option
Length: 18
Value: 0108000603e901000003020600030f27a68a
Agent Circuit ID: 000603e901000003
Agent Remote ID: 00030f27a68a
End Option
Из чего нам надо только:
- Код: Выделить всё
Option: (t=82,l=18) Agent Information Option
Option: (82) Agent Information Option
Length: 18
Value: 0108000603e901000003020600030f27a68a
Agent Circuit ID: 000603e901000003
Agent Remote ID: 00030f27a68a
End Option
Получается, что от железа идут запросы с указанием id железа и номера порта.
Вот такое у меня в конфиге:
- Код: Выделить всё
# cat dhcpd.conf
# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
# option definitions common to all supported networks...
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
log-facility local7;
local-address 10.10.14.88;
default-lease-time 600;
max-lease-time 7200;
if exists agent.remote-id {
log ( info, concat(
"Switch MAC:", binary-to-ascii(16, 8, ":", option agent.remote-id),
"Switch port:", binary-to-ascii(10, 8, ".", option agent.circuit-id)
));
}
subnet 10.10.14.88 netmask 255.255.255.255 {
}
subnet 10.90.1.0 netmask 255.255.255.0 {
class "sw01-p01" {
match if binary-to-ascii(16, 8, ":", suffix(option agent.remote-id, 6))="0:3:f:27:a6:8b"
and
binary-to-ascii(10, 8, ".", suffix(option agent.circuit-id, 1)) = "1";
}
class "sw01-p02" {
match if binary-to-ascii(16, 8, ":", suffix(option agent.remote-id, 6))="0:3:f:27:a6:8b"
and
binary-to-ascii(10, 8, ".", suffix(option agent.circuit-id, 1)) = "2";
}
class "sw01-p03" {
match if binary-to-ascii(16, 8, ":", suffix(option agent.remote-id, 6))="0:3:F:27:A6:8B"
and
binary-to-ascii(10, 8, ".", suffix(option agent.circuit-id, 1)) = "3";
}
class "sw01-p04" {
match if binary-to-ascii(16, 8, ":", suffix(option agent.remote-id, 6))="0:3:f:27:a6:8b"
and
binary-to-ascii(10, 8, ".", suffix(option agent.circuit-id, 1)) = "4";
}
class "sw01-p12" {
match if binary-to-ascii(16, 8, ":", suffix(option agent.remote-id, 6))="0:3:F:27:A6:8B"
and
binary-to-ascii(10, 8, ".", suffix(option agent.circuit-id, 2)) = "12";
}
option routers 10.90.1.1;
option subnet-mask 255.255.255.0;
authoritative;
pool {
range 10.90.1.2;
allow members of "sw01-p01";
}
pool {
range 10.90.1.3;
allow members of "sw01-p02";
}
pool {
range 10.90.1.4;
allow members of "sw01-p03";
}
pool {
range 10.90.1.5;
allow members of "sw01-p04";
}
pool {
range 10.90.1.12;
allow members of "sw01-p12";
}
}
По сути, делал по доке производителя. Свитч SNR.
Куда копать?
Как посмотреть эти логи, о которых идет разговор в начале конфига?
Можно ли тестировать эти самые dhcp-eval? или только описание по ним читать и считать на листке?
Заранее спасибо за ответ.
UPD:
Сделал по-тупому:
- Код: Выделить всё
class "sw01-p03" {
match if suffix(option agent.remote-id, 12)="00030f27a68a"
and
suffix(option agent.circuit-id, 16)="000603e901000003";
}
результат не изменился.
UPD2:
Логи достал. проверил. теперь проблема вот какого характера:
Логирование описано так:
- Код: Выделить всё
if exists agent.remote-id {
log ( info, concat(
">>> SwitchMAC:", binary-to-ascii(16, 8, ":", option agent.remote-id),
" SwitchPORT:", binary-to-ascii(10, 8, ".", option agent.circuit-id)
));
}
класс описан так:
- Код: Выделить всё
class "sw01-p03" {
match if
binary-to-ascii(16, 8, ":", suffix(option agent.remote-id, 6))="0:3:f:27:a6:8a"
and
binary-to-ascii(10, 8, ".", suffix(option agent.circuit-id, 1))="3";
}
в этом случае, в логе, отображается такая запись:
- Код: Выделить всё
Feb 13 12:09:58 local dhcpd: >>> SwitchMAC:0:3:f:27:a6:8a SwitchPORT:0.6.3.233.1.0.0.3
стоит мне заменить:
- Код: Выделить всё
binary-to-ascii(10, 8, ".", suffix(option agent.circuit-id, 1))="3";
- Код: Выделить всё
binary-to-ascii(10, 8, ".", suffix(option agent.circuit-id, 1))="0.6.3.233.1.0.0.3";
- Код: Выделить всё
Feb 13 12:21:48 local dhcpd: DHCPDISCOVER from 00:1a:92:fc:f7:0d via 10.90.1.1: network 10.90.1.0/24: no free leases
т.е. ip по какой-то причине не выдается.
Вот так описаны сами пулы:
- Код: Выделить всё
authoritative;
pool {
range 10.90.1.2;
allow members of "sw01-p01";
}
pool {
range 10.90.1.3;
option routers 10.90.1.1;
allow members of "sw01-p02";
}
pool {
range 10.90.1.4;
option subnet-mask 255.255.255.0;
option routers 10.90.1.1;
allow members of "sw01-p03";
}
pool {
range 10.90.1.5;
allow members of "sw01-p04";
}
pool {
range 10.90.1.12;
allow members of "sw01-p12";
}
}