基本配置:
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. svn服务器配置小记

    在这里/opt/svndata/repos1创建svn版本库svnadmin create /opt/svndata/repos1 创建成功后会在/opt/svndata/repos1目录下生成con ...

  2. 关于NGINX下开启PHP-FPM 输出PHP错误日志的设置(已解决)

    最近在本地搭建的LNMP的开发环境.为了开发的时候不影响前端的正常开发就屏蔽的PHP里面php.ini中的一些错误提示.但是这样一来,就影响到了后端开发的一些问题比如不能及时调试开发中的一些问题. n ...

  3. 使用bootstrap做一个响应式的页面

    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  4. jQuery.attributes源码分析(attr/prop/val/class)

    回顾 有了之前的几篇对于jQuery.attributes相关的研究,是时候分析jQuery.attr的源码了 Javascript中的attribute和property分析 attribute和p ...

  5. 简单的实现树莓派的WEB控制

    最终效果如图: 用到的知识:Python Bottle HTML Javascript JQuery Bootstrap AJAX 当然还有 linux 我去,这么多--我还是一点一点说起吧-- 先贴 ...

  6. CentOS下Mysql安装调试

    一.安装   yum安装:yum install -y mysql-server mysql mysql-devel 设置自启动:chkconfig mysqld on 启动MySQL:service ...

  7. JS---DOM概述

    DOM DOM:文档对象模型document object model DOM三层模型: DOM1:将HTML文档封装成对象 DOM2:将XML文档封装成对象 DOM3:将XML文档封装成对象 DOM ...

  8. Oracle EBS-SQL (SYS-1): sysadmin_用户职责查询.sql

    select fu.user_name 用户名, fu.description 用户说明, frv.RESPONSIBILITY_NAME 职责名称, REQUEST_GROUP_NAME 报表组, ...

  9. JAVA I/O使用方法(转)

    下面四张图表明了类之间的继承关系,其中红色.加粗的类名是常用的类. 常用转换 FileReader——>BufferedReader BufferedReader in= new Buffere ...

  10. mysql timestamp 值不合法问题

    Create Table: CREATE TABLE `RecruitmentDesc` ( `sn` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号(自增字段 ...