BGP小实验(一)——小实验练练手走起来

30 篇文章 6 订阅
23 篇文章 1 订阅


前言

在这里插入图片描述

小实验练练手走起来

一、需求

需求老样子,全网互通

二、命令

1、基础配置走起来(端口+回环口IP,RIP及OSPF)

R1

[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 16.0.0.1 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 12.0.0.1 24
[Huawei-GigabitEthernet0/0/1]int loop 0
[Huawei-LoopBack0]ip add 1.1.1.1 32
[Huawei-LoopBack0]q
[Huawei]rip
[Huawei-rip-1]v 2
[Huawei-rip-1]und sum
[Huawei-rip-1]net 1.0.0.0
[Huawei-rip-1]net 16.0.0.0
[Huawei-rip-1]q
[Huawei]ip route-s 2.2.2.2 32 12.0.0.2

R2

[Huawei]int g 0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 12.0.0.2 24
[Huawei-GigabitEthernet0/0/1]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 23.0.0.2 24
[Huawei-GigabitEthernet0/0/0]int loop 0
[Huawei-LoopBack0]ip add 2.2.2.2 32
[Huawei-LoopBack0]q
[Huawei]ospf
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]net 2.2.2.2 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0]net 23.0.0.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]q
[Huawei]ip route-s 1.1.1.1 32 12.0.0.1

R3

[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 23.0.0.3 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 34.0.0.3 24
[Huawei-GigabitEthernet0/0/1]int loop0
[Huawei-LoopBack0]ip add 3.3.3.3 32
[Huawei-LoopBack0]q
[Huawei]ospf
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]net 3.3.3.3 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0]net 23.0.0.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]net 34.0.0.0 0.0.0.255

R4

[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 34.0.0.4 24
[Huawei-GigabitEthernet0/0/1]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 45.0.0.4 24
[Huawei-GigabitEthernet0/0/0]int loop0
[Huawei-LoopBack0]ip add 4.4.4.4 32
[Huawei-LoopBack0]q
[Huawei]ospf
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]net 34.0.0.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]net 4.4.4.4 0.0.0.0

R5

