PPPoE JUNOS
PPPoE JUNOS
PPPoE JUNOS
interface "$junos-interface-name"
set dynamic-profiles PPPoE-Base routing-instances "$junos-routing-instance"
routing-options access-internal route $junos-subscriber-ip-address qualified-next-
hop "$junos-interface-name"
set dynamic-profiles PPPoE-Base routing-instances "$junos-routing-instance"
routing-options access route $junos-framed-route-ip-address-prefix next-hop
"$junos-framed-route-nexthop"
set dynamic-profiles PPPoE-Base interfaces pp0 unit "$junos-interface-unit" ppp-
options ignore-magic-number
#PPPOE BASE
set dynamic-profiles PPPoE-Base interfaces pp0 unit "$junos-interface-unit"
keepalives interval 60 (mirktoik equivale a 180 segundos"
set dynamic-profiles PPPoE-Base interfaces pp0 unit "$junos-interface-unit" family
inet rpf-check
set dynamic-profiles PPPoE-Base interfaces pp0 unit "$junos-interface-unit" family
inet unnumbered-address "$junos-loopback-interface"
set dynamic-profiles PPPoE-Base interfaces pp0 unit "$junos-interface-unit" family
inet tcp-mss 1450
set dynamic-profiles PPPoE-Base interfaces pp0 unit "$junos-interface-unit" family
inet6 address $junos-ipv6-address
set dynamic-profiles PPPoE-Base interfaces pp0 unit "$junos-interface-unit" family
inet6 unnumbered-address "$junos-loopback-interface"
set dynamic-profiles PPPoE-Base protocols router-advertisement interface "$junos-
interface-name" prefix $junos-ipv6-ndra-prefix
#IPOE BASE
set dynamic-profiles CLIENTS-IPoE interfaces demux0 unit "$junos-interface-unit"
proxy-arp
set dynamic-profiles CLIENTS-IPoE interfaces demux0 unit "$junos-interface-unit"
family inet unnumbered-address lo0.0
set dynamic-profiles CLIENTS-IPoE interfaces demux0 unit "$junos-interface-unit"
family inet6 unnumbered-address lo0.0
set dynamic-profiles CLIENTS-IPoE protocols router-advertisement interface "$junos-
interface-name" max-advertisement-interval 1800
set dynamic-profiles CLIENTS-IPoE protocols router-advertisement interface "$junos-
interface-name" min-advertisement-interval 900
set dynamic-profiles CLIENTS-IPoE protocols router-advertisement interface "$junos-
interface-name" managed-configuration
set dynamic-profiles CLIENTS-IPoE protocols router-advertisement interface "$junos-
interface-name" other-stateful-configuration
set dynamic-profiles CLIENTS-IPoE protocols router-advertisement interface "$junos-
interface-name" prefix $junos-ipv6-ndra-prefix
###############################usando pseudowire
#################################################
#PPPOE ESTATICO
set interfaces ps0.0 flexible-vlan-tagging
set interfaces ps0.0 unit 10 vlan-id 10
set interfaces ps0.0 unit 10 family inet address 192.168.78.1/24
set interfaces ps0.0 unit 10 family pppoe access-concentrator PPPOE-SERVER-01
set interfaces ps0.0 unit 10 family pppoe dynamic-profile PPPoE-Base
#PPPOE DINAMICO
set interfaces ps0.0 flexible-vlan-tagging
set interfaces ps0.0 auto-configure stacked-vlan-ranges
set interfaces ps0.0 auto-configure vlan-ranges dynamic-profile vlan-profile accept
pppoe
set interfaces ps0.0 auto-configure vlan-ranges dynamic-profile vlan-profile ranges
1-4000
#IPOE DINAMICO
set interfaces ps0.0 flexible-vlan-tagging
set interfaces ps0.0 auto-configure vlan-ranges dynamic-profile VLAN-IPoE accept
any
set interfaces ps0.0 auto-configure vlan-ranges dynamic-profile VLAN-IPoE ranges 1-
4000
set interfaces ps0.0 encapsulation flexible-ethernet-services
###############################usando interface
fisica#################################################
#PPPOE ESTATICO
set interfaces ge-0/0/0 flexible-vlan-tagging
set interfaces ge-0/0/0 unit 10 vlan-id 10
set interfaces ge-0/0/0 unit 10 family inet address 192.168.78.1/24
set interfaces ge-0/0/0 unit 10 family pppoe access-concentrator PPPOE-SERVER-01
set interfaces ge-0/0/0 unit 10 family pppoe dynamic-profile PPPoE-Base
#PPPOE DINAMICO
set interfaces ge-0/0/0 flexible-vlan-tagging
set interfaces ge-0/0/0 auto-configure stacked-vlan-ranges
set interfaces ge-0/0/0 auto-configure vlan-ranges dynamic-profile vlan-profile
accept pppoe
set interfaces ge-0/0/0 auto-configure vlan-ranges dynamic-profile vlan-profile
ranges 1-4000
#PPPOE DINAMICO Q-IN-Q
set interfaces ge-0/0/0 flexible-vlan-tagging
set interfaces ge-0/0/0 auto-configure stacked-vlan-ranges dynamic-profile qinq-
profile accept pppoe
set interfaces ge-0/0/0 auto-configure stacked-vlan-ranges dynamic-profile qinq-
profile ranges any,any
set interfaces ge-0/0/0 auto-configure stacked-vlan-ranges dynamic-profile qinq-
profile ranges 1000-2000,any
#IPOE DINAMICO
set interfaces xe-0/0/2 flexible-vlan-tagging
set interfaces xe-0/0/2 auto-configure vlan-ranges dynamic-profile VLAN-IPoE accept
any
set interfaces xe-0/0/2 auto-configure vlan-ranges dynamic-profile VLAN-IPoE ranges
1-4000
set interfaces xe-0/0/2 encapsulation flexible-ethernet-services
#radius
#entre bng>onu/tplink)
set access address-assignment pool ndra-2001 family inet6 prefix
2804:3064:8007::/48
set access address-assignment pool ndra-2001 family inet6 range ndra-range prefix-
length 64
DHCP V4 E V6
CONTROLE BANDA (PFERIL DE CONEXAO)
ERX-Service-Activate:1 = "VELOCIDADE(2M,10M,600K,1M)"
#2M
set dynamic-profiles VELOCIDADE variables Bandwidth-IN default-value 32k
set dynamic-profiles VELOCIDADE variables Bandwidth-IN mandatory
#10M
set dynamic-profiles VELOCIDADE variables Bandwidth-OUT default-value 32k
set dynamic-profiles VELOCIDADE variables Bandwidth-OUT mandatory
#600K
set dynamic-profiles VELOCIDADE variables Burst-IN default-value 2m
#1M
set dynamic-profiles VELOCIDADE variables Burst-OUT default-value 2m
#aplicar na interface
set dynamic-profiles VELOCIDADE interfaces pp0 unit "$junos-interface-unit" family
inet filter input "$Filter-IN"
set dynamic-profiles VELOCIDADE interfaces pp0 unit "$junos-interface-unit" family
inet filter output "$Filter-OUT"
#UPLOAD
set dynamic-profiles VELOCIDADE firewall family inet filter "$Filter-IN" interface-
specific
set dynamic-profiles VELOCIDADE firewall family inet filter "$Filter-IN" term 10
then policer "$Policer-IN"
set dynamic-profiles VELOCIDADE firewall family inet filter "$Filter-IN" term 10
then accept
#DOWNLOAD
set dynamic-profiles VELOCIDADE firewall family inet filter "$Filter-OUT"
interface-specific
set dynamic-profiles VELOCIDADE firewall family inet filter "$Filter-OUT" term
aceita-gerencia from prefix-list ACEITA-GERENCIA-CLIENTES
set dynamic-profiles VELOCIDADE firewall family inet filter "$Filter-OUT" term
aceita-gerencia then accept
set dynamic-profiles VELOCIDADE firewall family inet filter "$Filter-OUT" term
bloqueia-acesso-remoto from destination-port 1-1024
set dynamic-profiles VELOCIDADE firewall family inet filter "$Filter-OUT" term
bloqueia-acesso-remoto the discard
set dynamic-profiles VELOCIDADE firewall family inet filter "$Filter-OUT" term 10
then policer "$Policer-OUT"
set dynamic-profiles VELOCIDADE firewall family inet filter "$Filter-OUT" term 10
then accept
#UPLOAD
set dynamic-profiles VELOCIDADE firewall policer "$Policer-IN" logical-interface-
policer
set dynamic-profiles VELOCIDADE firewall policer "$Policer-IN" if-exceeding
bandwidth-limit "$Bandwidth-IN"
set dynamic-profiles VELOCIDADE firewall policer "$Policer-IN" if-exceeding burst-
size-limit "$Burst-IN"
set dynamic-profiles VELOCIDADE firewall policer "$Policer-IN" then discard
#DOWNLOAD
set dynamic-profiles VELOCIDADE firewall policer "$Policer-OUT" logical-interface-
policer
set dynamic-profiles VELOCIDADE firewall policer "$Policer-OUT" if-exceeding
bandwidth-limit "$Bandwidth-OUT"
set dynamic-profiles VELOCIDADE firewall policer "$Policer-OUT" if-exceeding burst-
size-limit "$Burst-OUT"
set dynamic-profiles VELOCIDADE firewall policer "$Policer-OUT" then discard
ERX-Service-Activate:1 = "LIBERAR-CDN(2M,10M,600K,1M,400M)"
#2M
set dynamic-profiles LIBERAR-CDN variables Bandwidth-IN default-value 32k
set dynamic-profiles LIBERAR-CDN variables Bandwidth-IN mandatory
#10M
set dynamic-profiles LIBERAR-CDN variables Bandwidth-OUT default-value 32k
set dynamic-profiles LIBERAR-CDN variables Bandwidth-OUT mandatory
#600K
set dynamic-profiles LIBERAR-CDN variables Burst-IN default-value 2m
#1M
set dynamic-profiles LIBERAR-CDN variables Burst-OUT default-value 2m
#aplicar na interface
set dynamic-profiles LIBERAR-CDN interfaces pp0 unit "$junos-interface-unit" family
inet filter input "$Filter-IN"
set dynamic-profiles LIBERAR-CDN interfaces pp0 unit "$junos-interface-unit" family
inet filter output "$Filter-OUT"
#UPLOAD
set dynamic-profiles LIBERAR-CDN firewall family inet filter "$Filter-IN"
interface-specific
set dynamic-profiles LIBERAR-CDN firewall family inet filter "$Filter-IN" term 10
then policer "$Policer-IN"
set dynamic-profiles LIBERAR-CDN firewall family inet filter "$Filter-IN" term 10
then accept
#DOWNLOAD
set dynamic-profiles LIBERAR-CDN firewall family inet filter "$Filter-OUT"
interface-specific
set dynamic-profiles LIBERAR-CDN firewall family inet filter "$Filter-OUT" term
aceita-gerencia from prefix-list ACEITA-GERENCIA-CLIENTES
set dynamic-profiles LIBERAR-CDN firewall family inet filter "$Filter-OUT" term
aceita-gerencia then accept
set dynamic-profiles LIBERAR-CDN firewall family inet filter "$Filter-OUT" term
bloqueia-acesso-remoto from destination-port 1-1024
set dynamic-profiles LIBERAR-CDN firewall family inet filter "$Filter-OUT" term
bloqueia-acesso-remoto the discard
set dynamic-profiles LIBERAR-CDN firewall family inet filter "$Filter-OUT" term
libera-cdn from prefix-list CDNS
set dynamic-profiles LIBERAR-CDN firewall family inet filter "$Filter-OUT" term
libera-cdn then policer "$CDNuid"
set dynamic-profiles LIBERAR-CDN firewall family inet filter "$Filter-OUT" term
libera-cdn then accept
set dynamic-profiles LIBERAR-CDN firewall family inet filter "$Filter-OUT" term 10
then policer "$Policer-OUT"
set dynamic-profiles LIBERAR-CDN firewall family inet filter "$Filter-OUT" term 10
then accept
#UPLOAD
set dynamic-profiles LIBERAR-CDN firewall policer "$Policer-IN" logical-interface-
policer
set dynamic-profiles LIBERAR-CDN firewall policer "$Policer-IN" if-exceeding
bandwidth-limit "$Bandwidth-IN"
set dynamic-profiles LIBERAR-CDN firewall policer "$Policer-IN" if-exceeding burst-
size-limit "$Burst-IN"
set dynamic-profiles LIBERAR-CDN firewall policer "$Policer-IN" then discard
#DOWNLOAD
set dynamic-profiles LIBERAR-CDN firewall policer "$Policer-OUT" logical-interface-
policer
set dynamic-profiles LIBERAR-CDN firewall policer "$Policer-OUT" if-exceeding
bandwidth-limit "$Bandwidth-OUT"
set dynamic-profiles LIBERAR-CDN firewall policer "$Policer-OUT" if-exceeding
burst-size-limit "$Burst-OUT"
set dynamic-profiles LIBERAR-CDN firewall policer "$Policer-OUT" then discard
#CDN
set dynamic-profiles LIBERAR-CDN firewall policer "$CDNuid" logical-interface-
policer
set dynamic-profiles LIBERAR-CDN firewall policer "$CDNuid" if-exceeding bandwidth-
limit "$CDN"
set dynamic-profiles LIBERAR-CDN firewall policer "$CDNuid" if-exceeding burst-
size-limit "$Burst-OUT"
set dynamic-profiles LIBERAR-CDN firewall policer "$CDNuid" then discard
ERX-Service-Activate:1 = "FIREWALL-LIBERADO(2M,10M)"
#2M
set dynamic-profiles FIREWALL-LIBERADO variables Bandwidth-IN default-value 32k
set dynamic-profiles FIREWALL-LIBERADO variables Bandwidth-IN mandatory
#10M
set dynamic-profiles FIREWALL-LIBERADO variables Bandwidth-OUT default-value 32k
set dynamic-profiles FIREWALL-LIBERADO variables Bandwidth-OUT mandatory
#600K
set dynamic-profiles FIREWALL-LIBERADO variables Burst-IN default-value 2m
#1M
set dynamic-profiles FIREWALL-LIBERADO variables Burst-OUT default-value 2m
set dynamic-profiles FIREWALL-LIBERADO variables Policer-IN uid
set dynamic-profiles FIREWALL-LIBERADO variables Policer-OUT uid
set dynamic-profiles FIREWALL-LIBERADO variables Filter-IN uid
set dynamic-profiles FIREWALL-LIBERADO variables Filter-OUT uid
set dynamic-profiles FIREWALL-LIBERADO variables Filter-IN-V6 uid
set dynamic-profiles FIREWALL-LIBERADO variables Filter-OUT-V6 uid
#aplicar na interface
set dynamic-profiles FIREWALL-LIBERADO interfaces pp0 unit "$junos-interface-unit"
family inet filter input "$Filter-IN"
set dynamic-profiles FIREWALL-LIBERADO interfaces pp0 unit "$junos-interface-unit"
family inet filter output "$Filter-OUT"
#UPLOAD
set dynamic-profiles FIREWALL-LIBERADO firewall family inet filter "$Filter-IN"
interface-specific
set dynamic-profiles FIREWALL-LIBERADO firewall family inet filter "$Filter-IN"
term 10 then policer "$Policer-IN"
set dynamic-profiles FIREWALL-LIBERADO firewall family inet filter "$Filter-IN"
term 10 then accept
#DOWNLOAD
set dynamic-profiles FIREWALL-LIBERADO firewall family inet filter "$Filter-OUT"
interface-specific
set dynamic-profiles FIREWALL-LIBERADO firewall family inet filter "$Filter-OUT"
term 10 then policer "$Policer-OUT"
set dynamic-profiles FIREWALL-LIBERADO firewall family inet filter "$Filter-OUT"
term 10 then accept
#UPLOAD
set dynamic-profiles FIREWALL-LIBERADO firewall policer "$Policer-IN" logical-
interface-policer
set dynamic-profiles FIREWALL-LIBERADO firewall policer "$Policer-IN" if-exceeding
bandwidth-limit "$Bandwidth-IN"
set dynamic-profiles FIREWALL-LIBERADO firewall policer "$Policer-IN" if-exceeding
burst-size-limit "$Burst-IN"
set dynamic-profiles FIREWALL-LIBERADO firewall policer "$Policer-IN" then discard
#DOWNLOAD
set dynamic-profiles FIREWALL-LIBERADO firewall policer "$Policer-OUT" logical-
interface-policer
set dynamic-profiles FIREWALL-LIBERADO firewall policer "$Policer-OUT" if-exceeding
bandwidth-limit "$Bandwidth-OUT"
set dynamic-profiles FIREWALL-LIBERADO firewall policer "$Policer-OUT" if-exceeding
burst-size-limit "$Burst-OUT"
set dynamic-profiles FIREWALL-LIBERADO firewall policer "$Policer-OUT" then discard
ERX-Service-Activate:1 = "GAMER(2M,10M)"
#2M
set dynamic-profiles GAMER variables Bandwidth-IN default-value 32k
set dynamic-profiles GAMER variables Bandwidth-IN mandatory
#10M
set dynamic-profiles GAMER variables Bandwidth-OUT default-value 32k
set dynamic-profiles GAMER variables Bandwidth-OUT mandatory
#600K
set dynamic-profiles GAMER variables Burst-IN default-value 2m
#1M
set dynamic-profiles GAMER variables Burst-OUT default-value 2m
#aplicar na interface
set dynamic-profiles GAMER interfaces pp0 unit "$junos-interface-unit" family inet
filter input "$Filter-IN"
set dynamic-profiles GAMER interfaces pp0 unit "$junos-interface-unit" family inet
filter output "$Filter-OUT"
#UPLOAD
set dynamic-profiles GAMER firewall family inet filter "$Filter-IN" interface-
specific
set dynamic-profiles GAMER firewall family inet filter "$Filter-IN" term 10 then
policer "$Policer-IN"
set dynamic-profiles GAMER firewall family inet filter "$Filter-IN" term 10 then
accept
set dynamic-profiles GAMER firewall family inet filter "$Filter-IN" term 10 then
dscp cs5
set dynamic-profiles GAMER firewall family inet filter "$Filter-IN" term 10
forwarding-class network-control
#DOWNLOAD
set dynamic-profiles GAMER firewall family inet filter "$Filter-OUT" interface-
specific
set dynamic-profiles GAMER firewall family inet filter "$Filter-OUT" term 10 then
policer "$Policer-OUT"
set dynamic-profiles GAMER firewall family inet filter "$Filter-OUT" term 10 then
accept
set dynamic-profiles GAMER firewall family inet filter "$Filter-OUT" term 10 then
dscp cs5
set dynamic-profiles GAMER firewall family inet filter "$Filter-OUT" term 10 then
forwarding-class network-control
#UPLOAD
set dynamic-profiles GAMER firewall policer "$Policer-IN" logical-interface-policer
set dynamic-profiles GAMER firewall policer "$Policer-IN" if-exceeding bandwidth-
limit "$Bandwidth-IN"
set dynamic-profiles GAMER firewall policer "$Policer-IN" if-exceeding burst-size-
limit "$Burst-IN"
set dynamic-profiles GAMER firewall policer "$Policer-IN" then discard
#DOWNLOAD
set dynamic-profiles GAMER firewall policer "$Policer-OUT" logical-interface-
policer
set dynamic-profiles GAMER firewall policer "$Policer-OUT" if-exceeding bandwidth-
limit "$Bandwidth-OUT"
set dynamic-profiles GAMER firewall policer "$Policer-OUT" if-exceeding burst-size-
limit "$Burst-OUT"
set dynamic-profiles GAMER firewall policer "$Policer-OUT" then discard