1.拓扑图

sshot-1.png

2.PC机配置IP地址(按拓扑图要求配置即可)

sshot-2.png
sshot-3.png

3.路由器配置接口地址(按拓扑图要求配置即可)

R1:

R1(config)int f0/0
R1(config-if)ip add 10.0.0.2 255.255.255.0
R1(config-if)no shu

R1(config)int f0/1
R1(config-if)ip add 20.0.0.2 255.255.255.0
R1(config-if)no shu

R2:

R2(config)int f0/0 
R2(config-if)ip add 10.0.0.1 255.255.255.0
R2(config-if)no shu

R2(config)int f0/1
R2(config-if)ip add 192.168.1.254 255.255.255.0
R2(config-if)no shu

R3:

R3(config)int f0/0
R3(config-if)ip add 20.0.0.1 255.255.255.0
R3(config-if)no shu

R3(config)int f0/1
R3(config-if)ip add 192.168.0.254 255.255.255.0
R3(config-if)no shu

4.配置BGP协议

配置命令:
R2例子:
router bgp 300 设置自治域号
neighbor 10.0.0.2 remote-as 100设置远程相连自治域边界路由器端口
network 192.168.1.0 mask 255.255.255.0分享本地网络
network 10.0.0.0 mask 255.255.255.0分享本地网络

R1:

Router(config)#router bgp 100
Router(config-router)#neighbor 20.0.0.1 remote-as 200
Router(config-router)#neighbor 10.0.0.1 remote-as 300
Router(config-router)#network 10.0.0.0 mask 255.255.255.0
Router(config-router)#network 20.0.0.0 mask 255.255.255.0

R2:

Router(config)#router bgp 300
Router(config-router)#neighbor 10.0.0.2 remote-as 100
Router(config-router)#network 10.0.0.0 mask 255.255.255.0
Router(config-router)#network 192.168.1.0 mask 255.255.255.0

R3:

Router(config)#router bgp 200
Router(config-router)#neighbor 20.0.0.2 remote-as 100
Router(config-router)#network 20.0.0.0 mask 255.255.255.0
Router(config-router)#network 192.168.0.0 mask 255.255.255.0

5.查看路由表

R1:
sshot-4.png
R2:
sshot-5.png
R3:
sshot-6.png

6.测试连通性

sshot-7.png