Você está na página 1de 13

TREINAMENTO

CONCEITOS E PRÁTICAS DE REDES PARA PROVEDOR DE SERVIÇOS


LABORATÓRIO
São Paulo/SP - JULHO de 2021 –

www.fixartelecom.com.br
BIBLIOTECA DE COMANDOS

<ROUTER> < > Sinais indicam o Modo usuário

[ROUTER] [ ] Sinais indicam o modo privilegiado

[ROUTER] ? (exemplo: display interface ?) ? para ver possibilidade de comandos

[ROUTER] -> (tab) (exemplo: dis ->) Comandos abreviados, use o TAB para completar

Indica que está no modo de config da


[ROUTER-GigabitEthernet0/3/17]
interface

<ROUTER>undo terminal monitor Disable informação log na tela console

<ROUTER>system-view Entrar no modo privilegiado do router

[ROUTER]quit Volta ao ponto anterior ou sai do roteador

[ROUTER]dis interface description Exibe interfaces e suas descrições

[ROUTER]dis ip interface brief Exibe interfaces e os IPs atriuidos a elas

[ROUTER]display interface Gi0/0/0 Exibe status e contadores da interface

[ROUTER]display version Exibe informações de Sistema e Hardware

[ROUTER]display current-configuration Exibi a configuração atual do router

[ROUTER]dis cur interface Gi0/0/0 Exibe configuração da interface selecionada

[ROUTER]dis cur configuration “argumento” Por exemplo: exibir só a configuração “OSPF”

[ROUTER]display ip routing-table Exibe informações da tabela de roteamento

[ROUTER]dis ip routing-table 192.168.0.1 Exibe informações especifica de roteamento

[ROUTER]display ospf peer brief Exibe resumo de vizinhos ospf

[ROUTER]display bgp peer Exibe resumo de vizinhos bgp

[ROUTER]display mpls ldp peer Exibe resumo de vizinho ldp (MPLS)

[ROUTER]dis mpls lsp Exibe informações sobre caminho do label MPLS

<ROUTER>save Salva config memoria volátil para não volátil

_______________________________________________________________________________________________
TREINAMENTO – CONCEITOS E PRÁTICAS DE REDES PARA PROVEDOR DE SERVIÇOS -
www.fixartelecom.com.br
2
LABORATÓRIO

TABELA DE REDES IP

BORDA L3VPN-01 L3VPN-02


Loopback0 192.168.0.10/32 Eth0/0/1 10.0.0.1/24 Eth0/0/1 10.10.10.1/24
GE0/0/0 172.16.100.1/30 GE0/0/1 192.168.254.2/30 GE0/0/3 192.168.254.6/30
GE0/0/0.100 45.100.203.253/30
GE0/0/0.200 45.100.204.253/30
GE0/0/1 189.101.189.102/30
GE0/0/3 181.181.181.2/30

CENTRAL SETOR-2 SETOR-3


Loopback0 192.168.0.1/32 Loopback0 192.168.0.2/32 Loopback0 192.168.0.3/32
Eth0/0/0 172.16.2.1/30 GE0/0/0 172.16.20.1/30 Eth0/0/0 172.16.30.2/30
GE0/0/0 172.16.100.2/30 GE0/0/1 172.16.10.2/30 GE0/0/0 172.16.20.2/30
GE0/0/1 172.16.10.1/30 GE0/0/1 192.168.254.1/30
GE0/0/2 172.16.40.1/30
GE0/0/3 192.168.254.5/30

SETOR-4 TRANSITO-CLIENTE-AS65321 BANDA LARGA


Loopback0 192.168.0.4/32 Eth0/0/1 201.225.225.1/22 Loopback0 192.168.0.8
Eth0/0/0 172.16.30.1/30 GE0/0/3.100 45.100.203.254/30 Eth0/0/0 172.16.2.2/30
GE0/0/2 172.16.40.2/30 GE0/0/3.200 45.100.204.254/30 Eth0/0/1 45.100.200.1/24

