BDCOM P3310 option 82

Комментарии ()

example

interface EPON0/1
 description test
 epon pre-config-template ots binded-onu-llid 1-64
 epon bind-onu mac a0c6.ec07.6968 1
 filter dhcp
 switchport trunk vlan-allowed 115
 switchport trunk vlan-untagged none
 switchport mode trunk
 no switchport protected
!
!
ip dhcp-relay snooping
ip dhcp-relay snooping vlan  115
ip dhcp-relay snooping information option format hn-type
!

dhcp_pon.conf

max-lease-time 86400;

subnet XXX.XXX.162.128 netmask 255.255.255.128 {
    range XXX.XXX.162.135 188.190.162.200;
    #max-lease-time 120;
    max-lease-time 86400;
    option routers XXX.XXX.162.129;
    option domain-name-servers XXX.XXX.38.2,XXX.XXX.38.9;
    on expiry {
        set client-ip = binary-to-ascii (10, 8, ".", leased-address);
        execute("/usr/local/www/billing2a/public_html/dhcp/dhcp82_expiry.php", "option82", "expiry" ,"client-ip",client-ip);
    }

    on release {
        execute("/usr/local/www/billing2a/public_html/dhcp/dhcp82.php", "option82", "release");
    }
    on commit {

        set client-mac = binary-to-ascii(16,8,":",substring(hardware,1, 6));
        set switch-port = binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1));
        set client-ip = binary-to-ascii (10, 8, ".", leased-address);
        set switch-addr = binary-to-ascii(10, 8, ".", packet(24, 4));
        set switch-mac=binary-to-ascii(16, 8, ":", suffix(option agent.remote-id, 5));

        execute("/usr/local/www/billing2a/public_html/dhcp/dhcp82.php", "option82", "commit",
        "switch-port",switch-port,
        "client-ip",client-ip,
        "client-mac",client-mac,
        "switch-addr",switch-addr,
        "switch-mac",switch-mac
        );

    }

}

Щоб отримувати mac OLT (Use cm-type option 82 format)

ip dhcp-relay snooping information option format cm-type

Щоб отримувати mac ONU (Use cisco option 82 format)

ip dhcp-relay snooping information option format hm-type

В конфігу dhcp

binary-to-ascii(16,8,":",substring(hardware,1, 6)); - mac клієнта

binary-to-ascii (10, 8, ".", leased-address); - ip клієнта

binary-to-ascii(16,8,":",substring(option agent.remote-id,0,6)); - mac адреса OLT або ONU

binary-to-ascii(10,8,"",substring(option agent.circuit-id,1,1)); - Vlan

binary-to-ascii(10,8,"",substring(option agent.circuit-id,3,1)); - номер epon порту із урахуванням к-ті ethernet портів. Якщо клієнт включений через 4-ий epon порт, то 6 портів ethernet + 4 = 10


Webit.in.ua 2013