1、 MX960 BRAS配置手册 2015年04月 Longjiang.Li V1.0 目 录 1 IPOE 简介 2 1.1 IPoE用户认证的特点 2 1.2 Web重定向过程 2 1.3 IPOE认证过程 2 1.4 IPOE下线过程 4 1.5 IPOE基于用户业务的流量计费 5 2 PPPOE 简介 6 2.1 PPPoE认证特点 6 2.2 PPPOE认证过程 6 2.3 PPPOE下线过程 7 2.4 PPPOE基于用户业务的流量计费 7 3 配置方法 8 3.1 Filter 简介 8 Filt
2、er配置方法 8 3.2 IPOE BRAS配置方法 9 认证服务器配置 9 dynamic-profiles配置 10 DHCP配置 11 接口配置 12 3.3 PPPOE BRAS配置方法 12 认证服务器配置 12 dynamic-profiles配置 13 DHCP配置 14 接口配置 15 1 IPOE 简介 1.1 IPoE用户认证的特点 用户认证通过WEB方式进行,使得学校的师生不必安装拨号客户端,认证功能通过IE浏览器即可方便地完成身份认证过程。认证后台系统由WEB Portal和RADIUS组成,认证平台可调用统一的用户数据
3、库,以实现统一身份认证。用户的访问权限、上网速率以及其他跟上网相关的行为管理由RADIUS系统根据用户身份下发相应的策略给MX路由器来实现。这使得网络具备较高的控制能力和可管理性,运维管理更加方便。 在这一架构下,有线、无线(校内师生、访客)用户均可通过同一套设备、同一套软件、同一用户身份验证服务器,经过一次认证,即可根据预先设置的策略访问相应的资源,而不必进行多次认证。 无线和有线用户均做了相同的测试。 1.2 Web重定向过程 通过策略路由将目的端口为80的流量引入到防火墙,通过防火墙目的端口转换,实现web重定向。 1.3 IPOE认证过程 IPOE认证可分为两个部分,HDC
4、P认证和portal认证两个部分 HDCP 认证:用户首先通过DHCP认证获取IP地址,认证后给逻辑接口下发出入方向策略“prb”和“10M”,不允许用户之间互访。 portal认证:用户获得IP地址后通过portal认证,此时radius下发COA,MX将用户策略变更为O-1M,I-4M,对用户进行限速。 1.4 IPOE下线过程 用户在portal页面申请下线过程: 用户在web页面点击登出,radius下发DM,MX收到DM后,MX清除HDCP BINDING,解除用户关系。 通过radius主动离线用户 管理员在radius界面清除用户,radius下发D
5、M后,MX清除DHCP BINGDING,解除用户关系。 用户异常离线过程 用户异常离线后,在DHCP LEASE TIME超时后,MX给radius发送计费停止报文,radius清除用户信息 1.5 IPOE基于用户业务的流量计费 MX支持Service Based Accounting(SBA)功能,在每个用户的session基础上,生成多个service session,针对每个service session实现基于time/volume的statistics,如对campus,cernet,telecom等实现单独的流量统计和计费功能, radius属性如下: 2
6、 PPPOE 简介 2.1 PPPoE认证特点 PPPoE其案简要流程为:用户PC通过客户端发起PPPoE请求到后台接入服务器BAS,然后交付深澜进行认证及计费。 由于MX直接提供了用户接入网络时的PPPoE认证功能,相应的控制力度也更强。用户均通过PPPoE会话实现到网络的接入和访问,由于PPPoE通道的隔离而互不影响,因此能够天然抵御ARP欺骗、仿冒源地址攻击等问题,极大减轻网络管理员的工作量,并有效保障了整个校园网络的可靠性和稳定性。 对于每个用户的PPPoE会话,都可以根据用户的身份信息通过深澜 的后台管理平台进行策略下发,进行相应的访问权限控制、上下行速率限制以及根据流量、时
7、长等采取不同策略的计费功能。对于PPPoE方式,在用户认证通过后,由MX向深澜服务器发送计费开始包,在用户下线后(用户主动挂断、异常死机、网络断等),由MX向深澜服务器发送计费结束包。深澜业务支撑平台便可根据计费起始包、结束包按时长、按流量进行实时计费。采用这种方式,计费数据相当准确。 另外,由于MX及深澜认证计费系统均为运营商级设备,设备的处理能力,对用户的控制能力完全能够满足校园网网络的需求,可以对每个用户进行带宽限制,权限管理、QoS等各种操作。并且,在使用BRAS+PPPoE的接入方式下,在接入层是一张大的二层网络,用户间通过VLAN隔离,互相之间没有影响,避免了ARP病毒等问题;同
8、时,对校园网的管理维护来说,管理员只需要管理大的BARS设备,接入层设备仅仅是二层接入,不需要在接入设备上作负责设置,极大的减轻了管理员的维护工作量。PPPoE方式适合于需要进行精细控制与计费的校园网客户,如学生宿舍等。 2.2 PPPOE认证过程 PPPOE认证过程,首先用户发起PPPOE连接,包括PPPOED和LCP协商,同时将用户名发给MX,MX发起access request给radius,radius验证用户信息,回复access accept,携带用户接入策略,MX与用户交互IPCP,获得IP地址,同时将计费信息发给radius。 2.3 PPPOE下线过程 参考IPO
9、E下线过程,用户主动下线和管理员离线用户通过DM信息实现,用户异常下线在PPPOE keepalive超时后,由MX发给radius记账停止信息下线。 2.4 PPPOE基于用户业务的流量计费 同IPOE 3 配置方法 3.1 Filter 简介 Filter非常关键,radius上所有使用的filter,BRAS中必须定义,如果BRAS没有radius所调用的filter用户将无法认证通过。 深澜和MX960 BRAS 预定用的限速filter为: 1) IPOE : I-4M,O-4M(一定大写),I-8M,O-8M
10、等。(I,O为限速的两个方向) pbr(小写),pbr为域认证取地址后的策略。pbr为重定向filter。 2) PPPOE:up4m,down4m(一定要小写),up8m,down8m等。(up,down为限速的两个方向) 3.1.1 Filter配置方法 firewall { family inet { filter pbr {#重定向filter interface-specific; term 5 { from {
11、 service-filter-hit; #标记 } then accept; } term 20 {#标记认证前开始的端口,UDP 53为DNS服务,如果不开,客户端打域名无法重定向。 from { protocol udp; destination-port 53; }
12、 then accept; } term 30 {#访问radius webport服务器直通过。 from { destination-address { 172.16.108.13/32; } } then { routing-instanc
13、e webport; } } term 40 {#所有TCP 80端口服务全部使用策略路由 webport,也就是数据全部扔到防火墙,让防火墙做目的地址转换(重定向)。如果需要开重定向前可以访问的服务,可以在这条前添加策略。(注:所有正常数据流通过BRAS直接转发,重定向防火墙在radius和bras中间,认证后的正常数据流不通过重定向防火墙) from { protocol tcp; des
14、tination-port 80; } then { routing-instance webport; } } term 50 {#拒绝其他数据流 then { discard; } } } filter I-4M {#IPOE的限
15、速filter。 interface-specific; term 30 { then { policer 4m; accept; } } }#PPPOE up4m,down4m写法相同。 3.2 IPOE BRAS配置方法 3.2.1 认证服务器配置 access { profile sbr { accountin
16、g-order radius; #计费方式为radius authentication-order radius; #认证方式为radius radius { authentication-server 172.16.108.13; #认证服务器IP地址 accounting-server 172.16.108.13; #计费服务器IP地址 options {#radius参数 ethernet-port-type-virtual;
17、 accounting-session-id-format decimal; vlan-nas-port-stacked-format; } } radius-server {#radius server配置 172.16.108.13 { port 1812; accounting-port 1813; secret "$9$uhkGBRSvWxwYor
18、eYoJGq.0BI"; ## SECRET-DATA source-address 222.27.244.1; } } accounting {#计费配置 order radius; immediate-update; coa-immediate-update; update-interval 10; statistics volume-time; }
19、 } 3.2.2 dynamic-profiles配置 dynamic-profiles { dhcp-demux { #定义IPOE vlan demux接口 routing-instances { "$junos-routing-instance" { interface "$junos-interface-name" { any; } } }
20、interfaces { demux0 { unit "$junos-interface-unit" {#生产动态子接口 no-traps; proxy-arp unrestricted; demux-options { underlying-interface "$junos-underlying-interface"; #定义demux物理接口
21、 } family inet { demux-source { $junos-subscriber-ip-address; #调用DHCP分配的地址 } filter { input "$junos-input-filter" precedence 1; #调用
22、radius下发的filter output "$junos-output-filter"precedence1;#调用radius下发的filter } unnumbered-address "$junos-loopback-interface" preferred-source-address "$junos-preferred-source-address";#调用loopback IP地址作为DHCP与网关转发
23、 } family inet6 {#IPV6 相关配置与IPV4同理。 filter { input "$junos-input-ipv6-filter" precedence 1; output "$junos-output-ipv6-filter" precedence 1; }
24、 demux-source { "$junos-subscriber-ipv6-multi-address"; } unnumbered-address "$junos-loopback-interface" preferred-source-address "$junos-preferred-source-ipv6-address"; } }
25、 } } } IPOE-HEU-WLAN {#定义不同的动态配置,用于接口调用。 interfaces { "$junos-interface-ifd-name" {#接收接口的变量 unit "$junos-interface-unit" {#子接口变量 demux-source inet; vlan-tags outer "$junos-vlan-id";#接收接口终结的VLAN标
26、签 family inet { mac-validate strict; #防止用户私设IP地址 unnumbered-address lo0.0 preferred-source-address 10.128.0.1; #调用的lo0.0的接口IP,这里的地址与DHCP绑定。 } } } } } } 3.2.3 DHC
27、P配置 1)DHCP认证配置 system { services { dhcp-local-server { dhcpv6 {#DHCP IPV6配置 group 1 { authentication { password Juniper6; #IPOE 域认证是所用的密码,只有通过与深澜认证,才可下发地址 username-include {
28、 user-prefix Juniper6; #域认证用户名 } } dynamic-profile dhcp-demux; #调用dhcp-demux动态配置 interface ge-8/2/0.0; #可以获取IP的接口 interface ge-8/2/1.0; } }
29、 group 1 {#DHCP IPV4配置 authentication { password Juniper; username-include { user-prefix Juniper; } } dynamic-profile dhcp-demux; int
30、erface ge-8/2/0.0; interface ge-8/2/1.0; } } } 2)DHCP地址池配置 access { pool ipoe {#地址池名称 family inet { network 222.27.244.128/25; #地址池网段 range 1 { low 222.27.244.130; #地址池开始地址
31、 high 222.27.244.254; #地址池结束地址 } dhcp-attributes { maximum-lease-time 43200; #地址池超时时间 name-server {#DNS地址 202.118.176.2; } router {
32、 222.27.244.129; #网关地址,lookback地址。 } } } } 3.2.4 接口配置 interfaces { ge-8/2/0 { flexible-vlan-tagging; #QINQ封装方式,flexible为单双层都可以。 speed 1g; auto-configure { vlan-ranges {
33、 dynamic-profile dhcp-wlan-vlan {#调用dhcp-wlan-vlan动态配置 accept inet; ranges {#终结的VLAN ID 214-214; } } } } 3.3 PPPOE BRAS配置方法 3.3.1 认证服务器配置 access { profile sbr
34、{ accounting-order radius; #计费方式为radius authentication-order radius; #认证方式为radius radius { authentication-server 172.16.108.13; #认证服务器IP地址 accounting-server 172.16.108.13; #计费服务器IP地址 options {#radius参数 ethernet-port-t
35、ype-virtual; accounting-session-id-format decimal; vlan-nas-port-stacked-format; } } radius-server {#radius server配置 172.16.108.13 { port 1812; accounting-port 1813; secre
36、t "$9$uhkGBRSvWxwYoreYoJGq.0BI"; ## SECRET-DATA source-address 222.27.244.1; } } accounting {#计费配置 order radius; immediate-update; coa-immediate-update; update-interval 10; statistics vol
37、ume-time; } } 3.3.2 dynamic-profiles配置 dynamic-profiles { pppoe { predefined-variable-defaults {#默认下发的限速策略,在radius未下发的限速策略时调用 input-filter up4m; output-filter down4m; } routing-instances { "$junos-routing-instance
38、" { interface "$junos-interface-name" { any; } } } interfaces { pp0 { unit "$junos-interface-unit" {#动态生成pp子接口 ppp-options { chap;
39、 pap; } pppoe-options { underlying-interface "$junos-underlying-interface";#定义pppoe物理接口 server; } keepalives interval 60; #keepalives心跳报文,在非正常下线需要等待5
40、次心跳报文,用户才能下线。 family inet { filter { input "$junos-input-filter" precedence 20; #动态调用filter output "$junos-output-filter" precedence 20; } unnumbe
41、red-address "$junos-loopback-interface";#借用loopback接口转发数据 } family inet6 { address $junos-ipv6-address; } } } } protocols { router-advertisement {
42、 interface "$junos-interface-name" { link-mtu; prefix $junos-ipv6-ndra-prefix; } } } } pppoe-stacked-vlan {#定义不同的动态配置,用于接口调用。 interfaces { "$junos-interface-ifd-name" {#接收的接口变
43、量 unit "$junos-interface-unit" {#接收的子接口变量 vlan-tags outer "$junos-stacked-vlan-id" inner "$junos-vlan-id";#接收的QINQ变量 family pppoe {# 接口类型为pppoe duplicate-protection; #pppoe安全防护配置 dynamic-prof
44、ile pppoe; #调用上述pppoe动态配置。 short-cycle-protection { lockout-time-min 1; lockout-time-max 60; } } } } } } 3.3.3 DHCP配置 1)DHCP地
45、址池配置 access { group-profile dns {#PPPOE 用户DNS配置 ppp { primary-dns 202.118.176.2; secondary-dns 202.97.224.69; } } address-assignment { pool test {#pppoe地址池名称,这个和IPOE不同的是不需要配置那么多,只配置开始和结束地址段。Pppoe的地址池指定为radius下发。只有本地有radius下发的DHCP池名
46、称即可。如果radius下发的地址池本地没有,用户会在住地址池取地址,也就是配置中第一个地址池。 family inet { network 125.223.124.0/24; range 1 { low 125.223.124.2; high 125.223.124.254; } } } 3
47、3.4 接口配置 interfaces { ge-4/2/8 { flexible-vlan-tagging; auto-configure {#QINQ封装方式,flexible为单双层都可以 stacked-vlan-ranges { dynamic-profile pppoe-stacked-vlan {#调用pppoe-stacked-vlan动态配置 accept pppoe; #接收pppoe流量 ranges {#终结的QINQ配置。 any,any; } } } }