_______________________________________________________________________________________________
TREINAMENTO – CONCEITOS E PRÁTICAS DE REDES PARA PROVEDOR DE SERVIÇOS -
www.fixartelecom.com.br
3
CONFIGURAÇÕES OSPF

ROUTER CENTRAL ROUTER SETOR-2

ospf 10 router-id 192.168.0.1 ospf 10 router-id 192.168.0.2


area 0.0.0.0 area 0.0.0.0
network 172.16.10.0 0.0.0.3 network 172.16.20.0 0.0.0.3
network 172.16.40.0 0.0.0.3 network 172.16.10.0 0.0.0.3
network 172.16.100.0 0.0.0.3 network 192.168.0.2 0.0.0.0
network 192.168.0.1 0.0.0.0 #
area 1.1.1.1 interface GigabitEthernet0/0/0
network 172.16.2.0 0.0.0.3 description SETOR-3
# ospf network-type p2p
interface GigabitEthernet0/0/1 #
description SETOR-2 interface GigabitEthernet0/0/1
ospf network-type p2p description CENTRAL
# ospf network-type p2p
interface GigabitEthernet0/0/2
description SETOR-4 ROUTER SETOR-4
ospf network-type p2p
# ospf 10 router-id 192.168.0.4
interface GigabitEthernet0/0/0 area 0.0.0.0
description BORDA-FISICO network 172.16.30.0 0.0.0.3
ospf network-type p2p network 172.16.40.0 0.0.0.3
# network 192.168.0.4 0.0.0.0
interface Ethernet0/0/0
description BANDA-LARGA interface Ethernet0/0/0
ospf network-type p2p description SETOR-3
ospf network-type p2p
#
interface GigabitEthernet0/0/2
description CENTRAL
ospf network-type p2p

ROUTER SETOR-3 ROUTER BORDA

ospf 10 router-id 192.168.0.3 ospf 10 router-id 192.168.0.10


area 0.0.0.0 area 0.0.0.0
network 172.16.20.0 0.0.0.3 network 172.16.100.0 0.0.0.3
network 172.16.30.0 0.0.0.3 network 192.168.0.10 0.0.0.0
network 192.168.0.3 0.0.0.0 #
# interface GigabitEthernet0/0/0
interface Ethernet0/0/0 description CENTRAL-FISICO
description SETOR-3 ospf network-type p2p
ospf network-type p2p
# BANDA LARGA ??? – Monte a configuração
interface GigabitEthernet0/0/0 baseado no que aprendemos.
description SETOR-2
ospf network-type p2p

display ospf peer brief

_______________________________________________________________________________________________
TREINAMENTO – CONCEITOS E PRÁTICAS DE REDES PARA PROVEDOR DE SERVIÇOS -
www.fixartelecom.com.br
4
CONFIGURAÇÕES MPLS

ROUTER CENTRAL ROUTER SETOR-2

mpls lsr-id 192.168.0.1 mpls lsr-id 192.168.0.2


mpls mpls
# #
mpls l2vpn mpls l2vpn
# #
mpls ldp mpls ldp
# #
# #
mpls ldp remote-peer SETOR-2 mpls ldp remote-peer CENTRAL
remote-ip 192.168.0.2 remote-ip 192.168.0.1
# #
mpls ldp remote-peer SETOR-3 mpls ldp remote-peer SETOR-3
remote-ip 192.168.0.3 remote-ip 192.168.0.3
# #
mpls ldp remote-peer SETOR-4 mpls ldp remote-peer SETOR-4
remote-ip 192.168.0.4 remote-ip 192.168.0.4

interface GigabitEthernet0/0/1 interface GigabitEthernet0/0/0


description SETOR-2 description SETOR-3
mtu 9216 mtu 9216
ip address 172.16.10.1 255.255.255.252 ip address 172.16.20.1 255.255.255.252
ospf network-type p2p ospf network-type p2p
mpls mpls
mpls ldp mpls ldp
# #
interface GigabitEthernet0/0/2 interface GigabitEthernet0/0/1
description SETOR-4 description NORTE
mtu 9216 mtu 9216
ip address 172.16.40.1 255.255.255.252 ip address 172.16.10.2 255.255.255.252
ospf network-type p2p ospf network-type p2p
mpls mpls
mpls ldp mpls ldp

