拓扑图
RIP配置
- AR1 AR2 和 AR3 配置RIPv2协议
[AR1]rip
[AR1-rip-1]version 2
[AR1-rip-1]network 100.0.0.0
[AR1-rip-1]network 12.0.0.0
[AR1-rip-1]network 13.0.0.0
虽然宣告的网段是8/32, 但是最后到达其他路由器的网段是原来的网段
[AR3]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 15 Routes : 16
Destination/Mask Proto Pre Cost Flags NextHop Interface
12.1.1.0/30 RIP 100 1 D 23.1.1.1 GigabitEthernet0/0/2
RIP 100 1 D 13.1.1.1 GigabitEthernet0/0/1
OSPF配置
[AR1]ospf
[AR1-ospf-1]area 0
[AR1-ospf-1-area-0.0.0.0]network 13.1.1.0 0.0.0.3
[AR1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.3
[AR1-ospf-1-area-0.0.0.0]network 100.1.1.0 0.0.0.255
[AR1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 14 Routes : 15
Destination/Mask Proto Pre Cost Flags NextHop Interface
23.1.1.0/30 OSPF 10 2 D 12.1.1.2 GigabitEthernet0/0/1
OSPF 10 2 D 13.1.1.2 GigabitEthernet0/0/2
BGP配置
这个表示IBGP
[AR1]bgp 200
[AR1-bgp]peer 45.1.1.1 as-number 200
这个表示EBGP
[AR1]bgp 200
[AR1-bgp]peer 45.1.1.1 as-number 300
当进行宣告后, 相连的bgp路由器就会收到这个路由器的宣告信息
[AR1-bgp]network 10.1.1.0 24
BGP路由引入OSPF
[AR3]ospf
[AR3-ospf-1]import-route bgp
[AR3-ospf-1]quit
[AR3]bgp 10
[AR3-bgp]import-route ospf 1