BGP实验

实验

在这里插入图片描述
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一下
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值