_______________________________________________________________________________________________
TREINAMENTO – CONCEITOS E PRÁTICAS DE REDES PARA PROVEDOR DE SERVIÇOS -
www.fixartelecom.com.br
5
CONFIGURAÇÕES MPLS

ROUTER SETOR-3 ROUTER SETOR-4

mpls lsr-id 192.168.0.3 mpls lsr-id 192.168.0.4


mpls mpls
# #
mpls l2vpn mpls l2vpn
# #
mpls ldp mpls ldp
# #
# #
mpls ldp remote-peer CENTRAL mpls ldp remote-peer CENTRAL
remote-ip 192.168.0.1 remote-ip 192.168.0.1
# #
mpls ldp remote-peer SETOR-2 mpls ldp remote-peer SETOR-2
remote-ip 192.168.0.2 remote-ip 192.168.0.2
# #
mpls ldp remote-peer SETOR-4 mpls ldp remote-peer SETOR-3
remote-ip 192.168.0.4 remote-ip 192.168.0.3
# #
interface Ethernet0/0/0 interface Ethernet0/0/0
description SETOR-4 description SETOR-3
mtu 1560 mtu 1560
ip address 172.16.30.2 ip address 172.16.30.1
255.255.255.252 255.255.255.252
ospf network-type p2p ospf network-type p2p
mpls mpls
mpls ldp mpls ldp
# #
interface GigabitEthernet0/0/0 interface GigabitEthernet0/0/2
description SETOR-2 description NORTE
mtu 9216 mtu 9216
ip address 172.16.20.2 ip address 172.16.40.2
255.255.255.252 255.255.255.252
ospf network-type p2p ospf network-type p2p
mpls mpls
mpls ldp mpls ldp

display mpls ldp peer

_______________________________________________________________________________________________
TREINAMENTO – CONCEITOS E PRÁTICAS DE REDES PARA PROVEDOR DE SERVIÇOS -
www.fixartelecom.com.br
6
CONFIGURAÇÕES VPWS

ROUTER CENTRAL ROUTER SETOR-3

interface GigabitEthernet0/0/0.100 interface GigabitEthernet0/0/3.100


vlan-type dot1q 100 vlan-type dot1q 100
description CLIENTE-VPWS-AS65321-PRINC description CLIENTE-VPWS-AS65321-PRINC
mpls l2vc 192.168.0.3 100 mpls l2vc 192.168.0.1 100

interface GigabitEthernet0/0/0.200 interface GigabitEthernet0/0/3.200


vlan-type dot1q 200 vlan-type dot1q 200
description CLIENTE-VPWS-AS65321-RED description CLIENTE-VPWS-AS65321-RED
mpls l2vc 192.168.0.3 200 mpls l2vc 192.168.0.1 200

display mpls l2vc brief


CONFIGURAÇÕES VPLS

ROUTER CENTRAL ROUTER SETOR-2

vsi VPLS vsi VPLS


pwsignal ldp pwsignal ldp
vsi-id 2000 vsi-id 2000
peer 192.168.0.2 peer 192.168.0.1
peer 192.168.0.2 pw 2 peer 192.168.0.1 pw 2
peer 192.168.0.4 peer 192.168.0.4
peer 192.168.0.4 pw 4 peer 192.168.0.4 pw 8

interface Ethernet0/0/1 interface Ethernet0/0/1


description VPLS-01 description VPLS-02
l2 binding vsi VPLS l2 binding vsi VPLS

ROUTER SETOR-4

vsi VPLS
pwsignal ldp
vsi-id 2000
peer 192.168.0.1
peer 192.168.0.1 pw 4
peer 192.168.0.2
peer 192.168.0.2 pw 8

interface Ethernet0/0/1
description VPLS-03
l2 binding vsi VPLS

display vsi service all


display vsi //// display vsi verbose

_______________________________________________________________________________________________
TREINAMENTO – CONCEITOS E PRÁTICAS DE REDES PARA PROVEDOR DE SERVIÇOS -
www.fixartelecom.com.br
7
CONFIGURAÇÕES iBGP – ROUTER REFLECTOR

