项目场景:
如图不同as间建立bgp通信,区域内ospf通信。
实搭拓扑图:
具体操作:
接口地址、环回地址配置略
①邻居建立:
R1:
[R1]router id 1.1.1.1
[R1]ospf 1
[R1-ospf-1]area 5
[R1-ospf-1-area-0.0.0.5]network 1.1.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.5]network 1.1.2.0 0.0.0.255
[R1-ospf-1-area-0.0.0.5]network 10.1.12.0 0.0.0.255
R2:
[R2]router id 2.2.2.2
[R2]ospf 1
[R2-ospf-1]silent-interface gi 0/0/1#静默接口 不发送任何ospf报文
[R2-ospf-1]silent-interface gi 0/0/2#静默接口 不发送任何ospf报文
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.1.23.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 10.1.25.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 2.2.2.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]area 5
[R2-ospf-1-area-0.0.0.5]network 10.1.12.0 0.0.0.255
R3:
[R3]router id 3.3.3.3
[R3]ospf 1
[R3-ospf-1]silent-interface gi0/0/0
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 3.3.3.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 10.1.23.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 10.1.34.0 0.0.0.255
R4:
[R4]router id 4.4.4.4
[R4]ospf 1
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 10.1.34.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]network 10.1.45.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]network 4.4.4.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]network 4.4.5.0 0.0.0.255
R5:
[R5]router id 5.5.5.5
[R5]ospf 1
[R5-ospf-1]silent-interface gi 0/0/0
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 5.5.5.0 0.0.0.255
[R5-ospf-1-area-0.0.0.0]network 10.1.25.0 0.0.0.255
[R5-ospf-1-area-0.0.0.0]network 10.1.45.0 0.0.0.255
②传递路由
R1:
[R1]bgp 100 #R1所在的as 100
[R1-bgp]peer 2.2.2.2 as-number 100 #邻居2.2.2.2 所在的as 100
[R1-bgp]peer 2.2.2.2 connect-interface LoopBack 0#指定更新源环回口地址,以上的两个步骤确定了bgp报文的源地址:1.1.1.1 以及目标地址2.2.2.2
R2:
[R2]bgp 100
[R2-bgp]peer 1.1.1.1 as-number 100
[R2-bgp]peer 1.1.1.1 connect-interface LoopBack 0
[R2-bgp]peer 10.1.23.3 as-number 200
[R2-bgp]peer 10.1.25.5 as-number 200
R3:
[R3]bgp 200
[R3-bgp]peer 5.5.5.5 as-number 200
[R3-bgp]peer 5.5.5.5 connect-interface LoopBack 0
[R3-bgp]peer 10.1.23.2 as-number 100
R5:
[R5]bgp 200
[R5-bgp]peer 3.3.3.3 as-number 200
[R5-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[R5-bgp]peer 10.1.25.2 as-number 100
③bgp路由汇总(聚合)
R2:
[R2]bgp 100
[R2-bgp]import-route ospf 1
[R2-bgp]ospf 1
[R2-ospf-1]import-route bgp
R5:
[R5-bgp]bgp 200
[R5-bgp]import-route ospf 1
[R5-bgp]ospf 1
[R5-ospf-1]import-route bgp