Cisco IOS XR – Ghid de configurare de baza

Observatii:

– toate comenzile au fost executate in XRv (5.1.1) + GNS3 + VirtualBox pe Ubuntu 12.04 LTS; detalii complete intr-un alt post pe blog care include si tutorial video;

– topologia folosita este cea din imaginea de mai jos si contine toate informatiile despre adresare, interfete, protocoale etc pentru a putea fi recreata de cei interesati;

– configurarea protocoalelor de rutare pentru IOS-ul clasic a fost realizata conform topologiei de mai jos fara a mai fi exemplificata in acest document; o buna cunoastere a Cisco IOS este necesara pentru intelegere;

– pentru intelegerea terminologiei si conceptelor folosite in acest document sunt necesare cel putin cunostinte CCNA;

– comenzile introduse apar bold-italic cu negru, iar outputul XR-ului este italic cu negru; cu albastru apar comentariile suplimentare care nu fac parte din comenzi sau din output;

IOS XR se bazeaza pe un micro kernel numit QNX Neutrino de la QNX Software Systems folosit pentru "real-time systems".

Conform propriului site (http://www.qnx.com/company/30ways/) QNX este “Known for building the world's most reliable operating system for mission-critical applications”.

Sistemele QNX sunt folosite atat in routere Cisco dar cat si pentru centrale nucleare sau hidroelectice, simulatoare pentru traficul aerian sau mecanisme industriale folosite de companii precum Asics sau Audi.

XR este un OS modular, fiecare proces ruleaza in propriul spatiu de memorie. IOS este nemodular iar toate procesele impart acelasi spatiu de memorie; In IOS un crash al unui proces nu este limitat ci poate determina crash-ul intregului sistem (de multe ori restart al routerului);

Screenshot from 2014-04-28 13:12:24

 

IOS XR ruleaza pe Cisco CRS-1, Cisco XR 12000 si Cisco ASR 9000.

 

COMMIT

– comenzile nu sunt aplicate imediat, exista 2 configuration stages: active and candidate configuration

– configuratia trebuie COMMITed inainte sa devina activa. Se poate comite (salva/activa) din orice mod de configuarare;

– se pot observa modificarile inainte sa fie COMMITed cu RP/0/0/CPU0:ios(config)#show config care se poate rula din orice mod (mai putin #)

– ca si la IOS comenzile sunt case insensitive

– pentru a nu comite modificarile se poate iesi cu exit din configuratie sau se ruleaza clear

RP/0/0/CPU0:ios(config)#int loopback 5

RP/0/0/CPU0:ios(config-if)#ip add 56.56.56.56/32

RP/0/0/CPU0:ios(config-if)#exit

RP/0/0/CPU0:ios(config)#exit

Uncommitted changes found, commit them before exiting(yes/no/cancel)? [cancel]:no

RP/0/0/CPU0:ios#conf t

Mon Apr 28 12:52:51.004 UTC

RP/0/0/CPU0:ios(config)#show configuration

Mon Apr 28 12:52:53.114 UTC

Building configuration…

!! IOS XR Configuration 5.1.1

end

RP/0/0/CPU0:ios(config)#int loopback 5

RP/0/0/CPU0:ios(config-if)#ip add 56.56.56.56/32

RP/0/0/CPU0:ios(config-if)#exit

RP/0/0/CPU0:ios(config)#show configuration

Mon Apr 28 12:53:55.889 UTC

Building configuration…

!! IOS XR Configuration 5.1.1

interface Loopback5

ipv4 address 56.56.56.56 255.255.255.255

!

end

RP/0/0/CPU0:ios(config)#commit

Mon Apr 28 12:54:06.719 UTC

RP/0/0/CPU0:ios(config)#show configuration

Mon Apr 28 12:54:10.768 UTC

Building configuration…

!! IOS XR Configuration 5.1.1

end

 

Comanda commit confimed <minute nr | seconds> realizeaza rollback dupa nr. de minute sau secunde in cazul in care nu se comit modificarile. Util pentru a nu se pierde conexiunea cu echipamentul la commit.

 

Afiseaza modificarile aduse configuratie curente de la al nr commit

RP/0/0/CPU0:R1(config)#sh configuration commit changes last nr 

 

 

Afisare modificari aduse configuratiei active incepand cu 2 commituri in urma

RP/0/0/CPU0:R1(config)#sh configuration commit changes last 2

Thu Apr 24 13:58:19.576 UTC

Building configuration…

!! IOS XR Configuration 5.1.1

telnet vrf default ipv4 server max-servers 2

interface Loopback1

ipv4 address 3.3.3.3 255.255.255.255

!

interface Loopback3

ipv4 address 5.5.5.5 255.255.255.255

!

end

 

Unui commit i se poate atasa un comentariu care se observa apoi cu show configuration history last nr detail

RP/0/0/CPU0:R1(config)#commit comment created by cma today

RP/0/0/CPU0:R1(config)#show configuration history last 1 detail

Thu Apr 24 13:59:59.489 UTC

1) Event: commit Time: Thu Apr 24 13:59:38 2014