### ROUTER BANDA-LARGA ###

bgp 65123
router-id 192.168.0.8
peer 192.168.0.1 as-number 65123
peer 192.168.0.1 description iBGP-CENTRAL
peer 192.168.0.1 connect-interface LoopBack0
#
ipv4-family unicast
import-route direct
peer 192.168.0.1 enable
peer 192.168.0.1 next-hop-local

### ROUTER BORDA ###

ip ip-prefix DENY_ANY index 9999 deny 0.0.0.0 0 less-equal 32


#
route-policy DENY_ANY permit node 10
if-match ip-prefix DENY_ANY
#
route-policy DENY_ANY deny node 20
#
bgp 65123
router-id 192.168.0.10
peer 192.168.0.1 as-number 65123
peer 192.168.0.1 description iBGP-CENTRAL
peer 192.168.0.1 connect-interface LoopBack0
peer 192.168.0.1 enable
peer 192.168.0.1 route-policy DENY_ANY export
peer 192.168.0.1 next-hop-local
peer 192.168.0.1 default-route-advertise

### ROUTER CENTRAL - REFLECTOR ###

bgp 65123
router-id 192.168.0.1
peer 192.168.0.8 as-number 65123
peer 192.168.0.8 description iBGP-BANDA-LARGA
peer 192.168.0.8 connect-interface LoopBack0
peer 192.168.0.10 as-number 65123
peer 192.168.0.10 description iBGP-BORDA
peer 192.168.0.10 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 192.168.0.8 enable
peer 192.168.0.8 reflect-client
peer 192.168.0.10 enable
peer 192.168.0.10 reflect-client
display bgp peer

_______________________________________________________________________________________________
TREINAMENTO – CONCEITOS E PRÁTICAS DE REDES PARA PROVEDOR DE SERVIÇOS -
www.fixartelecom.com.br
8
CONFIGURAÇÕES L3VPN

ROUTER CENTRAL ROUTER SETOR-3

ip vpn-instance CLIENTEL3VPN ip vpn-instance CLIENTEL3VPN


ipv4-family ipv4-family
route-distinguisher 65123:1 route-distinguisher 65123:3
vpn-target 65123:100 export-extcommunity vpn-target 65123:100 export-extcommunity
vpn-target 65123:100 import-extcommunity vpn-target 65123:100 import-extcommunity

interface GigabitEthernet0/0/3 interface GigabitEthernet0/0/1


description CLIENTE-L3VPN description CLIENTE-L3VPN
ip binding vpn-instance CLIENTEL3VPN ip binding vpn-instance CLIENTEL3VPN
ip address 192.168.254.5 255.255.255.252 ip address 192.168.254.1 255.255.255.252

bgp 65123 bgp 65123


peer 192.168.0.3 as-number 65123 peer 192.168.0.1 as-number 65123
peer 192.168.0.3 description iBGP-SETOR3 peer 192.168.0.1 description iBGP-CENTRAL
peer 192.168.0.3 connect-interface LoopBack0 peer 192.168.0.1 connect-interface LoopBack0
# #
ipv4-family unicast ipv4-family unicast
peer 192.168.0.3 enable peer 192.168.0.1 enable
# #
ipv4-family vpnv4 ipv4-family vpnv4
policy vpn-target policy vpn-target
peer 192.168.0.3 enable peer 192.168.0.1 enable
# #
ipv4-family vpn-instance CLIENTEL3VPN ipv4-family vpn-instance CLIENTEL3VPN
peer 192.168.254.6 as-number 65200 peer 192.168.254.2 as-number 65200
peer 192.168.254.6 description L3VPN-02-FILIAL peer 192.168.254.2 description L3VPN-01-MATRIZ
peer 192.168.254.6 connect-interface Gi0/0/3 peer 192.168.254.2 connect-interface Gi0/0/1

ROUTER L3VPN-02 FILIAL ROUTER L3VPN-01 MATRIZ

bgp 65200 bgp 65200


