Router(config-route-map)

Download Report

Transcript Router(config-route-map)

Chapter 8.
Optimizing Routing Update
Operation
1
Table of Contents
• Redistribution Among Multiple Routing
Protocols
• Configuring Redistribution
• Controlling Routing Update Traffic
• Verifying Redistribution Operation
• Policy-Based Routing Using Route Maps
• Verifying Policy-Based Routing
• Summary
2
Redistribution Among Multiple
Routing Protocols
• What Is Redistribution?
• Redistribution Considerations
3
Redistribution among Multiple Routing Protocols
Multiple Routing Protocol을 사용하는 원인
Migration Purpose로 Multiple Routing Protocol을 사용할 수 있다.라우팅 프
로토콜을 교체하는 경우, 통상 지역별로 점진적으로 Migration하게 된다.
특정 라우팅 프로토콜만(RIP 등)을 지원하는 Host와의 Routing을 위해
Multiple Routing Protocol을 사용한다.(예.RIP를 사용하는 Unix Computer 등
과의 라우팅을 지원하기 위해 사용될 수 있다.)
특정 라우팅 프로토콜을 사용하며, 독자적인 Filtering Policy를 구현하는 조
직의 라우터와의 라우팅을 위해서 Multiple Routing Protocol을 사용한다.
Cisco Router가 아닌 라우터와의 라우팅을 위해 Multiple Routing Protocol을
사용한다.
4
What Is Redistribution?
AS 200
IGRP
172.16.0.0
IP Routing Table
I 192.168.5.0
I 172.16.1.0
I 172.16.2.0
I 172.16.3.0
Boundary
Router
S1
C
S0
A
B
S1 Advertises Routes from
EIGRP to IGRP
S0 Advertises Routes from
IGRP to EIGRP
AS 300
EIGRP
192.168.5.0
IP Routing Table
D EX
D
D
D
172.16.0.0
192.168.5.8
192.168.5.16
192.168.5.24
상이한 라우팅 프로토콜간에 라우팅 Information이 교환될 수 있다.
5
Redistribution Implementation Considerations
Routing Loop이 발생할 수 있다.(두개 이상의 Boundary Router가
Redistribution 하는 경우, 하나의 Boundary Router가 Redistribution한
Routing Information이 다시 Redistribution을 통해서 Source 쪽으로 유입되어
라우팅 루프가 발생할 수 있다.)
라우팅 프로토콜 별로 상이한 Metric 값을 사용하고 Metric 값이 라우팅 프로토
콜 상호간에 완벽하게 변환될 수 없으므로 Suboptimal Path 가 선택될 수 있다.
적절한 Metric 값 조정이 필요하다.
Convergence Time이 서로 상이하여 Convergence가 늦어질 수 있다.
Selecting the Best Route
 Routing Protocol은 각각 상이한 Metric을 사용한다.
 Administrative Distance를 설정하여 Routing Protocol에 대한
신뢰도를 결정하고 Default Metric 설정에 의해 적정하게 Metric 값을
저정해 준다.
6
Administrative Distance
Route Source
Connected interface
Static route out an interface
Static route to a next hop
EIGRP summary route
External BGP
Internal EIGRP
IGRP
OSPF
IS-IS
RIP v1, v2
EGP
External EIGRP
Internal BGP
Unknown
Default Distance
0
0
1
5
20
90
100
110
115
120
140
170
200
255
7
Seed Metric
Default Metric 명령을 사용하여 Redistribute 되는 Route에 대한 Seed
Metric을 정의한다.
Default Metric은 통상 Redistribution하는 AS에서 가장 큰 Native Metric 값
을 갖는 Route의 Metric 값보다 크게 설정하여 Routing Loop을 방지한다.
Redistribute 된 후의 Route는 해당 라우팅프로토콜의 Metric 증가 방법에 따
라 증가된다.(OSPF E2 routes는 예외)
8
Redistribution Supports All Protocols
RtrA(config-router)#redistribute ?
bgp
Border Gateway Protocol (BGP)
connected Connected
egp
Exterior Gateway Protocol (EGP)
eigrp
Enhanced Interior Gateway Routing Protocol (EIGRP)
igrp
Interior Gateway Routing Protocol (IGRP)
isis
ISO IS-IS
iso-igrp
IGRP for OSI networks
mobile
Mobile routes
odr
On Demand stub Routes
ospf
Open Shortest Path First (OSPF)
rip
Routing Information Protocol (RIP)
static
Static routes
9
Redistribution and EIGRP
EIGRP
IP
AppleTalk
IPX
IP
AppleTalk
IPX
IPX RIP의 EIGRP와의 redistribution은 default로 Enable 되어 있
다.(NLSP와 EIGRP는 수동으로 Redistribution 해주어야 한다.)
IP RIP와 EIGRP는 수동으로 Redistribution 해주어야 한다
AppleTalk RTMP의 EIGRP와의 redistribution은 default로 Enable 되어 있
다. (RTMP: Routing Protocol Maintenance)
AS 번호가 같은 EIGRP와 IGRP의 Redistribution은 자동으로 이루어 진다.
AS 번호가 틀린 IGRP와 EIGRP, EIGRP와 EIGRP, IGRP와 IGRP간
Redistribution은 수동으로 설정해 주어야 한다.
10
Configuring Redistribution
•
•
•
•
Redistributing into OSPF
Redistributing inro EIGRP
Defining the Default Metric
Configuring Redistribution into Edge
Protocol
• The passive-interface Command
• Static and Default Routes
11
Configuring Redistribution
 Redistribution에 해당하는 두 라우팅 프로토콜을 모두 올릴
