7.0BGP组网实验

BGP****组网实验

实验拓扑:
在这里插入图片描述

Bgp部分知识

通过TCP的三次握手来寻找到邻居;

属于无类别的路径矢量协议,EGP协议中最流行的技术,工作在AS之间;

EGP—外部网关路由协议-BGP

IGP内部网关路由协议-RIP OSPF EIGRP(思科专属)

BGP协议本身不产生路由,而是转发本地路由表中来自其他协议生成的路由条目;

AS之间正常存在大量的BGP邻居关系,且BGP协议不会计算最佳路径;因此在BGP协议中管理员需要进行策略来干涉选路;

配置步骤:

1.给各个接口配置ip

R1:

<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]un in e
Info: Information center is disabled.
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 11.0.0.1 24
[Huawei-GigabitEthernet0/0/1]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.6.1 24
[Huawei-GigabitEthernet0/0/0]

R2

<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]un in e
Info: Information center is disabled.
[Huawei]sy R2
[R2]int g0/0/01
[R2-GigabitEthernet0/0/1]ip add 192.168.5.2 24
[R2-GigabitEthernet0/0/1]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.6.2 24

R3:

<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]un in e
Info: Information center is disabled.
[Huawei]sy R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.5.1 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.1.1 24

R4:

<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]un in e
Info: Information center is disabled.
[Huawei]sy R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip ad 192.168.1.2 24
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip ad 10.0.0.1 24

配置dhcp

R1

[R1]ip pool 11
Info: It's successful to create an IP address pool.
[R1-ip-pool-11]net 11.0.0.2 mask 24	
[R1-ip-pool-11]gateway-list 11.0.0.1
[R1-ip-pool-11]int g0/0/1
[R1-GigabitEthernet0/0/1]dhcp select global 

在这里插入图片描述

R4

[R4]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[R4]ip poo	
[R4]ip pool 10
Info: It's successful to create an IP address pool.
[R4-ip-pool-10]net 10.0.0.0 mask 24
[R4-ip-pool-10]gateway-list 10.0.0.1
[R4-ip-pool-10]int g0/0/1
[R4-GigabitEthernet0/0/1]dhcp select global 

在这里插入图片描述

接下来配置相关命令

R1:

[R1]rip
[R1-rip-1]net 192.168.6.0
[R1-rip-1]net 11.0.0.0

R2:

[R2]rip
[R2-rip-1]net 192.168.5.0 
[R2-rip-1]net 192.168.6.0

R3

[R3]ospf
[R3-ospf-1]default-route-advertise
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]net 192.168.5.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]net 192.168.1.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]q
[R3-ospf-1]q
[R3]ip route-static 0.0.0.0 0.0.0.0 192.168.5.0

R4

[R4]ospf
[R4-ospf-1]ar	
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]net 192.168.1.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]net 10.0.0.0 0.0.0.255

R1配置bgp

[R1]bgp 100
[R1-bgp]route-select
[R1-bgp]router-id 1.0.0.2
[R1-bgp]peer 192.168.6.1 as-number 100

R2配置bgp

[R2]bgp 100
[R2-bgp]undo peer 192.168.6.0 enable
[R2-bgp]router-id 1.0.0.1
[R2-bgp]peer 192.168.5.2 as-number 200
Warning: Local interface is already configured with this address.
[R2-bgp]peer 192.168.6.2 as-number 100

R3配置

[R3]bgp 200
[R3-bgp]router-id 0.0.0.1
[R3-bgp]peer 192.168.5.1 as-number 100
Warning: Local interface is already configured with this address.
[R3-bgp]q
[R3]bgp 200
[R3-bgp]router-id 0.0.0.1
[R3-bgp]peer 192.168.1.1 as-number 200

R4配置

[R4]bgp 200
[R4-bgp]router-id 0.0.0.2
[R4-bgp]peer 192.168.1.1 as-number 200

R2引入同步

[R2-bgp]import-route rip 1
[R2-bgp]import-route direct 
[R2-bgp]q
[R2]rip	
[R2-rip-1]import-route bgp 

R3引入同步

[R3]bgp 200
[R3-bgp]import-route direct 	
[R3-bgp]import-route ospf 1
[R3-bgp]q
[R3]ospf	
[R3-ospf-1]import-route bgp 

通过PC查看发现都能ping通中间交界路由

在这里插入图片描述

查看BGP:**如果在BGP邻居建立成功后,使用display bgp peer命令所查看到的邻居状态为Established。

[R3-bgp]import-route ospf 1
[R3-bgp]q
[R3]ospf	
[R3-ospf-1]import-route bgp 

通过PC查看发现都能ping通中间交界路由

查看BGP:**如果在BGP邻居建立成功后,使用display bgp peer命令所查看到的邻居状态为Established。

命令:display bgp peer

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值