Commit ID: 1000000008 Label:

User: class Line: vty0:node0_0_CPU0

Client: CLI Comment: created by cma today

Aducerea la factory default a XR-ului (echivalentul comenzilor erase startup urmata de reload in IOS):

RP/0/RP0/CPU0:cma(config)#commit replace

 

Comanda pwd -> afiseaza interfata in care ne aflam daca suntem in modul de configurare al intefetei. IP-ul interfetei + [no]shut se configureaza ca in IOS

 

#sh run int g0/0/0/0 -> afiseaza info din active config despre interfata

 

Aliases

RP/0/0/CPU0:ios(config)#alias shintbr show ip int brief

RP/0/0/CPU0:ios(config)#commit

Thu Apr 24 16:53:00.047 UTC

RP/0/0/CPU0:ios(config)#exit

RP/0/0/CPU0:ios#shintbr

RP/0/0/CPU0:ios#show ip int brief -> IOS XR afiseaza si executa comanda din spatele aliasului in mod automat

Thu Apr 24 16:53:18.916 UTC

Interface IP-Address Status Protocol

MgmtEth0/0/CPU0/0 unassigned Shutdown Down

GigabitEthernet0/0/0/0 11.0.0.1 Up Up

GigabitEthernet0/0/0/1 unassigned Shutdown Down

GigabitEthernet0/0/0/2 unassigned Shutdown Down

 

Interface Alias

RP/0/0/CPU0:ios(config)#alias r1connection gig0/0/0/0

RP/0/0/CPU0:ios(config)#commit

Thu Apr 24 16:56:24.693 UTC

RP/0/0/CPU0:ios(config)#int r1connection

RP/0/0/CPU0:ios(config)#int gig0/0/0/0

RP/0/0/CPU0:ios(config-if)#exit

RP/0/0/CPU0:ios(config)#exit

Uncommitted changes found, commit them before exiting(yes/no/cancel)? [cancel]:syes

RP/0/0/CPU0:ios#sh int r1connection

RP/0/0/CPU0:ios#sh int gig0/0/0/0

Thu Apr 24 16:56:53.581 UTC

GigabitEthernet0/0/0/0 is up, line protocol is up

Interface state transitions: 1

Hardware is GigabitEthernet, address is 0800.273f.d975 (bia 0800.273f.d975)

 

Interface wildcards

RP/0/0/CPU0:ios#sh run int l*

Thu Apr 24 17:01:15.333 UTC

interface Loopback0

ipv4 address 1.1.1.1 255.255.255.255

!

interface Loopback1

ipv4 address 2.2.2.2 255.255.255.255

 

Procese

In IOX XR un thread este unitatea elementara de executie careia i se aloca resurse (RAM si CPU). Pe de alta parte un proces este un container pentru mai multe thread-uri inrudite si defineste spatiul de memorie in care threadurile se executa.

Fiecarui proces i se asigneaza un JOB ID (JID) care este constant, este mereu acelasi (JID-ul identifica executabilul). Un proces mai este identificat si de PROCESS ID (PID) care este asignat la pornire si deci este variabil.

 

Afiseaza threadurile unui process identificat dupa jid

show process threadname jid

Afiseaza procesele dupa nume sau jid

show process <name|jid>

 

RP/0/0/CPU0:ios#show processes eigrp

Mon Apr 28 12:59:28.667 UTC

Job Id: 1002

PID: 659721

Executable path: /disk0/iosxr-routing-5.1.1/bin/eigrp

Instance #: 1

Version ID: 00.00.0000

Respawn: ON

Respawn count: 1

Max. spawns per minute: 12

Last started: Mon Apr 28 11:54:14 2014

Process state: Run

Package state: Normal