[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 45.0.0.5 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 57.0.0.5 24
[Huawei-GigabitEthernet0/0/1]int loop0
[Huawei-LoopBack0]ip add 5.5.5.5 32
[Huawei-LoopBack0]q
[Huawei]rip
[Huawei-rip-1]v 2
[Huawei-rip-1]undo sum
[Huawei-rip-1]net 5.0.0.0
[Huawei-rip-1]net 57.0.0.0
[Huawei-rip-1]q
[Huawei]ip route-s 4.4.4.4 32 45.0.0.4

R6

[Huawei]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 16.0.0.6 24
[Huawei-GigabitEthernet0/0/0]int loop 0
[Huawei-LoopBack0]ip add 6.6.6.6 32
[Huawei-LoopBack0]q
[Huawei]rip
[Huawei-rip-1]v 2
[Huawei-rip-1]undo sum
[Huawei-rip-1]net 6.0.0.0
[Huawei-rip-1]net 16.0.0.0

R7

[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 57.0.0.7 24
[Huawei-GigabitEthernet0/0/1]int loop0
[Huawei-LoopBack0]ip add 7.7.7.7 32
[Huawei-LoopBack0]q
[Huawei]rip
[Huawei-rip-1]v 2
[Huawei-rip-1]undo sum
[Huawei-rip-1]net 7.0.0.0
[Huawei-rip-1]net 57.0.0.0

2、BGP走起来

R1

[Huawei]bgp 100
[Huawei-bgp]router-id 1.1.1.1
[Huawei-bgp]peer 2.2.2.2 as-number 200
[Huawei-bgp]peer 2.2.2.2 connect-interface LoopBack0
[Huawei-bgp]peer 2.2.2.2 ebgp-max-hop 2
[Huawei-bgp]peer 6.6.6.6 as-number 100 
[Huawei-bgp]peer 6.6.6.6 connect-interface LoopBack0
[Huawei-bgp]peer 6.6.6.6 next-hop-local 
[Huawei-bgp]net 1.1.1.1 255.255.255.255
[Huawei-bgp]net 2.2.2.2 255.255.255.255
[Huawei-bgp]net 6.6.6.6 255.255.255.255

R2

[Huawei]bgp 200
[Huawei-bgp]router-id 2.2.2.2
[Huawei-bgp]peer 1.1.1.1 as-number 100
[Huawei-bgp]peer 1.1.1.1 connect-interface LoopBack0
[Huawei-bgp]peer 1.1.1.1 ebgp-max-hop 2
[Huawei-bgp]peer 3.3.3.3 as-number 200
[Huawei-bgp]peer 3.3.3.3 connect-interface LoopBack0
[Huawei-bgp]peer 4.4.4.4 as-number 200
[Huawei-bgp]peer 4.4.4.4 connect-interface LoopBack0
[Huawei-bgp]peer 3.3.3.3 next-hop-local 
[Huawei-bgp]peer 4.4.4.4 next-hop-local
[Huawei-bgp]net 2.2.2.2 255.255.255.255
[Huawei-bgp]net 3.3.3.3 255.255.255.255
[Huawei-bgp]net 4.4.4.4 255.255.255.255
[Huawei-bgp]net 1.1.1.1 255.255.255.255

R3

[Huawei]bgp 200
[Huawei-bgp]router-id 3.3.3.3
[Huawei-bgp]peer 2.2.2.2 as-n 200
[Huawei-bgp]peer 2.2.2.2 connect-interface loop 0
[Huawei-bgp]peer 4.4.4.4 as-n 200
[Huawei-bgp]peer 4.4.4.4 connect-interface loop 0
[Huawei-bgp]peer 2.2.2.2 next-hop-local 
[Huawei-bgp]peer 4.4.4.4 next-hop-local
[Huawei-bgp]net 2.2.2.2 255.255.255.255
[Huawei-bgp]net 3.3.3.3 255.255.255.255
[Huawei-bgp]net 4.4.4.4 255.255.255.255

R4

[Huawei]bgp 200
[Huawei-bgp]router-id 4.4.4.4
[Huawei-bgp]peer 2.2.2.2 as-number 200 
[Huawei-bgp]peer 2.2.2.2 connect-interface LoopBack0
[Huawei-bgp]peer 3.3.3.3 as-number 200
[Huawei-bgp]peer 3.3.3.3 connect-interface LoopBack0
[Huawei-bgp]peer 5.5.5.5 as-number 300 
[Huawei-bgp]peer 5.5.5.5 connect-interface LoopBack0
[Huawei-bgp]peer 5.5.5.5 ebgp-max-hop 2
[Huawei-bgp]peer 2.2.2.2 next-hop-local 
[Huawei-bgp]peer 3.3.3.3 next-hop-local
[Huawei-bgp]net 2.2.2.2 255.255.255.255
[Huawei-bgp]net 3.3.3.3 255.255.255.255
[Huawei-bgp]net 5.5.5.5 255.255.255.255
[Huawei-bgp]net 4.4.4.4 255.255.255.255

R5

[Huawei]bgp 300
[Huawei-bgp]router-id 5.5.5.5
[Huawei-bgp]peer 4.4.4.4 as-number 200 
[Huawei-bgp]peer 4.4.4.4 connect-interface LoopBack0
[Huawei-bgp]peer 4.4.4.4 ebgp-max-hop 2
[Huawei-bgp]peer 7.7.7.7 as-number 300
[Huawei-bgp]peer 7.7.7.7 connect-interface LoopBack0
[Huawei-bgp]peer 7.7.7.7 next-hop-local
[Huawei-bgp]net 4.4.4.4 255.255.255.255
[Huawei-bgp]net 5.5.5.5 255.255.255.255
[Huawei-bgp]net 7.7.7.7 255.255.255.255

R6

[Huawei]bgp 100
[Huawei-bgp]router-id 6.6.6.6
[Huawei-bgp]peer 1.1.1.1 as-number 100
[Huawei-bgp]peer 1.1.1.1 next-hop-local
[Huawei-bgp]peer 1.1.1.1 connect-interface LoopBack0
[Huawei-bgp]net 6.6.6.6 255.255.255.255
[Huawei-bgp]net 1.1.1.1 255.255.255.255

R7

[Huawei]bgp 300
[Huawei-bgp]router-id 7.7.7.7
[Huawei-bgp]peer 5.5.5.5 as-number 300
[Huawei-bgp]peer 5.5.5.5 connect-interface LoopBack0
[Huawei-bgp]peer 5.5.5.5 next-hop-local
[Huawei-bgp]net 5.5.5.5 255.255.255.255
[Huawei-bgp]net 7.7.7.7 255.255.255.255

总结

小小实验,做一做玩,防止忘记咯

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小白的成功进阶之路

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值