CCNP路由实验(4) -- BGP
基本配置:
enable
conf t
no ip do lo
enable pass cisco
line con 0
logg sync
exec-t 0 0
line vty 0 4
pass cisco
logg sync
exit
host
BGP基本配置:
------------------------------------------------------------------------------
-------------------------------------------------------------------------------
R1:
int f0/0
ip add 12.1.1.1 255.255.255.0
no shut
exit
int l0
ip add 11.1.1.1 255.255.255.0
no shut
exit
router eigrp 1
no auto-summary
network 12.1.1.0 0.0.0.255
network 11.1.1.0 0.0.0.255
exit
R2:
int f0/0
ip add 12.1.1.2 255.255.255.0
no shut
exit
int l0
ip add 22.1.1.1 255.255.255.0
no shut
exit
router eigrp 1
no auto-summary
network 12.1.1.0 0.0.0.255
network 22.1.1.0 0.0.0.255
exit
R1:
end
ping 22.1.1.1 source 11.1.1.1
conf t
router bgp 100
no synchronization
no auto-summary
bgp router-id 11.1.1.1
neighbor 22.1.1.1 remote-as 100
neighbor 22.1.1.1 update-source l0
exit
R2:
router bgp 100
bgp router-id 22.1.1.1
neighbor 11.1.1.1 remote-as 100
neighbor 11.1.1.1 update-source l0
exit
int f1/0
ip add 23.1.1.2 255.255.255.0
no shut
exit
router bgp 100
neighbor 23.1.1.3 remote-as 200
exit
R3:
int f0/0
ip add 23.1.1.3 255.255.255.0
no shut
exit
router bgp 200
bgp router-id 33.1.1.1
neighbor 23.1.1.2 remote-as 100
exit
R2:
end
show ip bgp summary
conf t
路由信息的通告:
----------------------------------------------------
R3:
int l0
ip add 33.1.1.1 255.255.255.0
exit
router bgp 200
network 33.1.1.0 mask 255.255.255.0
exit
R1:
router bgp 100
redistribute eigrp 1
exit
R2:
end
show ip bgp
conf t
R1:
end
show ip bgp
conf t
R2:
router bgp 100
neighbor 11.1.1.1 next-hop-self
exit
R1:
end
show ip bgp
conf t
理解同步以及解决路由黑洞:
--------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
R1:
int f0/0
ip add 12.1.1.1 255.255.255.0
no shut
exit
int l0
ip add 11.1.1.1 255.255.255.0
no shut
exit
router eigrp 1
no auto-summary
network 12.1.1.0 0.0.0.255
network 11.1.1.0 0.0.0.255
exit
R2:
int f0/0
ip add 12.1.1.2 255.255.255.0
no shut
exit
int f1/0
ip add 23.1.1.2 255.255.255.0
no shut
exit
router eigrp 1
no auto-summary
network 12.1.1.0 0.0.0.255
network 23.1.1.0 0.0.0.255
exit
R3:
int f0/0
ip add 23.1.1.3 255.255.255.0
no shut
exit
int l0
ip add 33.1.1.1 255.255.255.0
no shut
exit
router eigrp 1
no auto-summary
network 23.1.1.0 0.0.0.255
network 33.1.1.0 0.0.0.255
exit
------------------------------------------
R1:
router bgp 100
bgp router-id 11.1.1.1
neighbor 33.1.1.1 remote-as 100
neighbor 33.1.1.1 update-source l0
neighbor 33.1.1.1 next-hop-self
exit
R3:
router bgp 100
bgp router-id 33.1.1.1
neighbor 11.1.1.1 remote-as 100
neighbor 11.1.1.1 update-source l0
neighbor 11.1.1.1 next-hop-self
exit
int f1/0
ip add 34.1.1.3 255.255.255.0
no shut
exit
router bgp 100
neighbor 34.1.1.4 remote-as 200
exit
R4:
int f0/0
ip add 34.1.1.4 255.255.255.0
no shut
exit
router bgp 200
bgp router-id 44.1.1.1
neighbor 34.1.1.3 remote-as 100
exit
-----------------------------------------------------
R1:
int l1
ip add 100.1.1.1 255.255.255.0
no shut
exit
router bgp 100
network 100.1.1.0 mask 255.255.255.0
exit
R3:
end
show ip bgp
show ip route bgp
conf t
R4:
end
show ip bgp
conf t
R3:
end
ping 100.1.1.1
conf t
R2:
end
shwo ip route
conf t
R3:
router bgp 100
synchronization
end
clear ip bgp *
shwo ip bgp
conf t
R4:
end
show ip bgp
conf t
-----------------------------------------
R2:
int l0
ip add 22.1.1.1 255.255.255.0
no shut
exit
router eigrp 1
network 22.1.1.0 0.0.0.255
exit
router bgp 100
bgp router-id 22.1.1.1
neighbor 11.1.1.1 remote-as 100
neighbor 11.1.1.1 update-source l0
neighbor 11.1.1.1 next-hop-self
neighbor 33.1.1.1 remote-as 100
neighbor 33.1.1.1 update-source l0
neighbor 33.1.1.1 next-hop-self
exit
R1:
router bgp 100
neighbor 22.1.1.1 remote-as 100
neighbor 22.1.1.1 update-source l0
neighbor 22.1.1.1 next-hop-self
exit
R3:
router bgp 100
neighbor 22.1.1.1 remote-as 100
neighbor 22.1.1.1 update-source l0
neighbor 22.1.1.1 next-hop-self
no synchronization
exit
-----------------------------------------------
R3:
end
clear ip bgp *
shwo ip bgp
conf t
R4:
end
show ip bgp
conf t
R3:
end
ping 100.1.1.1
conf t
R4:
int l0
ip add 44.1.1.1 255.255.255.0
exit
router bgp 200
network 44.1.1.0 mask 255.255.255.0
exit
end
ping 100.1.1.1 source 44.1.1.1
conf t
用peer-group的方法建立邻居关系
-----------------------------------------------
R1:
router bgp 100
bgp router-id 11.1.1.1
neighbor IBGP peer-group
neighbor IBGP remote-as 100
neighbor IBGP update-source l0
neighbor IBGP next-hop-self
neighbor 22.1.1.1 peer-group IBGP
neighbor 33.1.1.1 peer-group IBGP
exit
R2:
router bgp 100
bgp router-id 22.1.1.1
neighbor IBGP peer-group
neighbor IBGP remote-as 100
neighbor IBGP update-source l0
neighbor IBGP next-hop-self
neighbor 11.1.1.1 peer-group IBGP
neighbor 33.1.1.1 peer-group IBGP
exit
R3:
router bgp 100
bgp router-id 33.1.1.1
neighbor IBGP peer-group
neighbor IBGP remote-as 100
neighbor IBGP update-source l0
neighbor IBGP next-hop-self
neighbor 22.1.1.1 peer-group IBGP
neighbor 11.1.1.1 peer-group IBGP
exit
BGP的自动汇总:
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
R1:
int f0/0
ip add 12.1.1.1 255.255.255.0
no shut
exit
int l0
ip add 11.1.1.1 255.255.255.0
no shut
exit
router eigrp 1
no auto-summary
network 12.1.1.0 0.0.0.255
network 11.1.1.0 0.0.0.255
exit
R2:
int f0/0
ip add 12.1.1.2 255.255.255.0
no shut
exit
int l0
ip add 22.1.1.1 255.255.255.0
no shut
exit
int f1/0
ip add 23.1.1.2 255.255.255.0
no shut
exit
router eigrp 1
no auto-summary
network 12.1.1.0 0.0.0.255
network 22.1.1.0 0.0.0.255
exit
R1:
router bgp 100
bgp router-id 11.1.1.1
neighbor 22.1.1.1 remote-as 100
neighbor 22.1.1.1 update-source l0
neighbor 22.1.1.1 next-hop-self
exit
R2:
router bgp 100
bgp router-id 22.1.1.1
neighbor 11.1.1.1 remote-as 100
neighbor 11.1.1.1 update-source l0
neighbor 11.1.1.1 next-hop-self
neighbor 23.1.1.3 remote-as 200
exit
R3:
int f0/0
ip add 23.1.1.3 255.255.255.0
no shut
exit
router bgp 200
bgp router-id 33.1.1.1
neighbor 23.1.1.2 remote-as 100
exit
R3:
int l1
ip add 100.1.1.1 255.255.255.0
no shut
exit
int l2
ip add 100.1.2.1 255.255.255.0
no shut
exit
int l3
ip add 100.1.3.1 255.255.255.0
no shut
exit
router bgp 200
auto-summary
network 100.1.1.0 mask 255.255.255.0
network 100.1.2.0 mask 255.255.255.0
network 100.1.3.0 mask 255.255.255.0
exit
R2:
end
show ip bgp
conf t
R3:
router bgp 200
network 100.0.0.0
exit
R2:
end
show ip bgp
conf t
router bgp 100
auto-summary
redistribute eigrp 1
exit
BGP的手动汇总:
-----------------------------------------------------
R1:
int f0/0
ip add 12.1.1.1 255.255.255.0
no shut
exit
int l0
ip add 11.1.1.1 255.255.255.0
no shut
exit
router eigrp 1
no auto-summary
network 12.1.1.0 0.0.0.255
network 11.1.1.0 0.0.0.255
exit
R2:
int f0/0
ip add 12.1.1.2 255.255.255.0
no shut
exit
int l0
ip add 22.1.1.1 255.255.255.0
no shut
exit
int f1/0
ip add 23.1.1.2 255.255.255.0
no shut
exit
router eigrp 1
no auto-summary
network 12.1.1.0 0.0.0.255
network 22.1.1.0 0.0.0.255
exit
R1:
router bgp 100
bgp router-id 11.1.1.1
neighbor 22.1.1.1 remote-as 100
neighbor 22.1.1.1 update-source l0
neighbor 22.1.1.1 next-hop-self
exit
R2:
router bgp 100
bgp router-id 22.1.1.1
neighbor 11.1.1.1 remote-as 100
neighbor 11.1.1.1 update-source l0
neighbor 11.1.1.1 next-hop-self
neighbor 23.1.1.3 remote-as 200
exit
R3:
int f0/0
ip add 23.1.1.3 255.255.255.0
no shut
exit
router bgp 200
bgp router-id 33.1.1.1
neighbor 23.1.1.2 remote-as 100
exit
R3:
int l1
ip add 100.1.1.1 255.255.255.0
no shut
exit
int l2
ip add 100.1.2.1 255.255.255.0
no shut
exit
int l3
ip add 100.1.3.1 255.255.255.0
no shut
exit
router bgp 200
network 100.1.1.0 mask 255.255.255.0
network 100.1.2.0 mask 255.255.255.0
network 100.1.3.0 mask 255.255.255.0
exit
R2:
end
show ip bgp
conf t
router bgp 100
aggregate-add 100.1.0.0 255.255.0.0
exit
end
show ip bgp
conf t
R1:
end
show ip bgp
conf t
R2:
router bgp 100
aggregate-add 100.1.0.0 255.255.0.0 summary-only
exit
R1:
end
show ip bgp
conf t
路由器选路原则:
---------------------------------------------------------------------
Well-Known Mandatory:
Origin,
AS-Path,
Next_Hop
Well-Known Discretionary:
Local_Pref,
Atomic_Aggregate
Optional Transitive:
Aggregator,
Community
Optional Nontransitive:
Med,
Originator_Id,
Cluster_List
Weight(最大) -- Local_Pref(最高) -- 本路由器 -- As_Path(最短) -- Origin(最低IGP<BGP<INCOMPLETE) -- MED(最低) -- (EBGP路由>联盟EGBP路由>IBGP路由) -- (离IGP邻居最近) -- (配置了maximum-path(IBGP),负载均衡) -- 更老的RBGP路由条目 -- BGP路由器ID(最低) -- Cluster-List(最短) -- BGP邻居地址(neighbor)
优选Weight值更高的路由:
-----------------------------------------------------------------------------------------
R1:
int f0/0
ip add 12.1.1.1 255.255.255.0
no shut
exit
int f1/0
ip add 13.1.1.1 255.255.255.0
no shut
exit
int l0
ip add 11.1.1.1 255.255.255.0
no shut
exit
router eigrp 1
no auto-summary
network 12.1.1.0 0.0.0.255
network 11.1.1.0 0.0.0.255
exit
router bgp 100
bgp router-id 11.1.1.1
neighbor 22.1.1.1 remote-as 100
neighbor 22.1.1.1 update-source l0
neighbor 22.1.1.1 next-hop-self
neighbor 13.1.1.3 remote-as 200
exit
R2:
int f0/0
ip add 12.1.1.2 255.255.255.0
no shut
exit
int f1/0
ip add 23.1.1.2 255.255.255.0
no shut
exit
int l0
ip add 22.1.1.1 255.255.255.0
no shut
exit
router eigrp 1
no auto-summary
network 12.1.1.0 0.0.0.255
network 22.1.1.0 0.0.0.255
exit
router bgp 100
bgp router-id 22.1.1.1
neighbor 11.1.1.1 remote-as 100
neighbor 11.1.1.1 update-source l0
neighbor 11.1.1.1 next-hop-self
neighbor 23.1.1.3 remote-as 200
exit
R3:
int f1/0
ip add 13.1.1.3 255.255.255.0
no shut
exit
int f0/0
ip add 23.1.1.3 255.255.255.0
no shut
exit
int l0
ip add 33.1.1.1 255.255.255.0
no shut
exit
router bgp 200
bgp router-id 33.1.1.1
neighbor 13.1.1.1 remote-as 100
neighbor 23.1.1.2 remote-as 100
network 33.1.1.0 mask 255.255.255.0
exit
-------------------------------------------------------------
R1:
end
show ip bgp
conf t
router bgp 100
neighbor 22.1.1.1 weight 1000
exit
end
clear ip bgp *
show ip bgp
conf t
ip prefix-list 33.1 permit 33.1.1.0/24
route-map wei permit 10
match ip add prefix-list 33.1
set weight 200
exit
route-map wei permit 9999
exit
router bgp 100
neighbor 22.1.1.1 route-map wei in
exit
end
clear ip bgp * in
show ip bgp
conf t
R3:
int l1
ip add 33.1.2.1 255.255.255.0
no shut
exit
router bgp 200
network 33.1.2.0 mask 255.255.255.0
exit
R1:
end
show ip bgp
conf t
优选Local Preference值更高的路由:
-----------------------------------------------------
R1:
end
show ip bgp summary
show ip bgp
show ip bgp 33.1.1.0
conf t
ip prefix-list 33.1 permit 33.1.1.0/24
route-map LOC permit 10
match ip add prefix-list 33.1
set local-preference 200
exit
route-map Loc permit 9999
exit
router bgp 100
neighbor 22.1.1.1 route-map LOC in
exit
end
clear ip bgp * in
show ip bgp
conf t
router bgp 100
bgp default local-preference 300
exit
end
show ip bgp
show ip bgp 33.1.1.0
conf t
R2:
end
show ip bgp
conf t
优选从本地路由器始发的路由:
---------------------------------------------------------------
R1:
int l100
ip add 100.1.1.1 255.255.255.0
exit
router bgp 100
network 100.1.1.0 mask 255.255.255.0
exit
R2:
int l100
ip add 100.1.1.1 255.255.255.0
exit
ip prefix-list 100 permit 100.1.1.0/24
route-map WEI permit 10
match ip add prefix-list 100
set weight 0
exit
router bgp 100
network 100.1.1.0 mask 255.255.255.0 route-map WEI
exit
end
show ip bgp
conf t
优选有最短AS-Path的BGP路由条目
--------------------------------------------------------------
R1:
end
show ip bgp
conf t
ip prefix-list 33.1 permit 33.1.1.0/24
route-map AS permit 10
match ip add prefix-list 33.1
set as-path prepend 10 20 30
exit
route-map AS permit 9999
exit
router bgp 100
neighbor 13.1.1.3 route-map AS in
exit
end
clear ip bgp * in
show ip bgp
conf t
选择更低Origin属性的路由
--------------------------------------------------------------
R1:
end
show ip bgp
conf t
ip prefix-list 33.1 permit 33.1.1.0/24
route-map ORI permit 10
match ip add prefix-list 33.1
set origin incomplete
exit
route-map ORI permit 9999
exit
router bgp 100
neighbor 13.1.1.3 route-map ORI in
exit
end
clear ip bgp * in
show ip bgp
conf t
CCNP路由实验(4) -- BGP的更多相关文章
- CCNP路由实验之七 动态路由之BGP
CCNP路由实验之七 动态路由之BGP 动态路由协议能够自己主动的发现远程网络,仅仅要网络拓扑结构发生了变化,路由器就会相互交换路由信息,不仅能够自己主动获知新添加的网络,还能够在当前网络连接失 ...
- CCNP路由实验之八 路由重公布
CCNP路由实验之八 路由重公布 在前面几个实验,已经学习了静态路由和动态路由.如今,我们要掌握怎样使它们在一个网络中融合,即路由重公布. 使用出站口作为静态路由 0 使用下一跳地址作为静态路由 ...
- CCNP路由实验之六 动态路由协议之IS-IS
CCNP路由实验之六动态路由协议之IS-IS 动态路由协议能够自己主动的发现远程网络.仅仅要网络拓扑结构发生了变化.路由器就会相互交换路由信息,不仅能够自己主动获知新添加的网络.还能够在当前网络 ...
- CCNP路由实验之九 路由策略
CCNP路由实验之九 路由策略 路由器在公布与接收路由信息时,可能须要实施一些策略.以便对路由信息进行过滤,比如仅仅接收或公布满足一定条件的路由信息. 一种路由协议可能须要引入其它的路由协议发现 ...
- CCNP路由实验之十 组播(多播)
CCNP路由实验之十 组播(多播) 种方法: 在交换机上配置静态的多播MAC地址到用户接口的映射 使用CGMP.执行CGMP的多播路由器能够将用户发送给自己 ...
- CCNP路由实验之十五 NAT(网络地址转换)
CCNP路由实验之十五 NAT(网络地址转换) 众所周知,要让自己的电脑连上Internet,必须要到运营商(ISP)申请一个上网账号,依据此账号申请自己的宽频业务(拨号上网.商业固定IP等等) ...
- CCIE路由实验(2) -- BGP选路原则
BGP路径属性分为4类: 公认必遵(Well-Known Mandatory):BGP更新报文中必须包含的,且必须被所有BGP厂商实现所能识别的,包括ORIGIN,AS-PATH和Next_Hop 1 ...
- CCNP路由实验之十二 MPLS
个.第3个数据包„„同样的操作.包含查询路由表.重写MAC地址,CRC校验等. 系列路由器.或者12000系列路由器. Netflow switching 通过一种标准的交换机制,处理了流的第一 ...
- CCNP路由实验(1) -- EIGRP
EIGRP(Enhanced Interior Gateway Routing Protocol,增强型内部网关路由协议)是Cisco公司开发的一个平衡混合型路由协议,它融合了距离向量和链路状态两种路 ...
随机推荐
- jQuery treeview的简单用法
最近的项目要用到treeview插件,刚好就自己整理一下这方面的资料. 1.文档树示例 最简单的一个例子就是文档树的实现.效果如下图所示. 在使用treeview之前,html文档中需要包含几个jqu ...
- 【JQ成长笔记】jQuery cookie的使用
jquery cookie挺好用的.简单实在.菜鸟都能用得上..额.文笔不好不好..咳咳.. 先来看看jq.cookie的aip 写入cookie $.cookie("this-cookie ...
- 5 Logistic回归(二)
5.2.4 训练算法:随机梯度上升 梯度上升算法:在每次更新回归系数时都需要遍历整个数据集,在数十亿样本上该算法复杂度太高. 改进方法:随机梯度上升算法:一次仅用一个样本点更新回归系数. 由于可以在新 ...
- [LeetCode]题解(python):154-Find Minimum in Rotated Sorted Array II
题目来源: https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/ 题意分析: 给定一个有重复的翻转的数组,找到最 ...
- Sencha Touch对DOM的访问及控制
HTML代码: <!doctype html> <html> <head> <meta charset="utf-8"> <t ...
- IIS应用程序池监控
最近发现公司运行的web网站应用程序池会突然停止,做的负载均衡(路由负载)又无法监测到IIS应用程序池的情况,就想着通过某一种监控方式监测IIS应用程序池的情况,如果处关闭状态则立刻重新启动.所说的I ...
- Adobe Acrobat 9 Pro 简体中文正式版(免激活)
软件语言:简体中文版本性质:官方正式版(免激活,非破解) Mac & PC [SN]: 1118-4018-6583-4956-2486-7805 修改 Abcpy.ini 可实现免序列号免激 ...
- C,C++经典(程序、错误程序)
1,程序 未执行完错误的return 0
- BZOJ 2716 Violet 3 天使玩偶 CDQ分治
题目大意:初始给定平面上的一个点集.提供两种操作: 1.将一个点增加点集 2.查询距离一个点最小的曼哈顿距离 K-D树是啥...不会写... 我仅仅会CDQ分治 对于一个询问,查询的点与这个点的位置关 ...
- C# OR/Mapping 数据处理模式学习
为什么要提出O/R Mapping概念 程序语言已经由面向过程的模型全面转向为面向对象的模型,UML的出现更加革新了软件开发方法论.然而数据库模型却从未随着开发语言的进步而随之革新,仍然使用面向关系的 ...