2010年5月26日 星期三

Lab 5-1 Redistribution Between RIP and OSPF

Topology

image

GNS檔案

R1
!
!Step 0: Basic Setting 
conf terminal
hostname R1
no ip domain-lookup
end
!
!Step 1: Assign Addresses
conf terminal
int s 0/0
ip address 172.16.12.1 255.255.255.0
no shutdown
int loopback 0
ip address    172.16.1.1 255.255.255.0
no shutdown
int loopback 48
ip address 192.168.48.1 255.255.255.0
no shutdown
int loopback 49
ip address 192.168.49.1 255.255.255.0
no shutdown
int loopback 50
ip address 192.168.50.1 255.255.255.0
no shutdown
int loopback 51
ip address 192.168.51.1 255.255.255.0
no shutdown
int loopback 70
ip address 192.168.70.1 255.255.255.0
no shutdown
end
!
!Step 2: Configure RIPv2
conf terminal
router rip
version 2
no auto-summary
network 172.16.0.0
network 192.168.48.0
network 192.168.49.0
network 192.168.50.0
network 192.168.51.0
network 192.168.70.0
end
!
!針對末端介接非Router的介面關閉路由資訊交換
conf terminal
router rip
passive-interface loopback 0
passive-interface loopback 48
passive-interface loopback 49
passive-interface loopback 50
passive-interface loopback 51
passive-interface loopback 70
end
!
!Step 4: Summarize a Supernet with RIP
!方法一[無效],當輸入指令ip summary-address rip 192.168.48.0 255.255.252.0
!會出現錯誤訊息Summary mask must be greater or equal to major net
!方法二,設定RIP手動摘要(RIP無法使用summary-address的方式,需要透過redistribute static的方式才行)
conf terminal
ip route 192.168.48.0 255.255.252.0 null0
router rip
redistribute static
end
!
!Step 5: Suppress Routes Using Prefix Lists
!設定distribute lists來過濾送出的路由資訊
conf terminal
ip prefix-list RIP-OUT permit 192.168.48.0/22
ip prefix-list RIP-OUT deny 192.168.48.0/22 le 24
ip prefix-list RIP-OUT permit 0.0.0.0/0 le 32
router rip
distribute-list prefix RIP-OUT out serial 0/0
end

R2
!
!Step 0: Basic Setting 
conf terminal
hostname R2
no ip domain-lookup
end
!
!Step 1: Assign Addresses
conf terminal
int s 0/0
ip address 172.16.12.2 255.255.255.0
no shutdown
int s 0/1
ip address 172.16.23.2 255.255.255.0
no shutdown
int loopback 0
ip address 172.16.2.1 255.255.255.0
no shutdown
end
!
!Step 2: Configure RIPv2
conf terminal
router rip
version 2
no auto-summary
network 172.16.0.0
!
!Step 3: Configure Passive Interfaces in RIP
conf t
router rip
passive-interface loopback 0
end
!
!Step 6: Configure OSPF
conf t
router ospf 1
network 172.16.23.0 0.0.0.255 area 0
end
!
!Step 8: Allow One-way Redistribution
conf terminal
router rip
redistribute ospf 1 metric 4
end
!
!Step 9: Redistribute Between Two Routing Protocol
!設定Redistributing OSPF(雙向,採用External Type2)
router ospf 1
redistribute rip subnet

!
!強制送出OSPF Default Route給鄰居(若設備本身無預設路由時,需要使用always指令方能送出預設路由給鄰居)
conf terminal
router ospf 1
default-information originate always
end
!
!Step 10: Set a Default Seed Metric
conf t
router ospf 1
default-metric 10000
end
!
!Step 11: Change the OSPF External Network Type!設定Redistributing OSPF(雙向,採用External Type1)
router ospf 1
redistribute rip subnet metric-type 1

end

R3
!
!Step 0: Basic Setting 
conf terminal
hostname R3
no ip domain-lookup
end
!
!Step 1: Assign Addresses
conf terminal
int s 0/1
ip address 172.16.23.3 255.255.255.0
no shutdown
int loopback 0
ip address    172.16.3.1 255.255.255.0
no shutdown
int loopback 25
ip address 192.168.25.1 255.255.255.0
no shutdown
int loopback 30
ip address 192.168.30.1 255.255.255.0
no shutdown
int loopback 35
ip address 192.168.35.1 255.255.255.0
no shutdown
int loopback 40
ip address 192.168.40.1 255.255.255.0
no shutdown
end
!
!Step 6: Configure OSPF
conf terminal
router ospf 1
network 172.16.23.0 0.0.0.255 area 0
network 172.16.1.0 0.0.0.255 area 0
network 192.168.25.0 0.0.0.255 area 0
network 192.168.30.0 0.0.0.255 area 0
network 192.168.35.0 0.0.0.255 area 0
network 192.168.40.0 0.0.0.255 area 0
!
!Step 7: Configure Passive Interfaces in OSPF
!針對末端介接非Router的介面關閉路由資訊交換(採用反向遮罩的方式)
passive-interface default
no passive-interface s 0/0
end

show指令
show ip route
show ip protocols
show ip route rip
show ip rip database
show ip route ospf
show ip ospf neighbor
show ip ospf database
show ip prefix-list

參考文件
Redistributing Routing Protocols

How Does the Passive Interface Feature Work in EIGRP

Filtering Routing Updates on Distance Vector IP Routing Protocols

How OSPF Injects a Default Route into a Normal Area

沒有留言:

張貼留言