Boundary Router를 찾는다
 Core로 사용할 라우팅 프로토콜(Core Protocol 또는 Backbone
Protocol이라 한다.)과 Edge로 사용할 Routing Protocol을
결정한다. Core Protocol로는 보통 OSPF와 EIGRP가 많이
사용된다.)
 통상 Backbone Routing Process에서부터 Redistribution을
설정한다.
12
Configuring Redistribution into OSPF
RtrA(config-router)#router ospf 1
RtrA(config-router)#redistribute eigrp 100 ?
metric
Metric for redistributed routes
metric-type OSPF/IS-IS exterior metric type for redistributed routes
route-map Route map reference
subnets
Consider subnets for redistribution into OSPF
tag
Set tag for routes redistributed into OSPF
<cr>
Configuring Redistribution into EIGRP
RtrA(config-router)#router eigrp 100
RtrA(config-router)#redistribute ospf 1 ?
match
Redistribution of OSPF routes
metric
Metric for redistributed routes
route-map Route map reference
<cr>
13
Redistribution example
Pxr1
ASBR
S0
192.168.x.17/28
E0
S1
192.168.x.33/28
OSPF
Area 0
EIGRP AS 200
192.168.x.18/28
S0
192.168.x.49/28
192.168.x.50/28
192.168.x.34/28
E0
S1
Loopback
192.168.10x.10x/24
pxr2
E0
Shut
S0
Shut pxr3
Loopback
172.26.x.17/28
172.26.x.33/28
172.26.x.49/28
14
15
16
Configuring default-metric
Router(config-router)#
default-metric bandwidth delay reliability loading mtu
 IGRP나 EIGRP로 Redistributing시에 사용된다.
Router eigrp 200
redistribute ospf 200 metric 64 2000 255 1 1500
Router(config-router)# default-metric number
 OSPF, RIP, EGP, BGP로 Redistributing시에 사용된다.
default-metric 명령대신에 redistribute의 명령의 metric 파라미터를 사용할
수도 있다.
17
Configuring Redistribution
Edge
Protocol
Redistribute
Core
Protocol
Default or Static
Redistribute
and Filter
Redistribute and
Change Administrative
Distance
Edge AS에서는 Default Route, Static Route를 사용하게 할 수 있다.
Edge AS에 Route를 Filtering을 사용하여 Core AS의 Route를
Redistribute 할 수 있다.
Edge AS에 Core AS의 Route를 Redistribute하면서 AD 값을 변경한다.
18
Using and Configuring passive-interface
Router(config-router)#passive-interface type number
특정 Interface에서의 Routing Protocol Update를 금지 한다.
EIGRP에서의 passive interface설정은 라우터가 그 Interface에 연결된
Neighbor와 Adjacency를 맺을 수 없게 한다. (EIGRP의 경우,Passive
Interface를 설정하면 Hello Packet도 보내지 않는다.)
OSPF에서의 passive interface설정은 라우터가 그 Interface에 연결된
Neighbor와 Adjacency를 맺는 것을 막지 않는다. ( OSPF의 경우, Passive
Interface를 설정하면 LSU 및 DBD Packet은 금지하되 Hello Packet은 주고
받는다.)
19
Default Route, Default Network, Default Gateway
 Static Route를 Interface에 준 경우(serial 0등)는 Distance가 0이 되고 Next Hop
Router의 IP Address를 준 경우는 Distance가 1이 된다. Broadcast Network(Ethernet
등 LAN 구간)에서는 Interface에 주면 안된다.
 Default Route가 여럿인 경우에는 Load Balancing한다.
 ip default-network 명령은 인접라우터에 그 라우터를 Default Route로 잡도록
