Перейти к содержимому
Калькуляторы

DES-3028 & dnsmasq(Option 82) - help!

Собственно, впрервые настраиваю, может кто сталкивался

DES-3028 настроен с вкл. option 82 и вроде даже вставляет ее в dhcp запрос, что видно по логу wireshark:

91	44.406940	10.0.0.100	10.0.0.1	DHCP	DHCP Request  - Transaction ID 0x3b866793
Option: (t=82,l=18) Agent Information Option
Option: (82) Agent Information Option
Length: 18
Value: 010600040001000202080006001e58aab3ad
Agent Circuit ID: 000400010002
Agent Remote ID: 0006001e58aab3ad
End Option

При этом, что происходит в Dnsmasq:

Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 available DHCP range: 10.0.0.2 -- 10.0.0.150
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 client provides name: artyom
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 vendor class: MSFT 5.0
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 DHCPREQUEST(eth1) 10.0.0.133 00:0a:e4:33:3c:97
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 DHCPACK(eth1) 10.0.0.133 00:0a:e4:33:3c:97 artyom
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 requested options: 1:netmask, 15:domain-name, 3:router, 6:dns-server,
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 requested options: 44:netbios-ns, 46:netbios-nodetype, 47:netbios-scope,
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 requested options: 31:router-discovery, 33:static-route, 249,
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 requested options: 43:vendor-encap
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 tags: eth1
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 next server: 10.0.0.1
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size:  1 option: 53:message-type  05
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size:  4 option: 54:server-identifier  10.0.0.1
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size:  4 option: 51:lease-time  00:00:a8:c0
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size:  4 option: 58:T1  00:00:4b:05
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size:  4 option: 59:T2  00:00:8a:4d
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size:  4 option:  1:netmask  255.255.255.0
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size:  4 option: 28:broadcast  10.0.0.255
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size:  4 option:  3:router  10.0.0.100
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size:  9 option: 81:FQDN  03:ff:ff:61:72:74:79:6f:6d
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size:  8 option:  6:dns-server  10.0.0.1, 8.8.8.8
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size:  7 option: 43:vendor-encap  06:04:01:01:01:01:ff
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size:  8 option: 60:vendor-class  4d:53:46:54:20:35:2e:30
Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size: 18 option: 82:agent-id  01:06:00:04:00:01:00:02:02:08:00:06:00...
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 available DHCP range: 10.0.0.2 -- 10.0.0.150
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 client provides name: artyom
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 vendor class: MSFT 5.0
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 DHCPREQUEST(eth1) 10.0.0.133 00:0a:e4:33:3c:97
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 DHCPACK(eth1) 10.0.0.133 00:0a:e4:33:3c:97 artyom
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 requested options: 1:netmask, 15:domain-name, 3:router, 6:dns-server,
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 requested options: 44:netbios-ns, 46:netbios-nodetype, 47:netbios-scope,
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 requested options: 31:router-discovery, 33:static-route, 249,
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 requested options: 43:vendor-encap
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 tags: eth1
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 next server: 10.0.0.1
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size:  1 option: 53:message-type  05
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size:  4 option: 54:server-identifier  10.0.0.1
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size:  4 option: 51:lease-time  00:00:a8:c0
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size:  4 option: 58:T1  00:00:4c:8d
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size:  4 option: 59:T2  00:00:8b:d5
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size:  4 option:  1:netmask  255.255.255.0
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size:  4 option: 28:broadcast  10.0.0.255
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size:  4 option:  3:router  10.0.0.1
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size:  9 option: 81:FQDN  03:ff:ff:61:72:74:79:6f:6d
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size:  8 option:  6:dns-server  10.0.0.1, 8.8.8.8
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size:  7 option: 43:vendor-encap  06:04:01:01:01:01:ff
Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size:  8 option: 60:vendor-class  4d:53:46:54:20:35:2e:30

Как понимать эту строчку?

Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size: 18 option: 82:agent-id 01:06:00:04:00:01:00:02:02:08:00:06:00...

В конфиге dnsmasq по поводу настройки option 82 следующее:

dhcp-remoteid=set:switch1,00:1E:58:AA:B3:AD
dhcp-circuitid=set:port-3,3
dhcp-range=net:switch1,net:port-3,10.10.35.2,10.10.35.5,255.255.255.0

В общем непонятки по поводу dhcp-circuitid, как она должна выглядеть в конфиге?

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

dnsmasq писан чтобы статикой со своего конфига всё брать, это не всегда оптимально при работе с опцией 82.

 

В данном примере в начале вы определяете свич по его идентификатору (мак из опции 82), потом порт.

 

В последней строчке на основании мака свича и номера порта выдаются настройки.

 

 

 

 

Почитайте про логику работы dnsmasq: он в начале на основе некоторых параеметров из запроса определяет группу, а потом выдаёт настройки для этой группы.

 

 

 

 

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Ок, давайте сделаем группу fixedport.

Например:

tag-if=set:fixedport,tag:switch1,tag:port2
dhcp-range=net:#fixedport,10.10.40.50,10.10.40.60,255.255.255.0
dhcp-option=net:#fixedport,option:router,10.0.0.100
dhcp-option=net:#fixedport,option:dns-server,8.8.8.8
dhcp-remoteid=set:switch1,00:1e:58:aa:b3:ad
dhcp-circuitid=set:port2,01:06:00:04:00:01:00:02

В этом случае шлюз и dns-ы отдает клиенту, одако ip-шник выдает из дефолтного 10.0.0.0/24. И как я и писал, подозрение на строку описания порта, в данном случае #2. Мутатор отдает

Agent Circuit ID: 000400010002

Я пробовал и так:

dhcp-circuitid=set:port2,01:06:00:04:00:01:00:02
и так:
dhcp-circuitid=set:port2,0106000400010002
и так:
dhcp-circuitid=set:port2,000400010002
и так:
dhcp-circuitid=set:port2,00:04:00:01:00:02

и я уже хз че ему надо

В мане буквально следующее:

--dhcp-circuitid=set:<tag>,<circuit-id>, --dhcp-remoteid=set:<tag>,<remote-id>

Map from RFC3046 relay agent options to tags. This data may be provided by DHCP relay agents. The circuit-id or remote-id is normally given as colon-separated hex, but is also allowed to be a simple string. If an exact match is achieved between the circuit or agent ID and one provided by a relay agent, the tag is set.

Лог самого dnsmasq:

Apr 26 10:19:46 Server dnsmasq-dhcp[14838]: 2733913276 sent size: 18 option: 82:agent-id 01:06:00:04:00:01:00:02:02:08:00:06:00...

Где грабли?

Изменено пользователем ga6iem

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

×   Вставлено в виде отформатированного текста.   Вставить в виде обычного текста

  Разрешено не более 75 смайлов.

×   Ваша ссылка была автоматически встроена.   Отобразить как ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставить изображения напрямую. Загрузите или вставьте изображения по ссылке.