Started on config: cfg/gl/eigrp/proc/1/ord_a/default/ord_a/enabled

Process group: v4-routing

core: MAINMEM

Max. core: 0

–etc—

RP/0/0/CPU0:ios#sh processes 1048 (1048 jobid procesului BGP)

Mon Apr 28 12:47:18.927 UTC

Job Id: 1048

PID: 659724

Executable path: /disk0/iosxr-routing-5.1.1/bin/bgp

Instance #: 1

Version ID: 00.00.0000

Respawn: ON

Respawn count: 1

Max. spawns per minute: 12

Last started: Mon Apr 28 11:54:22 2014

Process state: Run

Package state: Normal

Started on config: default

Feature name: ON

Tag : default

Process group: v4-routing

core: MAINMEM

Max. core: 0

Placement: Placeable

startup_path: /pkg/startup/bgp.startup

Ready: 1.909s

Available: 85.734s

Process cpu time: 0.230 user, 0.220 kernel, 0.450 total

JID TID Stack pri state TimeInState HR:MM:SS:MSEC NAME

1048 1 416K 10 Receive 0:27:21:0847 0:00:00:0159 bgp

1048 2 416K 10 Receive 0:52:54:0312 0:00:00:0000 bgp

1048 3 416K 10 Receive 0:00:01:0219 0:00:00:0019 bgp

1048 4 416K 10 Receive 0:52:52:0892 0:00:00:0000 bgp

–etc–

#monitor processes – echivalentul comenzii top din Linux

 

Remote access – Telnet & SSH

Porneste serverul telnet cu maxim 5 instante (conexiuni simultane)

RP/0/0/CPU0:ios(config)#telnet ipv4 server max-servers 5

RP/0/0/CPU0:ios(config)#commit

 

SSH

a) setare domeniu si generare chei RSA

RP/0/0/CPU0:ios(config)#domain name cisco.com

RP/0/0/CPU0:ios(config)#commit

RP/0/0/CPU0:ios(config)#exit

RP/0/0/CPU0:ios#crypto key generate rsa -> se executa din enable mode

Thu Apr 24 17:09:21.730 UTC

The name for the keys will be: the_default

Choose the size of the key modulus in the range of 512 to 2048 for your General Purpose Keypair. Choosing a key modulus greater than 512 may take a few minutes.

How many bits in the modulus [1024]:

Generating RSA keys …

Done w/ crypto generate keypair

[OK]

b) pornire serviciu

RP/0/0/CPU0:ios(config)#ssh server v2

RP/0/0/CPU0:ios(config)#commit

 

Limitare acces SSH & Telnet

RP/0/RSP0/CPU0:R1(config)#control-plane

RP/0/RSP0/CPU0:R1(config-ctrl)#management-plane

RP/0/RSP0/CPU0:R1(config-mpp-inband)#int g0/0/0/0

RP/0/RSP0/CPU0:R1(config-mpp-inband-if)#allow SSH peer

RP/0/RSP0/CPU0:R1(config-ssh-peer)# address ipv4 10.0.0.0/8

RP/0/RSP0/CPU0:R1(config-ssh-peer)# allow Telnet peer

RP/0/RSP0/CPU0:R1(config-telnet-peer)#address ipv4 10.0.0.0/8

RP/0/RSP0/CPU0:R1(config-telnet-peer)#exit

RP/0/RSP0/CPU0:R1(config-mpp-inband)#comm

Sat Apr 21 01:09:45.163 UTC

 

ACL-uri

Sunt asemanatoare cu cele din IOS ca si mod de configurare.

RP/0/0/CPU0:ios(config-ipv4-acl)#permit tcp 11.0.0.0/8 host 11.0.0.1 eq ssh

RP/0/0/CPU0:ios(config-ipv4-acl)#commit

Thu Apr 24 17:21:37.759 UTC

RP/0/0/CPU0:ios(config-ipv4-acl)#exit

RP/0/0/CPU0:ios(config)#int g0/0/0/0

Atasam ACL-ul pe interfata pentru traficul ingress (in)

RP/0/0/CPU0:ios(config-if)#ipv4 access-group SSH_ACCESS ingress

RP/0/0/CPU0:ios(config-if)#exit

RP/0/0/CPU0:ios(config)#commit

Thu Apr 24 17:22:19.477 UTC

 

RIP