설정하는 것이다. 그 라우터에는 적용되지 않는다. EIGRP의 경우는 Default Route를
설정한 후 Router Mode에서 network 0.0.0.0 명령을 사용하여 전파시킬 수
있다.(EIGRP의 경우, ip default-network 명령은 적용되지 않는다.)
 ip route 0.0.0.0 0.0.0.0 next-hop-router(outbound-interface) 명령으로 생기는
Route는 RIP의 경우 “gateway of last resort”으로 다른 RIP Router에 전파된다.
 OSPF가 Default Route를 OSPF Routing Domain에 전파시키도록 하기위해서는
Default Route를 설정한 후, default-information originate (always) 명령을 사용한다.
Always 키워드는 Default Route의 Interface가 다운되는 경우에도 Defualt Route를
전파시키라는 의미이다.
 default-gateway는 평상시에 작동되지 않으며,
#no ip routing 명령을 주면 라우터가 일반 호스트처럼 되어 Default Gateway로서
작동한다.
20
Static Route Example
10.1.0.0
router rip
passive-interface Serial1
network 10.0.0.0
!
ip route 172.16.0.0 255.255.0.0 Serial1
p1r2
p2r2
172.16.0.0
p1r2#sh ip route
<Output Omitted>
Gateway of last resort is not set
10.0.0.0 255.255.255.0 is subnetted, 2 subnets
C
10.1.3.0 is directly connected, Serial1
C
10.1.1.0 is directly connected, Serial0
S
172.16.0.0 is directly connected, Serial1
<Output Omitted>
21
Redistribution Example Using ip default-network
P1R1-Internal
interface Serial0
ip address 10.1.2.1 255.255.255.0
bandwidth 64
!
interface Serial1
ip address 10.1.1.1 255.255.255.0
clockrate 56000
!
<Output Omitted>
!
router rip
network 10.0.0.0
!
ip classless
<Output Omitted>
P1R3-Boundary Router
<Output Omitted>
!
router ospf 200
redistribute rip metric 30 subnets
network 172.6.31.5 0.0.0.0 area 0
!
router rip
network 10.0.0.0
!
ip classless
ip default-network 10.0.0.0
!
<Output Omitted>
RIP/IGRP Router에서 직접 연결된 네트워크의 Unknown Subnet으로 가는 Packet을
Default Route로 보내려면 반드시 사용되어야 하다.
Subnet이 Redistribution 되기 위해서 subnet 키워드가 필요하다.
22
Modifying Administrative Distance
Router(config-router)#distance weight
[address mask [access-list-number | name ]] [ ip ]
EIGRP와 BGP를 제외한 모든 라우팅 프로토콜에서 사용된다.
Router(config-router)#distance eigrp internal-distance
external-distance
EIGRP에서 사용된다.(Default는 90,170이다.)
23
Verifying Redistribution Operation
Router# show ip route
Router# traceroute
24
Controlling Routing Update Traffic
• Using Route Filters
• Modifying Administrative Distance
• Redistribution Example Using the distance
Command
25
Route Filtering
1.distribute-list (재분배와 무관하다.)
router eigrp 200
distribute-list 1 out serial 0
access-list 1 permit 10.1.0.0 0.0.255.255
2.route-map
router eigrp 200
redistribute ospf 100 route-map test
route-map test
match ip address 1
access-list 1 permit 10.1.0.0 0.0.255.255
26
Using Route Filters
Routing
update
Determine
interface
Is there a
filter for this
interface?
No
Process packet
normally
Yes
Process entry
Is there an Yes
according to filter
entry for this
configuration
address?
No
End
Drop packet
End
27
Distribute-List Example
S0
172.16.0.0
10.0.0.0
192.168.5.0
B
A
router eigrp 1
network 172.16.0.0
network 192.168.5.0
distribute-list 7 out s0
!
access-list 7 permit 172.16.0.0
0.0.255.255
28
Distribute-List
(outbound), Received (inbound) Routing Update Access list는
Transmitted 에 적용될 수 있다.
For Outbound Updates:
Router(config-router)#distribute-list {access-list-number | name }
out [interface-name | routing-process | autonomous-system number]
For Inbound Updates:
Router(config-router)#distribute-list {access-list-number | name } in
[type number]
29
Policy-Based Routing Using Route Maps
• Policy-Based Routing
• Configuring Policy-Based Routing
• Policy-Based Routing Example
30
Route Maps
 Route Map은 복합적인 Access List라 할 수 있으며, Packet 및
Route를 Test하여 일정한 Action을 줄 수 있다.
 조건(Match)에 대한 Action(set) 형식의 구문으로 되어 있다.
