基本配置:
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的更多相关文章

  1. CCNP路由实验之七 动态路由之BGP

     CCNP路由实验之七 动态路由之BGP 动态路由协议能够自己主动的发现远程网络,仅仅要网络拓扑结构发生了变化,路由器就会相互交换路由信息,不仅能够自己主动获知新添加的网络,还能够在当前网络连接失 ...

  2. CCNP路由实验之八 路由重公布

     CCNP路由实验之八 路由重公布 在前面几个实验,已经学习了静态路由和动态路由.如今,我们要掌握怎样使它们在一个网络中融合,即路由重公布. 使用出站口作为静态路由 0 使用下一跳地址作为静态路由 ...

  3. CCNP路由实验之六 动态路由协议之IS-IS

     CCNP路由实验之六动态路由协议之IS-IS 动态路由协议能够自己主动的发现远程网络.仅仅要网络拓扑结构发生了变化.路由器就会相互交换路由信息,不仅能够自己主动获知新添加的网络.还能够在当前网络 ...

  4. CCNP路由实验之九 路由策略

     CCNP路由实验之九 路由策略 路由器在公布与接收路由信息时,可能须要实施一些策略.以便对路由信息进行过滤,比如仅仅接收或公布满足一定条件的路由信息. 一种路由协议可能须要引入其它的路由协议发现 ...

  5. CCNP路由实验之十 组播(多播)

                        CCNP路由实验之十 组播(多播) 种方法: 在交换机上配置静态的多播MAC地址到用户接口的映射 使用CGMP.执行CGMP的多播路由器能够将用户发送给自己 ...

  6. CCNP路由实验之十五 NAT(网络地址转换)

     CCNP路由实验之十五 NAT(网络地址转换) 众所周知,要让自己的电脑连上Internet,必须要到运营商(ISP)申请一个上网账号,依据此账号申请自己的宽频业务(拨号上网.商业固定IP等等) ...

  7. CCIE路由实验(2) -- BGP选路原则

    BGP路径属性分为4类: 公认必遵(Well-Known Mandatory):BGP更新报文中必须包含的,且必须被所有BGP厂商实现所能识别的,包括ORIGIN,AS-PATH和Next_Hop 1 ...

  8. CCNP路由实验之十二 MPLS

     个.第3个数据包„„同样的操作.包含查询路由表.重写MAC地址,CRC校验等. 系列路由器.或者12000系列路由器. Netflow switching 通过一种标准的交换机制,处理了流的第一 ...

  9. CCNP路由实验(1) -- EIGRP

    EIGRP(Enhanced Interior Gateway Routing Protocol,增强型内部网关路由协议)是Cisco公司开发的一个平衡混合型路由协议,它融合了距离向量和链路状态两种路 ...

随机推荐

  1. C/C++ 结构体成员在内存中的对齐规则(转载)

    这几天在看王艳平的<windows 程序设计>,第5章讲解了MFC框架是怎么管理窗口句柄到窗口实例之间的映射,用到了两个类CPlex和CMapPtrToPtr,用于管理内存分配的类(避免因 ...

  2. markdown流程图

    markdown流程图 markdown流程图 markdown流程图语法:https://github.com/adrai/flowchart.js 定义元素阶段的语法是 tag=>type: ...

  3. 学习笔记(一) HTML+CSS基础课程

    这个周把慕课网的<HTML+CSS基础课程>课程学完,内容都是非常非常基础的,不过还是学到了几个小知识点,记下来先. <a>超链接发送邮件 直接上把他的图片给挪过来了,我就不打 ...

  4. 游戏中网络数据包和HTTP数据的思考

    快下班了,对于这个沙盒类文字游戏,其实考虑的东西还是很多的,服务器的架构,NPC, NPC API的运算,等等等 现在在思考大数据传输,比如背包数据或者拍卖行的商品展示数据在传输的时候的性能问题 目前 ...

  5. classic asp中使用ADODB.Command防止sql injection

    原始代码如下 Set Conn = Server.CreateObject("Adodb.Connection") Conn.Open "Provider=Microso ...

  6. 引用(ajaxfileupload.js) ajaxfileupload.js报这错jQuery.handleError is not a function

    jQuery.handleError is not a function 原因是,经测试handlerError只在jquery-1.4.2之前的版本中存在,jquery-1.6 和1.7中都没有这个 ...

  7. EditText无法失去焦点、失去焦点隐藏软键盘

    很奇怪,我在给EditText设置setOnFocusChangeListener()监听,但是始终未能成功,焦点一直存在,不知其原因,,代码如下: et_username.setOnFocusCha ...

  8. HBuilder的几个常用快捷键

    Alt + [ 匹配括号 Alt + ↓跳转到下一个可编辑区 Ctrl + Alt + j 合并下一行 Ctrl + Alt + ←选择助手 Shift + 回车 Shift + 空格   Ctrl ...

  9. ios jsbrige

    <!doctype html> <html> <head> <meta charset="utf-8"> <title> ...

  10. Android软件版本更新

     转的:适合新手学习,但在实际项目中不可这么做. 以下是我转的内容: ================================================================= ...