IOS XR suporta doar RIPv2. IOS XR este gandit in primul rand pentru SP unde conexiuniele cu clientii (CE) sunt numeroase si importante. RIP poate fi protocolul recomandat pentru PE-CE routing.

RP/0/0/CPU0:ios(config)#router rip

RP/0/0/CPU0:ios(config-rip)#interface g0/0/0/2

RP/0/0/CPU0:ios(config-rip-if)#int loopback 3

RP/0/0/CPU0:ios(config-rip-if)#exit

RP/0/0/CPU0:ios(config-rip)#commit

Fri Apr 25 16:48:04.905 UTC

 

Redistribuire alte RP sau static in RIP

RP/0/0/CPU0:ios(config)#router rip

Redistribuim rutele statice folosind route-policy pt. setare metrica

RP/0/0/CPU0:ios(config-rip)#redistribute static route-policy rip_metric

RP/0/0/CPU0:ios(config-rip)#exit

Crearea ruta statica pt. redistribuire in rip cu metric conform route-policy rip_metric

RP/0/0/CPU0:ios(config)#router static

RP/0/0/CPU0:ios(config-static)#address-family ipv4 unicast

RP/0/0/CPU0:ios(config-static-afi)#100.0.0.0/8 null 0

RP/0/0/CPU0:ios(config-static-afi)#exit

RP/0/0/CPU0:ios(config-static)#exit

 

Crearea route-policy

RP/0/0/CPU0:ios(config)#route-policy rip_metric

RP/0/0/CPU0:ios(config-rpl)#set rip-metric 3

RP/0/0/CPU0:ios(config-rpl)#end-policy

RP/0/0/CPU0:ios(config)#commit

Mon Apr 28 13:31:16.346 UTC

RP/0/0/CPU0:ios#sh rip database

Mon Apr 28 13:34:10.704 UTC

Routes held in RIP's topology database:

100.0.0.0/8

[3] distance: 1 redistributed

 

Setare interfata pasiva

RP/0/0/CPU0:ios(config)#router rip

RP/0/0/CPU0:ios(config-rip)#int loopback 0

RP/0/0/CPU0:ios(config-rip-if)#passive-interface

RP/0/0/CPU0:ios(config-rip-if)#commit

Mon Apr 28 13:39:16.303 UTC

 

Restart/Shutdown process RIP

RP/0/0/CPU0:ios#process restart rip

Mon Apr 28 13:40:28.908 UTC

RP/0/0/CPU0:ios#process shutdown rip

Mon Apr 28 13:40:37.757 UTC

Process Shutdown of a process could leave the System in an Inconsistent State. Proceed? [confirm]

RP/0/0/CPU0:ios#sh processes rip

Mon Apr 28 13:40:45.787 UTC

Job Id: 1041

PID: 1298584

Executable path: /disk0/iosxr-routing-5.1.1/bin/rip

Instance #: 1

Version ID: 00.00.0000

Respawn: ON

Respawn count: 2

Max. spawns per minute: 12

Last started: Mon Apr 28 13:40:29 2014

Process state: Killed (last exit due to SIGTERM)

Package state: Normal

Registered item(s): cfg/gl/rip/

Process group: v4-routing

core: MAINMEM

Max. core: 0

Placement: Placeable

startup_path: /pkg/startup/ipv4_rip.startup

Ready: 0.339s

Available: 0.349s

 

OSPF

Se defineste procesul ca nume

RP/0/0/CPU0:ios(config)#router ospf lab

Se specifica area (zecimal sau ip format)

RP/0/0/CPU0:ios(config-ospf)#area ?

<0-4294967295> OSPF area ID as a decimal value

A.B.C.D OSPF area ID in IP address format

RP/0/0/CPU0:ios(config-ospf)#area 0

In modul ariei se specifica interfetele care participa la procesul OSPF (nu se mai dau subneturile).

RP/0/0/CPU0:ios(config-ospf-ar)#int l0

RP/0/0/CPU0:ios(config-ospf-ar-if)#int g0/0/0/0

RP/0/0/CPU0:ios(config-ospf-ar-if)#exit

RP/0/0/CPU0:ios(config-ospf-ar)#exit

RP/0/0/CPU0:ios(config-ospf)#exit

RP/0/0/CPU0:ios(config)#commit

Fri Apr 25 13:01:39.956 UTC

RP/0/0/CPU0:ios(config)#exit

RP/0/0/CPU0:ios#sh ip proto