peer 192.168.254.5 as-number 65123 peer 192.168.254.1 as-number 65123
peer 192.168.254.5 description AS65123-CENTRAL peer 192.168.254.1 description AS65123-SETOR2
peer 192.168.254.5 connect-interface Gi0/0/3 peer 192.168.254.1 connect-interface Gi0/0/1
# #
ipv4-family unicast ipv4-family unicast
undo synchronization undo synchronization
network 10.10.10.0 255.255.255.0 network 10.0.0.0 255.255.255.0
peer 192.168.254.5 enable peer 192.168.254.1 enable
peer 192.168.254.5 allow-as-loop peer 192.168.254.1 allow-as-loop

dis bgp vpnv4 vpn-instance CLIENTEL3VPN peer


display bgp vpnv4 vpn-instance CLIENTEL3VPN routing-table peer 192.168.254.6 advertised-routes

display bgp vpnv4 vpn-instance CLIENTEL3VPN routing-table peer 192.168.254.6 received-routes

_______________________________________________________________________________________________
TREINAMENTO – CONCEITOS E PRÁTICAS DE REDES PARA PROVEDOR DE SERVIÇOS -
www.fixartelecom.com.br
9
CONFIGURAÇÕES BGP – OPERADORAS

ROUTER BORDA

#### PREFIX-LIST ####


ip ip-prefix ENTRADA index 10 deny 0.0.0.0 0
ip ip-prefix ENTRADA index 20 deny 10.0.0.0 8 greater-equal 8 less-equal 32
ip ip-prefix ENTRADA index 30 deny 169.254.0.0 16 greater-equal 16 less-equal 32
ip ip-prefix ENTRADA index 40 deny 172.16.0.0 12 greater-equal 12 less-equal 32
ip ip-prefix ENTRADA index 50 deny 192.0.2.0 24 greater-equal 24 less-equal 32
ip ip-prefix ENTRADA index 60 deny 192.168.0.0 16 greater-equal 16 less-equal 32
ip ip-prefix ENTRADA index 100 deny 45.100.200.0 22 greater-equal 22 less-equal 32
ip ip-prefix ENTRADA index 999 permit 0.0.0.0 0 less-equal 32
#
ip ip-prefix ANUNCIO index 10 permit 45.100.200.0 22
ip ip-prefix ANUNCIO index 20 permit 201.225.224.0 22
ip ip-prefix ANUNCIO index 999 deny 0.0.0.0 0 less-equal 32

#### ROUTE-POLICY LINK AS65211 ####


route-policy ENTRADA-LINK-AS65211 permit node 10
if-match ip-prefix ENTRADA
#
route-policy ENTRADA-LINK-AS65211 deny node 999

route-policy ANUNCIO-LINK-AS65211 permit node 10


if-match ip-prefix ANUNCIO
#
route-policy ANUNCIO-LINK-AS65211 deny node 999

#### ROUTE-POLICY LINK AS65111 ####


route-policy ENTRADA-LINK-AS65111 permit node 10
if-match ip-prefix ENTRADA
#
route-policy ENTRADA-LINK-AS65111 deny node 999

route-policy ANUNCIO-LINK-AS65111 permit node 10


if-match ip-prefix ANUNCIO
#
route-policy ANUNCIO-LINK-AS65111 deny node 999

#### ROTA ESTATICA NULL ####


ip route-static 45.100.200.0 255.255.252.0 NULL0 description ENTRADA-BGP

_______________________________________________________________________________________________
TREINAMENTO – CONCEITOS E PRÁTICAS DE REDES PARA PROVEDOR DE SERVIÇOS -
www.fixartelecom.com.br
10
bgp 65123
peer 181.181.181.1 as-number 65211
peer 181.181.181.1 description AS65211
peer 181.181.181.1 connect-interface GigabitEthernet0/0/3
peer 189.101.189.101 as-number 65111
peer 189.101.189.101 description AS65111
peer 189.101.189.101 connect-interface GigabitEthernet0/0/1
#
ipv4-family unicast
network 45.100.200.0 255.255.252.0
peer 181.181.181.1 enable
peer 181.181.181.1 route-policy ENTRADA-LINK-AS65211 import
peer 181.181.181.1 route-policy ANUNCIO-LINK-AS65211 export
peer 189.101.189.101 enable
peer 189.101.189.101 route-policy ENTRADA-LINK-AS65111 import
peer 189.101.189.101 route-policy ANUNCIO-LINK-AS65111 export

