实验
R1的配置
The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info
[Huawei]undo info-center en
Info: Information center is disabled.
[Huawei]sys r1
[r1]inter g0/0/0
[r1-GigabitEthernet0/0/0]ip address 15.0.0.1 30
[r1-GigabitEthernet0/0/0]inter g0/0/1
[r1-GigabitEthernet0/0/1]ip address 12.0.0.1 30
[r1-GigabitEthernet0/0/1]inter loopback 0
[r1-LoopBack0]ip address 1.1.1.1 32
[r1-LoopBack0]
[r1]ospf 1
[r1-ospf-1]
[r1-ospf-1]ospf 1 router-id 1.1.1.1
Info: The configuration succeeded. You need to restart the OSPF process to valid
ate the new router ID.
[r1-ospf-1]area 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 15.0.0.0 0.0.0.255
[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]
[r1]bgp 100
[r1-bgp]router-id 1.1.1.1
[r1-bgp]peer 15.0.0.2 as-number 100
[r1-bgp]peer 12.0.0.2 as-number 100
[r1-bgp]
R2的配置
The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info
[Huawei]undo info-center en
Info: Information center is disabled.
[Huawei]sys r2
[r2]inter g0/0/0
[r2-GigabitEthernet0/0/0]ip address 12.0.0.2 30
[r2-GigabitEthernet0/0/0]inter g0/0/1
[r2-GigabitEthernet0/0/1]ip address 23.0.0.1 30
[r2-GigabitEthernet0/0/1]inter loopback 0
[r2-LoopBack0]ip address 2.2.2.2 32
[r2-LoopBack0]rip 1
[r2-rip-1]version 2
[r2-rip-1]network 23.0.0.0
[r2-rip-1]network 12.0.0.0
[r2-rip-1]ospf 1
[r2-ospf-1]ospf 1 router-id 2.2.2.2
Info: The configuration succeeded. You need to restart the OSPF process to valid
ate the new router ID.
[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-ospf-1-area-0.0.0.0]
[r2]bgp 100
[r2-bgp]router-id 2.2.2.2
[r2-bgp]peer 12.0.0.1 as-number 100
[r2-bgp]peer 15.0.0.2 as-number 100
[r2-bgp]peer 23.0.0.2 as-number 200
[r2-bgp]import-route rip 1
[r2-bgp]import-route ospf 1
[r2-bgp]
R3的配置
The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info
[Huawei]undo info-center en
Info: Information center is disabled.
[Huawei]sys r3
[r3]inter g0/0/0
[r3-GigabitEthernet0/0/0]ip address 23.0.0.2 30
[r3-GigabitEthernet0/0/0]inter loopback 0
[r3-LoopBack0]ip address 3.3.3.3 32
[r3-LoopBack0]rip 1
[r3-rip-1]version 2
[r3-rip-1]network 23.0.0.0
[r3-rip-1]
[r3]bgp 200
[r3-bgp]router-id 3.3.3.3
[r3-bgp]peer 23.0.0.1 as-number 100
[r3-bgp]network 3.3.3.3 32
[r3-bgp]q
R4的配置
The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info
[Huawei]undo info-center en
Info: Information center is disabled.
[Huawei]sys r4
[r4]inter g0/0/0
[r4-GigabitEthernet0/0/0]ip address 15.0.0.2 30
[r4-GigabitEthernet0/0/0]inter loopback 0
[r4-LoopBack0]ip address 4.4.4.4 32
[r4-LoopBack0]inter loopback 1
[r4-LoopBack1]ip address 202.0.0.1 24
[r4-LoopBack1]inter loopback 2
[r4-LoopBack2]ip address 202.0.1.1 24
[r4-LoopBack2]
[r4]ospf 1
[r4-ospf-1]ospf 1 router-id 4.4.4.4
Info: The configuration succeeded. You need to restart the OSPF process to valid
ate the new router ID.
[r4-ospf-1]area 0
[r4-ospf-1-area-0.0.0.0]network 15.0.0.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[r4-ospf-1-area-0.0.0.0]network 202.0.0.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]network 202.0.1.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]q
[r4-ospf-1]q
[r4]bgp 100
[r4-bgp]router-id 4.4.4.4
[r4-bgp]peer 15.0.0.1 as-number 100
[r4-bgp]peer 12.0.0.2 as-number 100
[r4-bgp]import-route ospf 1
[r4-bgp]
最后ping一下