Fri Apr 25 13:01:48.665 UTC

Routing Protocol OSPF lab

Router Id: 1.1.1.1

Distance: 110

Non-Stop Forwarding: Disabled

Redistribution:

None

Area 0

Loopback0

GigabitEthernet0/0/0/0

RP/0/0/CPU0:ios#sh ip ospf nei

Fri Apr 25 13:02:02.014 UTC

* Indicates MADJ interface

Neighbors for OSPF lab

Neighbor ID Pri State Dead Time Address Interface

3.3.3.3 1 FULL/BDR 00:00:37 11.0.0.2 GigabitEthernet0/0/0/0

Neighbor is up for 00:01:38

Total neighbor count: 1

RP/0/0/CPU0:ios#sh ip ro

Fri Apr 25 13:05:11.991 UTC

Codes: C – connected, S – static, R – RIP, B – BGP, (>) – Diversion path

D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area

N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2

E1 – OSPF external type 1, E2 – OSPF external type 2, E – EGP

i – ISIS, L1 – IS-IS level-1, L2 – IS-IS level-2

ia – IS-IS inter area, su – IS-IS summary null, * – candidate default

U – per-user static route, o – ODR, L – local, G – DAGR

A – access/subscriber, a – Application route, (!) – FRR Backup path

Gateway of last resort is not set

L 1.1.1.1/32 is directly connected, 00:20:28, Loopback0

L 2.2.2.2/32 is directly connected, 00:20:28, Loopback1

O 3.3.3.3/32 [110/2] via 11.0.0.2, 00:04:36, GigabitEthernet0/0/0/0

C 11.0.0.0/30 is directly connected, 00:20:27, GigabitEthernet0/0/0/0

L 11.0.0.1/32 is directly connected, 00:20:27, GigabitEthernet0/0/0/0

C 12.0.0.0/30 is directly connected, 00:09:06, GigabitEthernet0/0/0/1

L 12.0.0.1/32 is directly connected, 00:09:06, GigabitEthernet0/0/0/1

 

Alte configurari  OSPF

In comparatie cu IOS se realizeaza in modul de configurarea al procesului OSPF si nu in modul de configurare al interfetei.

 

1. Autentificare

IOS XR suporta area si interface authentication (ca si IOS).

MD5 Interface authentication

RP/0/0/CPU0:ios(config)#router ospf lab

RP/0/0/CPU0:ios(config-ospf)#area 0

RP/0/0/CPU0:ios(config-ospf-ar)#int g0/0/0/0

RP/0/0/CPU0:ios(config-ospf-ar-if)#authentication message-digest

RP/0/0/CPU0:ios(config-ospf-ar-if)#message-digest-key 1 md5 cisco

RP/0/0/CPU0:ios(config-ospf-ar-if)#exit

RP/0/0/CPU0:ios(config-ospf-ar)#commit

Fri Apr 25 16:19:38.822 UTC

RP/0/0/CPU0:ios#sh ospf lab int g0/0/0/0

Fri Apr 25 16:20:59.746 UTC

GigabitEthernet0/0/0/0 is up, line protocol is up

Internet Address 11.0.0.1/30, Area 0

Process ID lab, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1

Transmit Delay is 1 sec, State BDR, Priority 1, MTU 1500, MaxPktSz 1500

Designated Router (ID) 3.3.3.3, Interface address 11.0.0.2

Backup Designated router (ID) 1.1.1.1, Interface address 11.0.0.1

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

Hello due in 00:00:03

Index 2/2, flood queue length 0

Next 0(0)/0(0)

Last flood scan length is 1, maximum is 2

Last flood scan time is 0 msec, maximum is 0 msec

LS Ack List: current length 0, high water mark 3

Neighbor Count is 1, Adjacent neighbor count is 1

Adjacent with neighbor 3.3.3.3 (Designated Router)

Suppress hello for 0 neighbor(s)

Message digest authentication enabled

Youngest key id is 1

Multi-area interface Count is 0


 

2. Cost

RP/0/0/CPU0:ios(config)#router ospf lab

RP/0/0/CPU0:ios(config-ospf)#area 0

RP/0/0/CPU0:ios(config-ospf-ar)#int g0/0/0/0

RP/0/0/CPU0:ios(config-ospf-ar-if)#cost ?

<1-65535> Cost

 

EIGRP

RP/0/0/CPU0:ios(config)#router eigrp 1

