Jump to content

Recommended Posts

Posted

С 6509 (суп720-3b) на сервер прилетает вот в таком виде опт82

    Option: (t=82,l=19) Agent Information Option                                                               
       Option: (82) Agent Information Option                                                                  
       Length: 19                                                                                             
       Value: 020C020A0000AC15C3010D0000000603383533                                                          
       Agent Remote ID: 020A0000AC15C3010D000000                                                              
       Subscriber ID: 383533                                                                                  
   End Option    

 

Subscriber ID: 383533 - это влан 853 (т.е. 38 35 33 - перед каждой цифрой вставляется тройка)

Сервер пропатченый под понимание подопции Subscriber ID, осталось правильно настроить классы и логирование:

 
class "vlan853" {                                                                                              
               match if substring(option agent.subscriber-id, 0, 8) = "383533";                               
               }   

 

 

# логирование                                                                                                 
if exists agent.remote-id and exists agent.circuit-id  and exists agent.subscriber-id {                       
   if binary-to-ascii(16, 8, "", substring(option agent.remote-id, 2, 1)) = "0" {                            
        set switch-mac = concat("0", binary-to-ascii(16, 8, "", substring(option agent.remote-id, 2, 1)), ":"
   } else {                                                                                                  
       set switch-mac = binary-to-ascii(16, 8, ":", substring(option agent.remote-id, 2, 6));                
   }                                                                                                         
   set switch-addr = binary-to-ascii(10, 8, ".", packet(24, 4));                                             
   set switch-port = binary-to-ascii(10, 8, "", substring(option agent.circuit-id, 5, 1));                   
#    set switch-port-vlan = binary-to-ascii(10, 16, "", substring(option agent.circuit-id, 2, 2));            
   set switch-port-vlan = substring(option agent.subscriber-id, 0, 8);                                       
   log(info, concat("- Lease: ", binary-to-ascii(10, 16, ".", leased-address), " via IP: ", switch-addr, " (MAC: ", switch-mac, ") on port: ", switch-port, "in VLAN: ", switch-port-vlan));
}                                                                                                             

как правильно написать - в интернете примеров не нашел

Posted (edited)

Это не "перед каждой цифрой вставляется тройка", это номер влана в ACII.

 

Собсно, в чем проблема? Номер влана в таком виде логируется?

 

if exists agent.circuit-id еще надо бы убрать. Синтаксис описан в dhcp-eval(5).

Edited by littlesavage
  • 1 month later...
Posted

Ребят, проблема в следующем! никак не могу найти как можно в isc-dhcpd v4 реализовать поддержку распознавания опции subscriber-id! Уже всю голову сломал... Помогите кто чем может!

Posted

Разобрался более менее:

    option space myagent;
    option myagent.circuit-id code 1 = text;
    option myagent.remote-id code 2 = text;
    option myagent.AGENT-id code 3 = text;
    option myagent.link-selection code 5 = ip-address;
    option myagent.subscriber-id code 6 = text;
    option myagent-encapsulation code 82 = encapsulate myagent;

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...
На сайте используются файлы cookie и сервисы аналитики для корректной работы форума и улучшения качества обслуживания. Продолжая использовать сайт, вы соглашаетесь с использованием файлов cookie и с Политикой конфиденциальности.