策略路由
阿新 • • 發佈:2018-04-02
策略路由要求
R1上面有兩個環回1.1.1.1和1.1.2.1 ,R5上面有一個環回。第一個環回訪問R5 的環回走R3,第二個環回訪問R5的環回走R4
結果
R1#traceroute 5.5.5.5 source 1.1.1.1
Type escape sequence to abort.
Tracing the route to 5.5.5.5
VRF info: (vrf in name/id, vrf out name/id)
1 12.1.1.2 1 msec 1 msec 1 msec
2 23.1.1.3 2 msec 1 msec 1 msec
3 35.1.1.5 2 msec 3 msec
R1#traceroute 5.5.5.5 source 1.1.2.1
Type escape sequence to abort.
Tracing the route to 5.5.5.5
VRF info: (vrf in name/id, vrf out name/id)
1 12.1.1.2 1 msec 2 msec 1 msec
2 24.1.1.4 2 msec 2 msec 3 msec
3 45.1.1.5 2 msec 2 msec
配置
R2#show run | s route
ip policy route-map pbr
router eigrp 90
network 0.0.0.0
route-map pbr permit 10
match ip address 100
set interface Ethernet0/1
route-map pbr permit 20
match ip address 101
set ip next-hop 24.1.1.4
R2#show run | s route-map
R2#show run | s route-map
ip policy route-map pbr
route-map pbr permit 10
match ip address 100
set interface Ethernet0/1
route-map pbr permit 20
match ip address 101
set ip next-hop 24.1.1.4
R2#show access-lists
Extended IP access list 100
10 permit ip host 1.1.1.1 host 5.5.5.5 (15 matches)
Extended IP access list 101
10 permit ip host 1.1.2.1 host 5.5.5.5 (15 matches)
R1上面有兩個環回1.1.1.1和1.1.2.1 ,R5上面有一個環回。第一個環回訪問R5 的環回走R3,第二個環回訪問R5的環回走R4
結果
R1#traceroute 5.5.5.5 source 1.1.1.1
Type escape sequence to abort.
Tracing the route to 5.5.5.5
VRF info: (vrf in name/id, vrf out name/id)
1 12.1.1.2 1 msec 1 msec 1 msec
2 23.1.1.3 2 msec 1 msec 1 msec
3 35.1.1.5 2 msec 3 msec
R1#traceroute 5.5.5.5 source 1.1.2.1
Tracing the route to 5.5.5.5
VRF info: (vrf in name/id, vrf out name/id)
1 12.1.1.2 1 msec 2 msec 1 msec
2 24.1.1.4 2 msec 2 msec 3 msec
3 45.1.1.5 2 msec 2 msec
配置
R2#show run | s route
ip policy route-map pbr
router eigrp 90
network 0.0.0.0
route-map pbr permit 10
match ip address 100
set interface Ethernet0/1
match ip address 101
set ip next-hop 24.1.1.4
R2#show run | s route-map
R2#show run | s route-map
ip policy route-map pbr
route-map pbr permit 10
match ip address 100
set interface Ethernet0/1
route-map pbr permit 20
match ip address 101
set ip next-hop 24.1.1.4
R2#show access-lists
Extended IP access list 100
Extended IP access list 101
10 permit ip host 1.1.2.1 host 5.5.5.5 (15 matches)
策略路由