Jump to content
Калькуляторы

Juniper MX204 в качестве BRAS PPPoE

Добрый день. Имеется такая железка Model: mx204 Junos: 22.2R3.15. Пока сверх задач от нее не требуется нужно авторизовать около 5к клиентов PPPoE (адреса будет выдавать radius).

К порту xe-0/1/0 подключен свитч с диапазоном trunk vlan 3500-3550. В каждом влане есть какое то кол-во клиентов. Пробовал настраивать разными вариантами, но всегда попадается какой-то затык.

При таком раскладе авторизация проходит, но только одним логином, второй уже не может подключиться (не взирая на max-sessions).

xe-0/1/2 {
    vlan-tagging;
    encapsulation flexible-ethernet-services;
    unit 3500 {
        vlan-id 3500;
        family pppoe {
            max-sessions 1000;
        }
    }
}

pp0 {
        unit 3500{
            ppp-options {
                chap;
                pap;
            }
            pppoe-options {
                underlying-interface xe-0/1/2.3500;
                server;
            }
            keepalives interval 10;
            family inet {
                unnumbered-address lo0.0;
            }
        }
    }

 

При таком раскладе авторизации не проходят и в логах ругается (dyn_prof_send_request: Rejecting profile (PPPOE-CLIENT-PROFILE - use_flow: 0) ADD from daemon pppoed because enhanced-universal-edge is disabled).

show chassis network-services    
Network Services Mode: Enhanced-IP

Как я понял для использования динамических профилей нужна какая-то лицензия или может я их не так применяю?

