实验
实验要求
- 所有路由器都开启BGP协议,R1、R2、R4为IBGP AS100,R3和R2为EBGP,R3属于AS200
- R1、R2、R5配置ospf协议,属于area 0,R2和R3配置RIP
- R4有两个业务网段:202.0.0.1/24和202.0.1.1/24
- R3可以访问R4业务网段
配置步骤
1.配置路由器R1
<Huawei>sys
[Huawei]sys R1
[R1]undo info-center enable
Info: Information center is disabled.
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 14.0.0.1 30
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 12.0.0.1 30
[R1-GigabitEthernet0/0/1]int loopback 0
[R1-LoopBack0]ip add 1.1.1.1 32
[R1-LoopBack0]
[R1]ospf 1
[R1-ospf-1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 12.0.0.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 14.0.0.0 0.0.0.255
[R1]bgp 100
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 2.2.2.2 as-number 100
[R1-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[R1-bgp]peer 4.4.4.4 as-number 100
[R1-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[R1-bgp]
2.配置路由器R2
<Huawei>sys
[Huawei]sys R2
[R2]undo info-center enable
Info: Information center is disabled.
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 12.0.0.2 30
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 23.0.0.1 30
[R2-GigabitEthernet0/0/1]int loopback 0
[R2-LoopBack0]ip add 2.2.2.2 32
[R2-LoopBack0]
[R2]ospf 1
[R2-ospf-1]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 12.0.0.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2]rip 1
[R2-rip-1]version 2
[R2-rip-