Trebuie specificat contextul ipv4 sau ipv6 (address-family ipv4)

Nu se mai specifica subneturile ci interfetele care vor participa la proces

RP/0/0/CPU0:ios(config-eigrp)#address-family ipv4

RP/0/0/CPU0:ios(config-eigrp)#no auto-summary

RP/0/0/CPU0:ios(config-eigrp-af)#int loop0

RP/0/0/CPU0:ios(config-eigrp-af-if)#int g0/0/0/1

RP/0/0/CPU0:ios(config-eigrp-af-if)#exit

RP/0/0/CPU0:ios(config-eigrp-af)#exit

RP/0/0/CPU0:ios(config-eigrp)#commit

Fri Apr 25 16:29:37.121 UTC

RP/0/0/CPU0:ios#sh ip protocols eigrp

Fri Apr 25 16:30:32.867 UTC

Routing Protocol: EIGRP, instance 1

Default context AS: 1, Router ID: 1.1.1.1

Address Family: IPv4

Default networks not flagged in outgoing updates

Default networks not accepted from incoming updates

Distance: internal 90, external 170

Maximum paths: 4

EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0, K6=0

EIGRP metric rib scale 128

EIGRP metric version 64-bit

EIGRP maximum hopcount 100

EIGRP maximum metric variance 1

EIGRP NSF: enabled

NSF-aware route hold timer is 480s

NSF signal timer is 20s

NSF converge timer is 300s

Time since last restart is 00:00:51

SIA Active timer is 180s

Interfaces:

Loopback0

GigabitEthernet0/0/0/0

RP/0/0/CPU0:ios#sh ip ro eigrp

Fri Apr 25 16:42:18.689 UTC

D 4.4.4.4/32 [90/2570240] via 12.0.0.2, 00:00:44, GigabitEthernet0/0/0/1

 

Alte comenzi de show sunt la fel ca cele din IOS: show eigrp traffic, show eigrp neighbor, sh eigrp topoloby

 

BGP & Static routing

iBGP

RP/0/0/CPU0:ios(config)#router bgp 1

RP/0/0/CPU0:ios(config-bgp)#address-family ipv4 unicast

Reteaua pe care o anuntam (loopback 0) sub address-family

RP/0/0/CPU0:ios(config-bgp-af)#network 1.1.1.1/32

RP/0/0/CPU0:ios(config-bgp-af)#exit

Comparabic cu IOS optiunile vecinului se specifica sub vecin si nu in linie cu acesta

RP/0/0/CPU0:ios(config-bgp)#neighbor 5.5.5.5

RP/0/0/CPU0:ios(config-bgp-nbr)#remote-as 1

RP/0/0/CPU0:ios(config-bgp-nbr)#address-family ipv4 unicast

!!Nu uitam pt. ibgp. Pachetele bgp vrem sa aiba ip sursa ip-ul de loopback si nu ip-ul interfetei fizice.

RP/0/0/CPU0:ios(config-bgp-nbr)#update-source loopback 0

RP/0/0/CPU0:ios(config-bgp-nbr-af)#exit

RP/0/0/CPU0:ios(config-bgp-nbr)#commit

Fri Apr 25 16:54:54.147 UTC

 

Setare ruta statica. Este complet diferit de IOS, se configureaza in modul router static sub address-family. Este necesar astfel incat loopback neighbor sa fie reachable (altfel trebuie igp)

RP/0/0/CPU0:ios(config)#router static

RP/0/0/CPU0:ios(config-static)#address-family ipv4 unicast

Atentie ! Pentru interfete ethernet nu se specifica doar interfata de iesire ci ip next hop (optim atat intefata de iesiere cat si ip next hop)

RP/0/0/CPU0:ios(config-static-afi)#5.5.5.5/32 g0/0/0/2 13.0.0.2

RP/0/0/CPU0:ios(config-static-afi)#exit

RP/0/0/CPU0:ios(config-static)#commit

Fri Apr 25 16:56:48.889 UTC

RP/0/0/CPU0:ios#sh ip bgp summary

Fri Apr 25 17:07:13.396 UTC

BGP router identifier 1.1.1.1, local AS number 1

BGP generic scan interval 60 secs

BGP table state: Active

Table ID: 0xe0000000 RD version: 4

BGP main routing table version 4

BGP scan interval 60 secs

BGP is operating in STANDALONE mode.

Process RcvTblVer bRIB/RIB LabelVer ImportVer SendTblVer StandbyVer