xe-0/1/0 {
    flexible-vlan-tagging;

    encapsulation flexible-ethernet-services;
    unit 0{
        family pppoe {
            dynamic-profile PPPOE-CLIENT-PROFILE;
        }
    }

 

PPPOE-CLIENT-PROFILE {
    interfaces {
        pp0 {
            unit "$junos-interface-unit" {
                ppp-options {
                    chap;
                    pap;
                }
                pppoe-options {
                    underlying-interface "$junos-underlying-interface";
                    server;
                }
                family inet {
                    unnumbered-address lo0.0;
                }
            }
        }
    }
}

 

License usage: 
                                 Licenses     Licenses    Licenses
                                  Feature      Feature     Feature
  Feature name                       used    installed      needed  Expiry 
  subscriber-accounting                 1            1           0    permanent
  subscriber-authentication             1            1           0    permanent
  subscriber-address-assignment         0            1           0    permanent
  subscriber-vlan                       0            1           0    permanent
  subscriber-ip                         0            1           0    permanent
  service-dc                            0            1           0    permanent
  service-accounting                    0            1           0    permanent
  service-qos                           0            1           0    permanent
  service-ancp                          0            1           0    permanent
  service-cbsp                          0            1           0    permanent
  scale-subscriber                      0        64010           0    permanent
  scale-l2tp                            0         1000           0    permanent
  bgp                                   1            0           1    invalid
  l3static                              1            0           1    invalid

Licenses installed: 
  License identifier: E000185416
  License version: 2
  Order Type: commercial
  Features:
    subscriber-accounting - Per Subscriber Radius Accounting
      permanent
    subscriber-authentication - Per Subscriber Radius Authentication
      permanent
    subscriber-address-assignment - Radius/SRC Address Pool Assignment
      permanent
    subscriber-vlan  - Dynamic Auto-sensed Vlan
      permanent
    subscriber-ip    - Dynamic and Static IP
      permanent

  License identifier: E001171420
  License version: 2
  Order Type: commercial
  Features:
    service-dc       - Service Definition Capability
      permanent
    service-accounting - Per Service Accounting
      permanent
    service-qos      - Dynamic QOS Policy
      permanent
    service-ancp     - ANCP Based QOS Adjustment
      permanent
    service-cbsp     - Cell Based Shaping and Policing
      permanent

  License identifier: E000662843
  License version: 2
  Order Type: commercial
  Features:
    scale-subscriber - Dynamic/Static Subscriber Base Feature
      capacity: 64000
      permanent

 

Пробовал еще через auto-configure, но тоже не особо помогло.

 

Может кто поделится конфигом, или ткните носом где ошибаюсь.

 

Прошу сильно не пинать с jun не было опыта работы. Спасибо за любую помощь/совет. 

Share this post


Link to post
Share on other sites

С авторизациями все получилось. auto-configure отрабатывает отлично. Все работает, при установки pppoe создается динамический  интерфейс с нужным vlan-id и создается динамический pp интерфейс и интернет появляется.

Настало время применять фильты на доступ (к примеру для заблокированных клиентов), что бы ограничить все кроме личного кабинета и передавать параметры ограничения скорости с радиус сервера и тут появилась новая проблема.

Вот так выглядит текущий конфиг

run show configuration interfaces xe-0/1/0  
flexible-vlan-tagging;
auto-configure {
    vlan-ranges {
        dynamic-profile DYNAMIC-PPPOE-VLAN {
            accept pppoe;
            ranges {
                3500-3510;
            }
        }
    }
    remove-when-no-subscribers;
}
encapsulation flexible-ethernet-services;

 

DYNAMIC-PPPOE-PROFILE {
    interfaces {
        pp0 {
            unit "$junos-interface-unit" {
                ppp-options {
                    chap;
                    pap;
                    mru 1492;
                    mtu 1492;
                }
                pppoe-options {
                    underlying-interface "$junos-underlying-interface";
                    server;
                }
                family inet {
                    rpf-check;
                    mtu 1492;
                    unnumbered-address lo0.0;
                }
            }
        }
    }
}
DYNAMIC-PPPOE-VLAN {
    interfaces {
        "$junos-interface-ifd-name" {
            unit "$junos-interface-unit" {
                vlan-id "$junos-vlan-id";
                family pppoe {
                    duplicate-protection;
                    dynamic-profile DYNAMIC-PPPOE-PROFILE;
                    max-sessions 16000;
                }
            }
        }
    }
}

 

profile PPPOE-AUTH {
    authentication-order radius;
    domain-name-server {
        77.88.8.8;
        8.8.8.8;
    }
    radius {
        authentication-server 192.168.19.125;
        accounting-server 192.168.19.125;
        options {
            juniper-access-line-attributes;
            coa-dynamic-variable-validation;
        }
    }
    session-options {
        client-idle-timeout 60;
        client-session-timeout 1440;
    }
    radius-server {
        192.168.19.125 {
            port 1812;
            accounting-port 1813;
            dynamic-request-port 3799;
            secret "$9$eHKW87-dsgaUSrb2oGq."; ## SECRET-DATA
            timeout 5;
            retry 3;
            source-address 192.168.19.55;
        }
    }
    accounting {
        order radius;
        immediate-update;
        coa-immediate-update;
        update-interval 10;
        statistics volume-time;
        send-acct-status-on-config-change;
    }
    service {
        accounting-order radius;
    }
}

 

Если на DYNAMIC-PPPOE-PROFILE применять любые фильтры, то pppoe сессия перестает подниматься с ошибкой  - LCP пакеты не могут быть обработаны.

Конфигурация фильтра не влияет (пробовал разрешать все что связано с ppp) видимо из-за того что LCP пакеты не являются IP пакетами и не проходят через family inet filter

 

Как привольно передать с радиуса атрибуты со значением скоростей in/out или название фильтра.

Атрибут Filter-Id при авторзации появляется на сессии, но не работает (видимо потому, что не как не привязан к динамическому интерфейсу).

Dynamic configuration: 
  junos-input-filter: BLOCKED

 

 

Share this post


Link to post
Share on other sites

stacked-vlan-ranges {
    dynamic-profile QINQ-PROFILE {
        accept pppoe;
        ranges {
            400-415,any;
            996-998,any;
        }
    }
}
vlan-ranges {
    dynamic-profile VLAN-PROFILE {
        accept pppoe;
        ranges {
            445-483;
            1200-1219;
        }
    }
}

# QINQ-PROFILE

interfaces {
    demux0 {
        no-traps;
        unit "$junos-interface-unit" {
            vlan-tags outer "$junos-stacked-vlan-id" inner "$junos-vlan-id";
            demux-options {
                underlying-interface "$junos-interface-ifd-name";
            }
            family pppoe {
                access-concentrator bng-3;
                duplicate-protection;
                dynamic-profile PPPoE_profile;
                service-name-table DEFAULT;
                short-cycle-protection;
            }
        }
    }
}

# VLAN-PROFILE

interfaces {
    demux0 {
        no-traps;
        unit "$junos-interface-unit" {
            proxy-arp;
            vlan-id "$junos-vlan-id";
            demux-options {
                underlying-interface "$junos-interface-ifd-name";
            }
            family pppoe {
                access-concentrator bng-3;
                duplicate-protection;
                dynamic-profile PPPoE_profile;
                service-name-table DEFAULT;
                short-cycle-protection;
            }
        }
    }
}

#PPPoE_profile

routing-instances {
    "$junos-routing-instance" {
        interface "$junos-interface-name";
    }
}
interfaces {
    "$junos-interface-ifd-name" {
        unit "$junos-interface-unit" {
            no-traps;
            ppp-options {
                chap;
                pap;
                mtu 1492;
                ipcp-suggest-dns-option;
            }
            pppoe-options {
                underlying-interface "$junos-underlying-interface";
                server;
            }
            keepalives interval 20;
            family inet {
                rpf-check;
                unnumbered-address "$junos-loopback-interface";
            }
        }
    }
}

# sp_Inet

variables {
    SPEED_IN default-value 1m;
    SPEED_OUT default-value 1m;
    INET_IN uid;
    INET_OUT uid;
    POLICER_IN uid;
    POLICER_OUT uid;
}
interfaces {
    demux0 {
        no-traps;
        unit "$junos-interface-unit" {
            family inet {
                filter {
                    input "$INET_IN" precedence 75;
                    output "$INET_OUT" precedence 75;
                }
            }
        }
    }
}
firewall {
    family inet {
        filter "$INET_IN" {
            interface-specific;
            term block_spoof {
                from {
                    source-prefix-list {
                        client-nets except;
                    }
                }
                then {
                    count spoof_in;
                    discard;
                }
            }
            term speed_in {
                then {
                    policer "$POLICER_IN";
                    service-accounting;
                    service-filter-hit;
                    accept;
                }
            }
        }
        filter "$INET_OUT" {
            interface-specific;
            term speed_out {
                then {
                    policer "$POLICER_OUT";
                    service-accounting;
                    service-filter-hit;
                    accept;
                }
            }
        }
    }
    policer "$POLICER_IN" {
        filter-specific;
        if-exceeding {
            bandwidth-limit "$SPEED_IN";
            burst-size-limit 1m;
        }
        then discard;
    }
    policer "$POLICER_OUT" {
        filter-specific;
        if-exceeding {
            bandwidth-limit "$SPEED_OUT";
            burst-size-limit 1m;
        }
        then discard;
    }
}

Вот вам пример.

Radius отдает имя vrf(LS:RI, нужен если сессию необходимо поместить не в GRT), имя профиля - sp_Inet(x,y) , где x,y - скорости в мегабитах и имя loopback интерфейса(нужен если сессию необходимо поместить не в GRT). Наименование соответствующих атрибутов, я думаю, без труда найдете на сайте Juniper. Они неплохо описаны. Все атрибуты vendor specific.

Share this post


Link to post
Share on other sites

За пример большое спасибо!

почти со всем уже разобрался - но вот с передачей значения скорости не получается.

Нашел атрибут для передачи параметров ERX-Service-Activate:1 = "sp_Inet(45m,44m)", но он не применяется 

в ответ на coa прилетает 

Error-Cause = Missing-Attribute
Juniper-Attr-178 = 0x31323220457865637574696f6e206661696c757265

а в логах джуна 

Dynamic request processing status <Error:authd class=1, code=3>, reason(122 Execution failure)

Как будто он не понимает передаваемый ему атрибут.

 

Но если передать атрибут без значения скоростей ERX-Service-Activate:1 = "sp_Inet" - то все отрабатывает нормально и профиль применяется к сессии.

 

Share this post


Link to post
Share on other sites

https://www.juniper.net/documentation/us/en/software/junos/subscriber-mgmt-sessions/topics/topic-map/radius-std-attributes-vsas-support.html

Внимательно читайте документацию. Передача этого атрибута не поддерживается в CoA.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now