Route Map Statement는 Number가 부여되며 Statement 단위로
편집될 수 있다.(Route Map에서는 statement를 추가하거나 delete
시킬 수 있다.)
Access-list Number는  Route-map의 Name에 해당한다.
Access list의 Line들은  Route Map에서의 Statement에
해당한다.
Access List에서의 Addresses와 Mask는  Route Map에서의
Match Statements에 해당한다.
Access-List와의 가장 큰 차이점은 Route Map은 set 명령을
사용하여 조건(Match)에 대한 Action을 줄 수 있다는 것이다.
31
Route Map Configuration
Policy Routing에 대한 Condition을 정의한다.
Router(config)#
route-map map-tag [permit | deny] [sequence-number]
•Permit/Deny의 Default는 Permit이고 Sequence Number의 Default
값은 10이며, Statement 추가시 자동으로 증가하지 않는다.
Match Condition을 정의한다.
Router(config-route-map)# match {conditions}
Match의 경우 취해질 Action을 정의한다.
Router(config-route-map)# set {actions}
32
Route Map : Match and Set
route-map
match x
match a
set b
set c
route-map
match q
set r
route-map
demo permit 10
y z
demo permit 20
demo permit 30
If {x or y or z) and a match} then {set b and c}
Else
If q match then set r
Else
Set Nothing
첫번째 Statement에 일치하면 나머지 Statement는 체크되지 않는다.
Access-List와 마찬가지로 Route Map의 마지막에는 Implicit Deny All이 적용
되므로 이를 방지하기 위해서는 match 및 set이 없는 Statement가 필요하다.
33
Routemap을 사용한 Routing Example
Routers A 와 B는 상호간에 RIP를,Routers A 와 C는 상호간에 BGP를 운영한다. Router A
가 BGP로 알게 된 경로 중에 172.10.0.0의 경로에는 Metric을2로, 그외의 경로에 대해서는
Metric 값을 5로 하여 Redistribute하게 한다.
!Router A
router rip
network 3.0.0.0
network 2.0.0.0
network 150.10.0.0
passive-interface serial 0
redistribute bgp 100 route-map SETMETRIC
!
router bgp 100
neighbor 2.2.2.3 remote-as 300
network 150.10.0.0
!
route-map SETMETRIC permit 10
match ip-address 1
set metric 2
!
route-map SETMETRIC permit 20
set metric 5
!
access-list 1 permit 170.10.0.0 0.0.255.255
34
Policy-Based Routing
 Packet이 다양한 Path를 통해 선택적으로 Forward 되도록 정책을
설정할 수 있다.
 Traffic 별로 상이한 TOS를 부여할 수 있다.
 Since Cisco IOS Release 11.0 이상에서 가능하다.
(config)# interface serial 0
(config-if)# ip policy route-map texas
(config)# route-map texas
(config)# match length 68 128
(config)# set ip precedence 5
Policy-Based Routing Benefits
 Source Base로 경유 Provider를 선택하게 할 수 있다. :
사용자별로 다양한 경로를 부여할 수 있다.
 Quality of service (QoS) : IP Packet Header의 Prededence와
TOS를 설정할 수 있다. queuing과 함께 사용될 수 있다.
 Cost Savings : 필요한 경우에만 고대역의 High-Cost Link를
사용하게 할 수 있다.
 Load Sharing : Traffic의 특성에 따라 Multiple Path를 사용하게 할
수 있다.
35
Policies
 Incoming Packet에 대해서 적용된다. Policy가 적용된
Interface에 들어오는 Packet에 적용된다.
 Route Map을 사용하여 Implementation 된다.Matching되는
Route는 set 명령으로 정의된 정책이 수행된다.
Policy는 Source System의 Identity(IP Address), 사용
Application, 사용 Protocol, Packet Size에 근거하여 정의된다.
 Match Criteria에 부합되고 Route Map이 Permit으로 설정되면
정의된 set Action에 따라 Routing 된다.
 Match Criteria에 부합되고 Route Map이 Deny로 설정되면
Normal Routing (Destination Based Routing) 한다.
 List 상의 모든 Sequence가 Check 되었으나 match되는 사항이
없으면 Normal Routing(Destination Based Routing) 한다.
36
Policy Routing match Commands
Matches IP addresses for policy routing
Router(config-route-map)#
match ip address {access-list-number | name} [...access-list-number | name]
Standard Access-List 및 Extended Access-List를 사용하여 Match IP
Address 를 설정한다.
Matches Layer 3 length of packet for policy routing
Router(config-route-map)# match length min max
 Packet의 Layer 3 Length가 Min값에서 max 값까지에 해당하는 Packet을