Speaker 4 4 4 4 4 4

Neighbor Spk AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down St/PfxRcd

5.5.5.5 0 1 6 4 4 0 0 00:01:00 1

RP/0/0/CPU0:ios#sh ip bgp

Fri Apr 25 17:11:35.758 UTC

BGP router identifier 1.1.1.1, local AS number 1

BGP generic scan interval 60 secs

BGP table state: Active

Table ID: 0xe0000000 RD version: 4

BGP main routing table version 4

BGP scan interval 60 secs

Status codes: s suppressed, d damped, h history, * valid, > best

i – internal, r RIB-failure, S stale, N Nexthop-discard

Origin codes: i – IGP, e – EGP, ? – incomplete

Network Next Hop Metric LocPrf Weight Path

*> 1.1.1.1/32 0.0.0.0 0 32768 i

*>i5.5.5.5/32 5.5.5.5 0 100 0 i

 

eBGP

RP/0/0/CPU0:ios(config)#router bgp 1

RP/0/0/CPU0:ios(config-bgp)#address-family ipv4 unicast

RP/0/0/CPU0:ios(config-bgp-af)#exit

RP/0/0/CPU0:ios(config-bgp)#neighbor 14.0.0.2

RP/0/0/CPU0:ios(config-bgp-nbr)#remote-as 2

RP/0/0/CPU0:ios(config-bgp-nbr)#ebgp-multihop

RP/0/0/CPU0:ios(config-bgp-nbr)#address-family ipv4 unicast

RP/0/0/CPU0:ios(config-bgp-nbr-af)#commit

Mon Apr 28 12:19:10.692 UTC

P/0/0/CPU0:ios#sh ip bgp summa ry

Mon Apr 28 12:19:33.981 UTC

BGP router identifier 1.1.1.1, local AS number 1

BGP generic scan interval 60 secs

BGP table state: Active

Table ID: 0xe0000000 RD version: 5

BGP main routing table version 5

BGP scan interval 60 secs

BGP is operating in STANDALONE mode.

Process RcvTblVer bRIB/RIB LabelVer ImportVer SendTblVer StandbyVer

Speaker 5 5 5 5 5 5

Neighbor Spk AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down St/PfxRcd

5.5.5.5 0 1 21 19 5 0 0 00:15:51 2

14.0.0.2 0 2 2 2 0 0 0 00:00:04 0!

Se observa ca neighborii se afla in established dar nu se primesc prefixe de la vecin.

Outputul comenzii sh ip bgp summary afiseaza 0! la nr. de prefixe primite !!

Pt. a obtine mai multe detalii:

 

RP/0/0/CPU0:ios#sh ip bgp neighbor 14.0.0.2

Mon Apr 28 12:23:08.496 UTC

BGP neighbor is 14.0.0.2

Remote AS 2, local AS 1, external link

Remote router ID 6.6.6.6

BGP state = Established, up for 00:03:38

Last read 00:00:37, Last read before reset 00:00:00

Hold time is 180, keepalive interval is 60 seconds

Configured hold time: 180, keepalive: 60, min acceptable hold time: 3

Last write 00:00:33, attempted 19, written 19

Second last write 00:01:33, attempted 19, written 19

Last write before reset 00:00:00, attempted 0, written 0

Second last write before reset 00:00:00, attempted 0, written 0

Last write pulse rcvd Apr 28 12:22:35.178 last full not set pulse count 13

Last write pulse rcvd before reset 00:00:00

Socket not armed for io, armed for read, armed for write

Last write thread event before reset 00:00:00, second last 00:00:00

Last KA expiry before reset 00:00:00, second last 00:00:00

Last KA error before reset 00:00:00, KA not sent 00:00:00

Last KA start before reset 00:00:00, second last 00:00:00

Precedence: internet

Enforcing first AS is enabled

Multi-protocol capability received

Neighbor capabilities:

Route refresh: advertised (old + new) and received (old + new)

4-byte AS: advertised

Address family IPv4 Unicast: advertised and received

Received 8 messages, 0 notifications, 0 in queue

Sent 6 messages, 0 notifications, 0 in queue

Minimum time between advertisement runs is 30 secs

For Address Family: IPv4 Unicast

BGP neighbor version 5

Update group: 0.3 Filter-group: 0.2 No Refresh request being processed

eBGP neighbor with no inbound or outbound policy; defaults to 'drop'