display bgp peer


display bgp routing-table peer X.X.X.X advertised-routes
display bgp routing-table peer X.X.X.X received-routes

_______________________________________________________________________________________________
TREINAMENTO – CONCEITOS E PRÁTICAS DE REDES PARA PROVEDOR DE SERVIÇOS -
www.fixartelecom.com.br
11
CONFIGURAÇÕES BGP – CLIENTE/TRÂNSITO

ROUTER BORDA

ip ip-prefix ENTRADA_AS65321 index 10 permit 201.225.224.0 22 greater-equal 22 less-equal 24


ip ip-prefix ENTRADA_AS65321 index 999 deny 0.0.0.0 0 less-equal 32
#
ip ip-prefix SAIDA_AS65321 index 10 deny 0.0.0.0 0
ip ip-prefix SAIDA_AS65321 index 20 permit 0.0.0.0 0 less-equal 32

route-policy ENTRADA_AS65321 permit node 10


if-match ip-prefix ENTRADA_AS65321
#
route-policy ENTRADA_AS65321 deny node 999
#
route-policy SAIDA_AS65321 permit node 10
if-match ip-prefix SAIDA_AS65321
#
route-policy SAIDA_AS65321 deny node 999

bgp 65123
peer 45.100.203.254 as-number 65321
peer 45.100.203.254 description AS65321-PRINC
peer 45.100.203.254 connect-interface GigabitEthernet0/0/0.100
peer 45.100.204.254 as-number 65321
peer 45.100.204.254 description AS65321-RED
peer 45.100.204.254 connect-interface GigabitEthernet0/0/0.200

#
ipv4-family unicast
peer 45.100.203.254 enable
peer 45.100.203.254 route-policy ENTRADA_AS565321 import
peer 45.100.203.254 route-policy SAIDA_AS65321 export
peer 45.100.204.254 enable
peer 45.100.204.254 route-policy ENTRADA_AS565321 import
peer 45.100.204.254 route-policy SAIDA_AS65321 export

display bgp peer


display bgp routing-table peer X.X.X.X advertised-routes
display bgp routing-table peer X.X.X.X received-routes

_______________________________________________________________________________________________
TREINAMENTO – CONCEITOS E PRÁTICAS DE REDES PARA PROVEDOR DE SERVIÇOS -
www.fixartelecom.com.br
12
CONFIGURAÇÕES BGP – ATRIBUTOS

ROUTER BORDA

#### WEIGHT/PREFERRED-VALUE ####

bgp 65123
peer 181.181.181.1 preferred-value 50

ROLLBACK

bgp 65123
undo peer 181.181.181.1 preferred-value

#### LOCAL-PREFENCE ####

route-policy ENTRADA-LINK-AS65111 permit node 10


if-match ip-prefix ENTRADA
apply local-preference 150

ROLLBACK

route-policy ENTRADA-LINK-AS65111 permit node 10


if-match ip-prefix ENTRADA
undo apply local-preference

#### PREPEND ####

route-policy ANUNCIO-LINK-AS65211 permit node 10


if-match ip-prefix ANUNCIO
apply as-path 65123 65123 additive

ROLLBACK

route-policy ANUNCIO-LINK-AS65211 permit node 10


undo apply as-path

ROUTER TRANSITO-CLIENTE-AS65321

#### MED ####

route-policy ANUNCIO permit node 10


if-match ip-prefix ANUNCIO
apply cost 200
#
route-policy ANUNCIO-RED permit node 10
if-match ip-prefix ANUNCIO
apply cost 100

_______________________________________________________________________________________________
TREINAMENTO – CONCEITOS E PRÁTICAS DE REDES PARA PROVEDOR DE SERVIÇOS -
www.fixartelecom.com.br
13

Você também pode gostar