정의한다. Application 별로 사용하는 Packet 사이즈가 일정하므로 의미있
는 조건설정을 할 수 있다.
37
Policy Routing set Commands
Output Packet에 대한 next hop을 정의한다
Router(config-route-map)#
set ip next-hop ip-address [...ip-address]
Output Packet에 대한 Interface 정의한다
Router(config-route-map)#
set interface type number [...type number]
38
Policy Routing set Commands
 Routing Table에 Destination에 대한 명시적인 Route를 갖지
않는 Output Packet에 대한 Default Next Hop을 정의한다.
Router(config-route-map)#
set ip default next-hop ip-address [...ip-address]
 Destination에 대한 명시적인 Route를 갖지 않는 Output
Packet에 대한 Default Output Interface를 정의한다.
Router(config-route-map)#
set default interface type number [...type number]
39
Router(config-route-map)#
set ip tos [number | name]
Max-Reliability : 2
Max-Throughput : 4
Min-Delay : 8
Min-monetary-cost : 1
Normal :0
Router(config-route-map)#
set ip precedence [number | name]
Critical : 5, flash:3, flash-override:4, immediate:2,
Internet:6,nework:7,Priority : 1, routine:0
 IP Header의 TOS Field는 COS(5bit)와 Precedence(3bit)의 8bit로 구
성된다. set ip tos는 COS를, set ip precedence는 Precedence 값을 설
정한다.
40
Configuring Policy-Based Routing
Policy Routing을 사용할 Interface에 Route Map을 정의한다.
Router(config-if)#
ip policy route-map map-tag
Interface에 Fast Switching Policy를 Enable 시킨다.
Router(config-if)#
ip route-cache policy
Cisco IOS 11.2F 이상 버전에서 Interface의 Switching Mode를 FastSwitching으로 하는 정책을 설정할 수 있다.
Interface의 Switching Mode가 대부분 Fast Switching이므로 특별히 설
정하지는 않는다.
41
Load Balancing
• Packet-by-Packet 기반의 round robin
– Process Switching
– 해당 Interface에 “no ip route-cache”
• Session-by-Seesion 기반의 round robin
– IP Fast Switching
– 해당 Interface에 “ip route-cache” enable
• Monitoring
–
–
–
–
Debug ip packet
Ping
Show ip cache
Show ip Interface Serial 0
42
Policy-Based Routing Example
192.168.1.0
C
192.168.2.0
S1:172.17.1.2
B
S0:172.16.1.1
S0:10.1.1.100
S1:172.17.1.1
S3:10.1.1.1
S2:172.16.1.2
A
RouterA(config)# interface Serial2
RouterA(config-if)# ip address 172.16.1.2 255.255.255.0
RouterA(config-if)# ip policy route-map test
RouterA(config)#route-map test permit 10
RouterA(config-route-map)#match ip address 1
RouterA(config-route-map)#set ip next-hop 172.17.1.2
RouterA(config-route-map)#exit
RouterA(config)#access-list 1 permit 192.168.2.1 0.0.0.0
Router A는 192.168.2.1로부터의 Packet을 Router C’s interface
S1(172.17.1.2)으로 보내는 Policy를 갖는다.
43
Verifying Policy-Based Routing
Interface에 설정된 route map을 Display 한다.
Router#
show ip policy
설정된 route map을 Display 한다.
Router#
show route-map [map-name]
44
45
Verifying Policy-Based Routing
RouterA#show ip policy
Interface
Route map
Serial2
test
RouterA#show route-map
route-map test, permit, sequence 10
Match clauses:
ip address (access-lists): 1
Set clauses:
ip next-hop 172.17.1.2
Policy routing matches: 3 packets, 168 bytes
46
Verifying Policy-Based Routing
IP policy routing event를 Debugging 한다.
Router#debug ip policy
Extended traceroute
Router# traceroute
Extended Ping
Router# ping
47
48
49
Verifying Policy-Based Routing
RouterA#debug ip policy
Policy routing debugging is on
RouterA#show logging
...
11:50:51: IP: s=172.16.1.1 (Serial2), d=192.168.1.1 (Serial3), len 100,
policy rejected -- normal forwarding
...
11:51:25: IP: s=192.168.2.1 (Serial2), d=192.168.1.1, len 100, policy
match
11:51:25: IP: route map test, item 10, permit
11:51:25: IP: s=192.168.2.1 (Serial2), d=192.168.1.1 (Serial1), len 100,
policyrouted
11:51:25: IP: Serial2 to Serial1 172.17.1.2
50