Route refresh request: received 0, sent 0

0 accepted prefixes, 0 are bestpaths

Cumulative no. of prefixes denied: 1.

No policy: 1, Failed RT match: 0

By ORF policy: 0, By policy: 0

Prefix advertised 0, suppressed 0, withdrawn 0

Maximum prefixes allowed 1048576

Threshold for warning message 75%, restart interval 0 min

An EoR was not received during read-only mode

Last ack version 5, Last synced ack version 0

Outstanding version objects: current 0, max 0

Additional-paths operation: None

Connections established 1; dropped 0

Local host: 14.0.0.1, Local port: 179, IF Handle: 0x00000000

Foreign host: 14.0.0.2, Foreign port: 56888

Last reset 00:00:00

External BGP neighbor may be up to 255 hops away.

 

O prima diferenta intre IOS si IOS XR este ca in cazul eBGP default route-policy este DROP pentru prefixele primite sau anuntate.

In loc de route-maps IOS XR foloseste Route Policy Language (RPL).

 

Creare route-policy pentru a permite prefixele eBGP

RP/0/0/CPU0:ios(config)#route-policy PERMIT_EBGP

RP/0/0/CPU0:ios(config-rpl)#?

#-remark Remark beginning with '#'

abort Discard RPL definition and return to top level config

add Add offset to the existing value

apply Apply a route policy

delete Delete route attributes

done Accept this route with no further processing

drop Reject this route with no further processing

end-policy End of route-policy definition

exit Exit from this submode

if Begin if-statement

pass Pass this route for further processing

prepend Prepend to BGP AS-path

replace Replace a sequence of AS numbers with local AS

set Set a route attribute

show Show partial RPL configuration

suppress-route Suppress specific routes when aggregating

unsuppress-route Unsuppress specific aggregated routes

<cr>

RP/0/0/CPU0:ios(config-rpl)#pass

RP/0/0/CPU0:ios(config-rpl)#exit

RP/0/0/CPU0:ios(config)#commit

Mon Apr 28 12:26:37.142 UTC

Atasare route-policty PERMIT_EBGP pentru neighborul eBGP

RP/0/0/CPU0:ios(config)#router bgp 1

RP/0/0/CPU0:ios(config-bgp)#neighbor 14.0.0.2

RP/0/0/CPU0:ios(config-bgp-nbr)#address-family ipv4 unicast

RP/0/0/CPU0:ios(config-bgp-nbr-af)#route-policy PERMIT_EBGP out

RP/0/0/CPU0:ios(config-bgp-nbr-af)#route-policy PERMIT_EBGP in

RP/0/0/CPU0:ios(config-bgp-nbr-af)#commit

Mon Apr 28 12:27:43.167 UTC

RP/0/0/CPU0:ios(config-bgp-nbr-af)#end

RP/0/0/CPU0:ios#sh ip bgp summ

Mon Apr 28 12:28:56.042 UTC

BGP router identifier 1.1.1.1, local AS number 1

BGP generic scan interval 60 secs

BGP table state: Active

Table ID: 0xe0000000 RD version: 6

BGP main routing table version 6

BGP scan interval 60 secs

BGP is operating in STANDALONE mode.

Process RcvTblVer bRIB/RIB LabelVer ImportVer SendTblVer StandbyVer

Speaker 6 6 6 6 6 6

Neighbor Spk AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down St/PfxRcd

5.5.5.5 0 1 31 29 6 0 0 00:25:13 2

14.0.0.2 0 2 15 15 6 0 0 00:09:26 1

 

Filtrarea rutelor BGP primite sau anuntate, manipularea atributelor BGP (local pref, med, etc) se realizeaza folosind RPL (Route Policy Language) – comparativ cu IOS unde se folosesc route-maps.

Detalii: http://www.cisco.com/c/en/us/td/docs/routers/xr12000/software/xr12k_r4-2/routing/command/reference/b_routing_cr42xr12k/b_routing_cr42xr12k_chapter_01000.html

https://supportforums.cisco.com/document/88676/asr9000xr-understanding-and-using-rpl-route-policy-language

 

Te asteptam la cursurile Cisco pe care le organizam pentru a invata despre ultimele tehnologii de la profesionisti entuziasti care iti vor prezenta materia intr-un mod usor de asimilat si placut !

1 comment for “Cisco IOS XR – Ghid de configurare de baza

Leave a Reply