BGP综合实验

合集下载

实验BGP综合实验

实验BGP综合实验

实验BGP综合实验实验物理拓扑图R1r1(config)#interface e1/0r1(config-if)#ip add 192.168.1.1 255.255.255.0r1(config-if)#no shutdownr1(config-if)#exitr1(config)#interface loopback 1r1(config-if)#ip add 1.1.1.1 255.255.255.0r1(config-if)#no shutdownr1(config-if)#exitr1(config)#interface loopback 2r1(config-if)#ip add 192.168.7.11 255.255.255.0r1(config-if)#no shutdownr1(config-if)#exitr1(config)#router ripr1(config-router)#net 192.168.1.0r1(config-router)#net 192.168.7.0r1(config-router)#net 1.1.1.0r1(config-router)#exitr1(config)#router bgp 100r1(config-router)#neighbor 2.2.2.2 remote-as 200 手动指上邻居r1(config-router)#neighbor 2.2.2.2 update-source loopback 1 以我的LOOPBACK 1 为原与2 .2..2.2 建立邻居关系r1(config-router)#neighbor 2.2.2.2 ebgp-multihop 2 EB与EB用回环口建立邻居所要经历的HOP数r1(config-router)#exitr1(config)#ip route 2.2.2.0 255.255.255.0 192.168.1.2r1(config)#router bgp 100r1(config-router)#net 192.168.1.0r1(config-router)#net 1.1.1.0r1(config-router)#net 192.168.7.0r1(config-router)#endR2r2(config)#interface e1/0r2(config-if)#ip add 192.168.1.2 255.255.255.0r2(config-if)#no shutdownr2(config-if)#exitr2(config)#interface e1/1r2(config-if)#ip add 192.168.2.1 255.255.255.0r2(config-if)#no shutdownr2(config-if)#exitr2(config)#interface loopback 1r2(config-if)#ip add 2.2.2.2 255.255.255.0r2(config-if)#no shutdownr2(config-if)#exitr2(config)#router eigrp 100r2(config-router)#net 2.2.2.0r2(config-router)#net 192.168.2.0r2(config-router)#exitr2(config)#router bgp 200r2(config-router)#neighbor 1.1.1.1 remote-as 100r2(config-router)#neighbor 1.1.1.1 update-source loopback 1r2(config-router)#neighbor 1.1.1.1 ebgp-multihop 2r2(config-router)#exitr2(config)#ip route 1.1.1.0 255.255.255.0 192.168.1.1r2(config)#router bgp 200r2(config-router)#neighbor 3.3.3.3 remote-as 200r2(config-router)#neighbor 3.3.3.3 update-source loopback 1r2(config-router)#neighbor 4.4.4.4 remote-as 200r2(config-router)#neighbor 4.4.4.4 update-source loopback 1r2(config-router)#net 192.168.1.0r2(config-router)#net 192.168.2.0r2(config-router)#net 2.2.2.0r2(config-router)#endr2#show ip r*Mar 1 00:19:29.135: %SYS-5-CONFIG_I: Configured from console by consoler2#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static rouo - ODR, P - periodic downloaded static routeGateway of last resort is not set1.0.0.0/24 is subnetted, 1 subnetsS 1.1.1.0 [1/0] via 192.168.1.12.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 2.2.2.0/24 is directly connected, Loopback1D 2.0.0.0/8 is a summary, 00:13:45, Null0D 3.0.0.0/8 [90/409600] via 192.168.2.2, 00:09:50, Ethernet1/1D 4.0.0.0/8 [90/435200] via 192.168.2.2, 00:07:28, Ethernet1/1B 192.168.4.0/24 [200/0] via 4.4.4.4, 00:00:38B 192.168.7.0/24 [20/0] via 1.1.1.1, 00:01:19C 192.168.1.0/24 is directly connected, Ethernet1/0C 192.168.2.0/24 is directly connected, Ethernet1/1D 192.168.3.0/24 [90/307200] via 192.168.2.2, 00:09:47, Ethernet1/1r2(config)#router bgp 200r2(config-router)#neighbor 3.3.3.3 next-hop-self 默认EB告诉IB路由条目是下一跳不会改变所以必须强制下一跳r2(config-router)#neighbor 4.4.4.4 next-hop-selfr2(config-router)#endr2#show ip route*Mar 1 00:21:54.807: %SYS-5-CONFIG_I: Configured from console by consoler2#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static rouo - ODR, P - periodic downloaded static routeGateway of last resort is not setB 192.168.12.0/24 [200/0] via 4.4.4.4, 00:00:061.0.0.0/24 is subnetted, 1 subnetsS 1.1.1.0 [1/0] via 192.168.1.12.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 2.2.2.0/24 is directly connected, Loopback1D 2.0.0.0/8 is a summary, 00:16:11, Null0D 3.0.0.0/8 [90/409600] via 192.168.2.2, 00:12:16, Ethernet1/1D 4.0.0.0/8 [90/435200] via 192.168.2.2, 00:09:54, Ethernet1/1B 192.168.4.0/24 [200/0] via 4.4.4.4, 00:03:04B 192.168.7.0/24 [20/0] via 1.1.1.1, 00:03:45C 192.168.1.0/24 is directly connected, Ethernet1/0C 192.168.2.0/24 is directly connected, Ethernet1/1D 192.168.3.0/24 [90/307200] via 192.168.2.2, 00:12:13, Ethernet1/1R3r3(config)#interface e1/1r3(config-if)#ip add 192.168.2.2 255.255.255.0r3(config-if)#no shutdownr3(config-if)#exitr3(config)#interface e1/0r3(config-if)#ip add 192.168.3.1 255.255.255.0r3(config-if)#no shutdownr3(config-if)#exitr3(config)#interface loopback 1r3(config-if)#ip add 3.3.3.3 255.255.255.0r3(config-if)#no shutdownr3(config-if)#exitr3(config)#router eigrp 100r3(config-router)#net 3.3.3.0r3(config-router)#net 192.168.2.0r3(config-router)#net 192.168.3.0r3(config-router)#exitr3(config)#router bgp 200r3(config-router)#neighbor 2.2.2.2 remote-as 200r3(config-router)#neighbor 2.2.2.2 update-source loopback 1r3(config-router)#neighbor 4.4.4.4 remote-as 200r3(config-router)#neighbor 4.4.4.4 update-source loopback 1r3(config-router)#net 192.168.2.0r3(config-router)#net 192.168.3.0r3(config-router)#net 3.3.3.0r3(config-router)#endr3#show ip route*Mar 1 00:19:36.211: %SYS-5-CONFIG_I: Configured from console by r3#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter aN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external typE1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-ia - IS-IS inter area, * - candidate default, U - per-usero - ODR, P - periodic downloaded static routeGateway of last resort is not setD 2.0.0.0/8 [90/409600] via 192.168.2.1, 00:09:58, Ethernet1/13.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 3.3.3.0/24 is directly connected, Loopback1D 3.0.0.0/8 is a summary, 00:10:00, Null0D 4.0.0.0/8 [90/409600] via 192.168.3.2, 00:07:36, Ethernet1/0B 192.168.4.0/24 [200/0] via 4.4.4.4, 00:00:46B 192.168.1.0/24 [200/0] via 2.2.2.2, 00:01:28C 192.168.2.0/24 is directly connected, Ethernet1/1C 192.168.3.0/24 is directly connected, Ethernet1/0r3#show ip bgpBGP table version is 7, local router ID is 3.3.3.3Status codes: s suppressed, d damped, h history, * valid, > best,r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incompleteNetwork Next Hop Metric LocPrf Weight Path *>i192.168.1.0 2.2.2.2 0 100 0 i *> 192.168.2.0 0.0.0.0 0 32768 i* i 2.2.2.2 0 100 0 i* i192.168.3.0 4.4.4.4 0 100 0 i *> 0.0.0.0 0 32768 i *>i192.168.4.0 4.4.4.4 0 100 0 i* i192.168.7.0 1.1.1.1 0 100 0 100 i * i192.168.12.0 5.5.5.5 0 100 0 300 i r3#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter aN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external typE1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-ia - IS-IS inter area, * - candidate default, U - per-usero - ODR, P - periodic downloaded static routeGateway of last resort is not setD 2.0.0.0/8 [90/409600] via 192.168.2.1, 00:10:53, Ethernet1/13.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 3.3.3.0/24 is directly connected, Loopback1D 3.0.0.0/8 is a summary, 00:10:56, Null0D 4.0.0.0/8 [90/409600] via 192.168.3.2, 00:08:31, Ethernet1/0B 192.168.4.0/24 [200/0] via 4.4.4.4, 00:01:41B 192.168.7.0/24 [200/0] via 2.2.2.2, 00:00:13B 192.168.1.0/24 [200/0] via 2.2.2.2, 00:02:23C 192.168.2.0/24 is directly connected, Ethernet1/1C 192.168.3.0/24 is directly connected, Ethernet1/0r3#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter aN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external typE1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-ia - IS-IS inter area, * - candidate default, U - per-usero - ODR, P - periodic downloaded static routeGateway of last resort is not setB 192.168.12.0/24 [200/0] via 4.4.4.4, 00:00:09D 2.0.0.0/8 [90/409600] via 192.168.2.1, 00:12:10, Ethernet1/13.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 3.3.3.0/24 is directly connected, Loopback1D 3.0.0.0/8 is a summary, 00:12:12, Null0D 4.0.0.0/8 [90/409600] via 192.168.3.2, 00:09:48, Ethernet1/0B 192.168.4.0/24 [200/0] via 4.4.4.4, 00:02:58B 192.168.7.0/24 [200/0] via 2.2.2.2, 00:01:29B 192.168.1.0/24 [200/0] via 2.2.2.2, 00:03:40C 192.168.2.0/24 is directly connected, Ethernet1/1C 192.168.3.0/24 is directly connected, Ethernet1/0R4r4(config)#interface e1/0r4(config-if)#ip add 192.168.3.2 255.255.255.0r4(config-if)#no shutdownr4(config-if)#exitr4(config)#interface e1/1r4(config-if)#ip add 192.168.4.1 255.255.255.0r4(config-if)#no shutdownr4(config-if)#exitr4(config)#interface loopback 1r4(config-if)#ip add 4.4.4.4 255.255.255.0r4(config-if)#no shutdownr4(config-if)#exitr4(config)#router eigrp 100r4(config-router)#net 192.168.3.0r4(config-router)#net 4.4.4.0r4(config-router)#exitr4(config)#router bgp 200r4(config-router)#neighbor 3.3.3.3 remote-as 200r4(config-router)#neighbor 3.3.3.3 update-source loopback r4(config-router)#neighbor 2.2.2.2 remote-as 200r4(config-router)#neighbor 2.2.2.2 update-source loopback r4(config-router)#neighbor 5.5.5.5 remote-as 300r4(config-router)#neighbor 5.5.5.5 update-source loopback r4(config-router)#neighbor 5.5.5.5 ebgp-multihop 2r4(config-router)#exitr4(config)#ip route 5.5.5.0 255.255.255.0 192.168.4.2r4(config)#router bgp 200r4(config-router)#net 192.168.3.0r4(config-router)#net 192.168.4.0r4(config-router)#net 4.4.4.0r4(config-router)#endr4(config)#router bgp 200r4(config-router)#neighbor 3.3.3.3 next-hop-selfr4(config-router)#neighbor 2.2.2.2 next-hop-selfR5r5(config)#interface e1/1r5(config-if)#ip add 192.168.4.2 255.255.255.0r5(config-if)#no shutdownr5(config-if)#exitr5(config)#interface loopback 1r5(config-if)#ip add 5.5.5.5 255.255.255.0r5(config-if)#no shutdownr5(config-if)#exitr5(config)#interface loopback 2r5(config-if)#ip add 192.168.12.27 255.255.255.0r5(config-if)#no shutdownr5(config-if)#exitr5(config)#router ospf 1r5(config-router)#net 5.5.5.0 0.0.0.255 area 0r5(config-router)#net 192.168.4.0 0.0.0.255 area 0r5(config-router)#net 192.168.12.0 255.255.255.0 area 0r5(config-router)#exitr5(config)#ip route 4.4.4.0 255.255.255.0 192.168.4.1r5(config)#router bgp 300r5(config-router)#neighbor 4.4.4.4 remote-as 200r5(config-router)#neighbor 4.4.4.4 update-source loopback 1 r5(config-router)#neighbor 4.4.4.4 ebgp-multihop 2r5(config-router)#net 192.168.4.0r5(config-router)#net 192.168.12.0r5(config-router)#net 5.5.5.0。

BGP综合实验

BGP综合实验

要点总结:bgp的next-hop属性取值有三种情况1、bgp路由器把自己产生的路由发给ibgp对等体时,将下一跳属性设为自己与对端连接的接口的地址。

2、bgp路由器把自己收到的路由发给ebgp对等体时,把下一跳属性设置为自己与对端连接的接口的地址。

3、bgp路由器把从ebgp学到的路由发给ibgp对等体时,并不改变路由信息的属性。

如果配置了负载分担,则会修改下一跳属性。

BGP路由的Origin属性有以下三种:IGP---路由起源于同一AS域内,用show ip bgp时由I代表EGP---路由通过Exterior Gateway Protocol学得,EGP也是一种自治系统间通讯的路由协议,在BGP 出现前使用,已经被BGP取代。

用show ip bgp时由e代表。

Incomplete---路由起源未知或通过其他方式学得,用?表示实验拓扑1、验证AS-PATH属性启动RA/RB/RC/RF配置接口IP,按图示启动各路由器BGP的协议查看RA的路由表RA#show ip route1.0.0.0/32 is subnetted, 1 subnetsC 1.1.1.1 is directly connected, Loopback0C 200.1.0.0/24 is directly connected, FastEthernet0/0C 200.2.0.0/24 is directly connected, Serial1/0B 200.3.0.0/24 [200/0] via 200.2.0.2, 00:01:37C 192.168.1.0/24 is directly connected, Serial1/1B 192.168.2.0/24 [200/0] via 200.2.0.2, 00:01:37红色字第一条,RA到200.3.0.0网段的下一跳是RC,而不是用快速以太网链路连接的RB。

BGP实验报告—20070305

BGP实验报告—20070305

BGP实验报告—计算机应用技术周昌盛 20070305 一、实验目标本实验中,将配置内部BGP(IBGP)以及EBGP,使用公司AS内部不同的路由器到ISP的冗余链路。

为了使IBGP对等体正确地交换路由选择信息,必须使用命令next-hop-self。

还要使用属性local-preference和med(多出口描述符),这确保了平缓的、不限量的流量使用T1链路发送去往ISP1的AS200的数据和接收从该AS来的数据。

只有当主T1链路失效时才使用流量受限的T1链路。

数据流通过流量受限的T1链路可以获得跟主T1链路相同的带宽,但费用就高得多,确保这条链路不在非必要时使用。

本实验的拓扑图如图1-1所示:图1-1 实验拓扑图二、实验设备由于实验条件限制,本实验中使用模拟器R1、R2、R3来模拟上述三台路由器三、实验背景本实验中将在路由器SanJose1和SanJose2与外部邻局AS200的ISP1运行BGP,在SanJose1和SanJose2之间运行IBGP。

最后,在公司的网络中运行EIGRP。

四、实验步骤步骤1配置路由器ISP1的接口:Router>enRouter#config tRouter<config>#hostname ISP1ISP1<config>#interface loopback0ISP1<config-if>#ip add 192.168.100.1 255.255.255.0ISP1<config-if>#no shutISP1<config-if>#interface f1/0ISP1<config-if>#ip add 192.168.1.1 255.255.255.252ISP1<config-if>#no shutISP1<config-if>#interface f0/0ISP1<config-if>#ip add 192.168.1.5 255.255.255.252ISP1<config-if>#no shutISP1<config-if>#end配置路由器SanJose1的接口:Router>enRouter#config tRouter<config>#hostname SanJose1SanJose1<config>#interface loopback0SanJose1<config-if>#ip add 172.16.64.1 255.255.255.0 SanJose1<config-if>#no shutSanJose1<config-if>#interface f1/0SanJose1<config-if>#ip add 192.168.1.6 255.255.255.252 SanJose1<config-if>#no shutSanJose1<config-if>#interface f0/0SanJose1<config-if>#ip add 172.16.1.1 255.255.255.0 SanJose1<config-if>#no shutSanJose1<config-if>#end配置路由器SanJose2的接口:Router>enRouter#config tRouter<config>#hostname SanJose1SanJose2<config>#interface loopback0SanJose2<config-if>#ip add 172.16.32.1 255.255.255.0 SanJose2<config-if>#no shutSanJose2<config-if>#interface f1/0SanJose2<config-if>#ip add 172.16.1.2 255.255.255.252 SanJose2<config-if>#no shutSanJose2<config-if>#interface f0/0SanJose2<config-if>#ip add 192.168.1.2 255.255.255.252 SanJose2<config-if>#no shutSanJose2<config-if>#end上述配置完成后,可以使用ping命令来测试直连路由之间的连通性。

实验三十四、BGP的配置

实验三十四、BGP的配置
七、 注意事项和排错
1. 通过使用网络命令或重发布,BGP 进程必须能知道路由 2. 被通告的路由必须在路由表中 3. IGBP 与 IGP 必须同步才能出现在路由表中
八、 配置序列
Router-B#sh run 正在收集配置...
当前配置: ! !version 1.3.2E service timestamps log date service timestamps debug date no service password-encryption ! hostname Router-B ! ip host a 192.168.1.1 ip host c 192.168.2.2 ! ! ! ! ! ! interface FastEthernet0/0
Distance: external 20 internal 200 local 200
Timers: keepalive 60, holdtime 180
1 network entries using 120 bytes of memory
1 path entries using 68 bytes of memory
九、 共同思考
1. 什么是自治系统? 2. BGP 协议的作用是什么? 3. 如何才能是 IGP 与 IBGP 同步?
十、 课后练习
将地址改为 10.0.0.0/24 这个网段重复以上实验
十一、 相关命令详解
router bgp
使用 router bgp 命令启动 BGP 进程或进入 BGP 配置模式,用 no router bgp 命令关闭 BGP 进 程: router bgp as-number no router bgp as-number
第九步:相关的查看命令

BGP MPLS VPN综合实验

BGP MPLS VPN综合实验

BGP MPLS VPN综合实验实验拓扑如下:一、实验背景:其中R1,R2,R3为某运营商网络中的PE-P-PE设备,R1/R2/R3运行OSPF协议打通IBGP路由,承载MPLS VPN业务;其中R1,R2,R3为一个MPLS域;R4,R5,R6,R7模拟客户的CE设备;R4与R6为同一个VPN站点:SITE-A, R5与R7为同一个VPN站点SITE-B二、PE与CE间的路由方式:R1与R4采用OSPF +VPN多实例,R1与R5采用EBGPR3与R6采用静态路由方式 R3与R7采用EBGP三、IP地址规划:R1 E0/0/0:192.168.1.1/30 LOOPBACK: 1.1.1.1/32E0/0/1:192.168.3.1/30 G0/0/0:192.168.4.1/30R2 E0/0/0:192.168.1.2/30 E0/0/1:192.168.2.1/30LOOPBACK: 2.2.2.2/32R3 E0/0/0:192.168.2.2/30 LOOPBACK: 3.3.3.3/32E0/0/1:192.168.5.1/30 G0/0/0:192.168.6.1/30R4 E0/0/0:192.168.3.2/30 LOOPBACK: 4.4.4.4/32R5 E0/0/0:192.168.4.2/30 LOOPBACK: 5.5.5.5/32R6 E0/0/0:192.168.5.2/30 LOOPBACK: 6.6.6.6/32R7 E0/0/0:192.168.6.1/30 LOOPBACK: 7.7.7.7/32四、实验需求:按照要求完成本实验,业务验证:同一VPN站点的CE能够互访;并能够熟练掌握查看VPN 路由信息;配置步骤:1.首先配置各设备的IP地址(略)2.完成R1-R2-R3之间的OSPF配置;R1ospf 1area 0.0.0.0network 192.168.1.0 0.0.0.3network 1.1.1.1 0.0.0.0R2ospf 1area 0.0.0.0network 192.168.1.0 0.0.0.3network 2.2.2.2 0.0.0.0network 192.168.2.0 0.0.0.3R3ospf 1area 0.0.0.0network 192.168.2.0 0.0.0.3network 3.3.3.3 0.0.0.03.完成R1-R3的IBGP配置R1bgp 100peer 3.3.3.3 as-number 100peer 3.3.3.3 connect-interface LoopBack0#ipv4-family unicastundo synchronizationpeer 3.3.3.3 enableR3bgp 100peer 1.1.1.1 as-number 100peer 1.1.1.1 connect-interface LoopBack0#ipv4-family unicastundo synchronizationpeer 1.1.1.1 enable注解:由于这里BGP承载的业务为MPLS VPN业务,R1-R3之间不必要建立IBGP邻居,只是为了方便大家类似学习配置BGP VPNV4 PEER,所以我们开始配置BGP VPN PEERR1:ipv4-family vpnv4policy vpn-targetpeer 3.3.3.3 enableR3:ipv4-family vpnv4policy vpn-targetpeer 1.1.1.1 enable配置完成后要查看BGP VPNV4 PEER的建立情况,查看的命令如下:[R1-bgp]display bgp vpnv4 all peerBGP local router ID : 192.168.1.1Local AS number : 100Total number of peers : 1 Peers in established state : 1Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv3.3.3.3 4 100 200 201 0 03:18:14 Established4.完成PE与CE(R1-R5)之间的VPN配置;在R1上创建VPN实例(VRF)ip vpn-instance site-aipv4-familyroute-distinguisher 20:20vpn-target 10:10 export-extcommunityvpn-target 10:10 import-extcommunity#ip vpn-instance site-bipv4-familyroute-distinguisher 30:30vpn-target 40:40 export-extcommunityvpn-target 40:40 import-extcommunity在端口进行绑定VPN实例:interface GigabitEthernet0/0/0ip binding vpn-instance site-bip address 192.168.4.1 255.255.255.252注意事项一:当配置上IP地址绑定VPN实例后,interface GigabitEthernet0/0/0ip binding vpn-instance site-bInfo: All IPv4 related configurations on this interface are removed!提示IPV4地址全部清除,这时我们需要重新配置,删除后也是,切记!interface GigabitEthernet0/0/0ip binding vpn-instance site-bip address 192.168.4.1 255.255.255.252注意事项二:在VPN里我们做ping测试的时候,需要带上vpn实例名字才能ping通,不带的话ping不通的;[R1]ping 192.168.4.2PING 192.168.4.2: 56 data bytes, press CTRL_C to breakRequest time outRequest time outRequest time out正确的PING测试为:[R1]ping -vpn-instance site-b 192.168.4.2PING 192.168.4.2: 56 data bytes, press CTRL_C to breakReply from 192.168.4.2: bytes=56 Sequence=1 ttl=255 time=80 msReply from 192.168.4.2: bytes=56 Sequence=2 ttl=255 time=40 msReply from 192.168.4.2: bytes=56 Sequence=3 ttl=255 time=30 msReply from 192.168.4.2: bytes=56 Sequence=4 ttl=255 time=40 ms5.完成PE与CE(R1-R5)之间的EBGP配置;R1:bgp 100ipv4-family vpn-instance site-bpeer 192.168.4.2 as-number 500R5bgp 500peer 192.168.4.1 as-number 100#ipv4-family unicastundo synchronizationpeer 192.168.4.1 enable查看BGP VPNV4 PEER建立成功与否:[R1-bgp]display bgp vpnv4 all peerBGP local router ID : 192.168.1.1Local AS number : 100Total number of peers : 2 Peers in established state : 2Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 3.3.3.3 4 100 260 261 0 04:18:38 Established 0Peer of IPv4-family for vpn instance :VPN-Instance site-b, Router ID 192.168.1.1:192.168.4.2 4 500 3 2 0 00:00:03 Established 1 或者直接带上VPN实例名字查看[R1-bgp]display bgp vpnv4 vpn-instance site-b peerBGP local router ID : 192.168.1.1Local AS number : 100VPN-Instance site-b, Router ID 192.168.1.1:Total number of peers : 1 Peers in established state : 1Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv192.168.4.2 4 500 10 9 0 00:07:08 Established 1现在我们将R5的loopback地址给宣告出去,不采用import的方式;R5bgp 500network 5.5.5.5 255.255.255.255宣告后我们在R1上进行查看是否学习到:[R1-bgp]display bgp vpnv4 all routing-tableBGP Local router ID is 192.168.1.1Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP, ? - incompleteTotal number of routes from all PE: 1Route Distinguisher: 30:30Network NextHop MED LocPrf PrefVal Path/Ogn *> 5.5.5.5/32 192.168.4.2 0 0 500iVPN-Instance site-b, Router ID 192.168.1.1:Total Number of Routes: 1Network NextHop MED LocPrf PrefVal Path/Ogn *> 5.5.5.5/32 192.168.4.2 0 0 500i我们在R3上看看能不能学习到:<R3>display bgp vpnv4 all routing-table<R3>通过查看发现R3学习不到关于5.5.5.5这条BGP VPN路由;在思科设备里这时就应该能够学习到此条路由,但在华为设备里,必须要开启MPLS后才能学到,大家可以做个不带VPN的实验看看;6.开启R1--R2 --R3 MPLS域;R1mpls lsr-id 1.1.1.1mplsmpls ldp#interface Ethernet0/0/0ip address 192.168.1.1 255.255.255.252mplsmpls ldpR2:mpls lsr-id 2.2.2.2mplsmpls ldp#interface Ethernet0/0/0mplsmpls ldp#interface Ethernet0/0/1mplsmpls ldpR3:MPLS LSR 3.3.3.3MPLSMPLS LDP#[R3]interface Ethernet0/0/0[R3-Ethernet0/0/0]mpls[R3-Ethernet0/0/0]mpls ldp然后在R3上查看关于5.5.5.5这条路由信息:[R3]display bgp vpnv4 all routing-tableBGP Local router ID is 192.168.2.2Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP, ? - incompleteTotal number of routes from all PE: 1Route Distinguisher: 30:30Network NextHop MED LocPrf PrefVal Path/Ogn *>i 5.5.5.5/32 1.1.1.1 0 100 0 500iVPN-Instance site-b, Router ID 192.168.2.2:Total Number of Routes: 1Network NextHop MED LocPrf PrefVal Path/Ogn *>i 5.5.5.5/32 1.1.1.1 0 100 0 500i 7.完成R3—R7之间的配置(略)配置完成后,在R3上查看BGP VPNV4路由[R3]display bgp vpnv4 all routing-tableBGP Local router ID is 192.168.2.2Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP, ? - incompleteTotal number of routes from all PE: 2Route Distinguisher: 30:30Network NextHop MED LocPrf PrefVal Path/Ogn *>i 5.5.5.5/32 1.1.1.1 0 100 0 500i*> 7.7.7.7/32 192.168.6.2 0 0 700iVPN-Instance site-b, Router ID 192.168.2.2:Total Number of Routes: 2Network NextHop MED LocPrf PrefVal Path/Ogn*>i 5.5.5.5/32 1.1.1.1 0 100 0 500i*> 7.7.7.7/32 192.168.6.2 0 0 700i在R7上进行ping测试ping 5.5.5.5[R7-bgp]ping 5.5.5.5PING 5.5.5.5: 56 data bytes, press CTRL_C to breakRequest time outRequest time out--- 5.5.5.5 ping statistics ---2 packet(s) transmitted0 packet(s) received100.00% packet loss通过测试发现PING 5.5.5.5不通,带上源地址ping 却能通;[R7-bgp]ping -a 7.7.7.7 5.5.5.5PING 5.5.5.5: 56 data bytes, press CTRL_C to breakReply from 5.5.5.5: bytes=56 Sequence=1 ttl=253 time=210 msReply from 5.5.5.5: bytes=56 Sequence=2 ttl=253 time=110 msReply from 5.5.5.5: bytes=56 Sequence=3 ttl=253 time=170 msReply from 5.5.5.5: bytes=56 Sequence=4 ttl=253 time=110 msReply from 5.5.5.5: bytes=56 Sequence=5 ttl=253 time=100 ms--- 5.5.5.5 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 100/140/210 ms<R5>ping -a 5.5.5.5 7.7.7.7PING 7.7.7.7: 56 data bytes, press CTRL_C to breakReply from 7.7.7.7: bytes=56 Sequence=1 ttl=253 time=130 msReply from 7.7.7.7: bytes=56 Sequence=2 ttl=253 time=80 msReply from 7.7.7.7: bytes=56 Sequence=3 ttl=253 time=110 ms--- 7.7.7.7 ping statistics ---3 packet(s) transmitted3 packet(s) received0.00% packet lossround-trip min/avg/max = 80/106/130 ms这是为什么呢?因为我们直接PING 的话是相当于带着源地址为接口地址PING的,由于接口IP地址和5.5.5.5路由不通;那么怎么办呢?这时候就需要把直连vpn的接口的路由给发布出去,我们在R1上可以做network也可以做import方式;在现网实际操作中会有很多路由地址段需要发布,我们假如要做的话就需要手工的方式进行network,工作量较大,这里我们采用import的方式进行引入;[R1]bgp 100[R1-bgp] ipv4-family vpn-instance site-b[R1-bgp-site-b]import-route direct[R3]bgp 100[R3-bgp] ipv4-family vpn-instance site-b[R3-bgp-site-b]import-route direct另附上network的方式:[R1]bgp 100ipv4-family vpn-instance site-bnetwork 192.168.4.0 255.255.255.252peer 192.168.4.2 as-number 500[R3]bgp 100ipv4-family vpn-instance site-bnetwork 192.168.6.0 255.255.255.252peer 192.168.6.2 as-number 700做完之后我们可以PING测试下:[R1]ping -vpn-instance site-b 192.168.6.1PING 192.168.6.1: 56 data bytes, press CTRL_C to breakReply from 192.168.6.1: bytes=56 Sequence=1 ttl=254 time=100 ms Reply from 192.168.6.1: bytes=56 Sequence=2 ttl=254 time=50 ms Reply from 192.168.6.1: bytes=56 Sequence=3 ttl=254 time=60 ms Reply from 192.168.6.1: bytes=56 Sequence=4 ttl=254 time=70 ms Reply from 192.168.6.1: bytes=56 Sequence=5 ttl=254 time=80 ms --- 192.168.6.1 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 50/72/100 ms[R1]ping -vpn-instance site-b 5.5.5.5PING 5.5.5.5: 56 data bytes, press CTRL_C to breakReply from 5.5.5.5: bytes=56 Sequence=1 ttl=255 time=30 ms Reply from 5.5.5.5: bytes=56 Sequence=2 ttl=255 time=60 ms Reply from 5.5.5.5: bytes=56 Sequence=3 ttl=255 time=30 ms--- 5.5.5.5 ping statistics ---3 packet(s) transmitted3 packet(s) received0.00% packet lossround-trip min/avg/max = 30/40/60 ms[R1]ping -vpn-instance site-b 7.7.7.7PING 7.7.7.7: 56 data bytes, press CTRL_C to breakReply from 7.7.7.7: bytes=56 Sequence=1 ttl=254 time=130 msReply from 7.7.7.7: bytes=56 Sequence=2 ttl=254 time=90 msReply from 7.7.7.7: bytes=56 Sequence=3 ttl=254 time=60 msReply from 7.7.7.7: bytes=56 Sequence=4 ttl=254 time=130 msReply from 7.7.7.7: bytes=56 Sequence=5 ttl=254 time=70 ms--- 7.7.7.7 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 60/96/130 ms[R5]ping 7.7.7.7PING 7.7.7.7: 56 data bytes, press CTRL_C to breakReply from 7.7.7.7: bytes=56 Sequence=1 ttl=253 time=110 msReply from 7.7.7.7: bytes=56 Sequence=2 ttl=253 time=70 msReply from 7.7.7.7: bytes=56 Sequence=3 ttl=253 time=90 msReply from 7.7.7.7: bytes=56 Sequence=4 ttl=253 time=100 msReply from 7.7.7.7: bytes=56 Sequence=5 ttl=253 time=110 ms--- 7.7.7.7 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 70/96/110 ms7.完成R1—R4之间的配置(略)[R1-ospf-2]dis this#ospf 2 vpn-instance site-aarea 0.0.0.0network 192.168.3.0 0.0.0.38.<r4>dis c c ospf#ospf 2area 0.0.0.0network 192.168.3.0 0.0.0.3network 4.4.4.4 0.0.0.0同理在R1做完后需要将OSPF路由引入到BGP VPN实例中,生成BGP VPNV4路由信息:[R1]bgp 100ipv4-family vpn-instance site-aimport-route ospf 2引入之后我们在R1上查看关于R4的BGP VPNV4 路由[R1-bgp-site-a]display bgp vpnv4 vpn-instance site-a routing-tableBGP Local router ID is 192.168.1.1Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP, ? - incompleteVPN-Instance site-a, Router ID 192.168.1.1:Total Number of Routes: 2Network NextHop MED LocPrf PrefVal Path/Ogn*> 4.4.4.4/32 0.0.0.0 2 0 ?*> 192.168.3.0/30 0.0.0.0 0 0 ?从这里我们能看到R1学习到了R4的路由(其中包含4.4.4.4和互联接口),并生成了BGP VPNV4路由信息;9.完成R3—R6之间的配置(static路由方式)在R3上指示静态路由方式打通VPNV4 路由;[R3]ip route-static vpn-instance site-a 6.6.6.6 255.255.255.255 192.168.5.2配置完成后在R3上应该能看到关于6.6.6.6的vpnv4路由[R3]display ip routing-table vpn-instance site-aRoute Flags: R - relay, D - download to fib------------------------------------------------------------------------------Routing Tables: site-aDestinations : 3 Routes : 3Destination/Mask Proto Pre Cost Flags NextHop Interface6.6.6.6/32 Static 60 0 RD 192.168.5.2 Ethernet0/0/1192.168.5.0/30 Direct 0 0 D 192.168.5.1 Ethernet0/0/1192.168.5.1/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/1然后在R3上将这条路由变成BGP VPNV4路由;[R3]BGP 100ipv4-family vpn-instance site-aimport-route static完成后在R3上就能看见关于R6的bgp vpnv4路由信息;[R3-bgp-site-a]display bgp vpnv4 vpn-instance site-a routing-tableBGP Local router ID is 192.168.2.2Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP, ? - incompleteVPN-Instance site-a, Router ID 192.168.2.2:Total Number of Routes: 3Network NextHop MED LocPrf PrefVal Path/Ogn*>i 4.4.4.4/32 1.1.1.1 2 100 0 ?*> 6.6.6.6/32 0.0.0.0 0 0 ?*>i 192.168.3.0/30 1.1.1.1 0 100 0 ?我们查看路由表,发现有R4的loopback地址和互联接口的BGP VPNV4路由,及R6的loopback地址路由,但是没有R6的互联地址的路由,这样的话会导致R6的路由出不去?这样的话,我们就将R6的路由也发布下,我们也可以采用network或者import的方式发布;我们来采用import的方式![R3]bgp 100ipv4-family vpn-instance site-aimport-route direct引入后我们来查看路由表:[R3-bgp]display bgp vpnv4 vpn-instance site-a routing-tableBGP Local router ID is 192.168.2.2Status codes: * - valid, > - best, d - damped,h - history, i - internal, s - suppressed, S - StaleOrigin : i - IGP, e - EGP, ? - incompleteVPN-Instance site-a, Router ID 192.168.2.2:Total Number of Routes: 5Network NextHop MED LocPrf PrefVal Path/Ogn*>i 4.4.4.4/32 1.1.1.1 2 100 0 ?*> 6.6.6.6/32 0.0.0.0 0 0 ?*>i 192.168.3.0/30 1.1.1.1 0 100 0 ?*> 192.168.5.0/30 0.0.0.0 0 0 ?*> 192.168.5.1/32 0.0.0.0 0 0 ?引入后就多了R3与R6的互联地址路由信息;那么在R6上我们需要做什么呢?那就是指导路由出去,匹配网关,也就是做条缺省路由;[R6] ip route-static 0.0.0.0 0.0.0.0 192.168.5.1做完以上所有的配置后,VPN之间就都能够互访了;完整配置如下:实验背景,在全国运营商中,有很多ISP基于P设备(P/PE设备一般来说都是NE5000E)的造价以及传输资源等一系列因素,可能就会放弃P设备的购买,把PE兼顾P设备进行使用;本实验就把P设备去除,用R1和R3来模拟P/PE设备;更新IP地址:R3:E0/0/0:192.168.1.2/30实验拓扑如下:然后在R3的接口上开启MPLS后,其它配置不变;实验背景:在运营商承载网里的PE-CE组网,有部分运营商采用S9300系列交换机作为CE,交换机采用静态或者动态路由协议方式打通路由在本实验中R1与R3之间的配置不变,R1与SW1采用OSPF+VPN方式打通VPNV4路由,R3与SW2采用静态路由的方式打通路由,此时R3的角色为PE兼CE,交换机就作为PC的三层网关设备;IP地址规划:R1 E0/0/1:192.168.3.1/24SW1 G0/0/1透传VLAN 4000 VLANIF4000:192.168.3.2/24PC1: 192.168.3.100/24R3 E0/0/1:192.168.5.1/24SW2 G0/0/1透传VLAN 4000 VLANIF4000:192.168.5.2/24PC2的VLAN:VLAN 10 网关VLANIF10IP:10.10.10.1/24PC2:10.10.10.100/24完整配置如附件。

IGP-BGP综合实验及答案

IGP-BGP综合实验及答案

1、IGP综合实验BRIDGE(3分)RIP(6分)EIGRP(9分)OSPF(12分) REDISTRIBUTE (2分)IPV6(3分)BGP(16)MULTICAST (3分)IOS(6分)SEC(6分)QOS(6分)一,地址描述:1.1 R1-R5都有一个LO0 IP ADD = 10.10.X.X X=ROUTER NUMBER比如R1 的LO0 =10.10.1.1 ....1.2 R1-R3 E0 地址为:1.1.123.X/27 X=ROUTER NO.1.3 R2-R4 的广域网接口为: 1.1.234.X/29 X=ROUTER NO.1.4 R4-R5 的广域网接口为: 1.1.45.X/24 X=ROUTER NO.二,BRIDGE:(3分)2.1 如图所示, 配置R1-R3的以太地址,2.2 如图所示, 配置R2-R4之间物理接口的IP ADDRESS,2.3 R2-R4之间的FRAME-RELAY是全互连的,要求只用图中所示的PVC,2.4配置R4-R5之间链路为PPP, 并配置相应接口的地址,请消除32位的主机路由。

2.5配置R1-R5的LO02.6配置完成后测试各链路应能正常通讯。

三,RIP (6分)基本配置:(1分)3.1 R1,R3的E0运行RIP VERSION 2,(1分)⏹高级配置: (3分)3.2 使R1,R3仅向E0发送更新,不要向其他接口发送,所有的更新都是明细路由(1分)Interface e0 ; passive-interface default ; no passive-interface e0;3.3 请确保它们之间的VERSION 2的更新是通过BROADCAST发送的。

(1分)ip rip v2-broadcast3.4 如果在R1、R2、R3的以太网段里有一些VER 2的RIP更新包,但UPDATE SOURCE是150.1.1.1,很显然R1是不会收这些包的,在R1上做配置,使它可以收到这些路由。

雷光全BGP实验报告二

雷光全BGP实验报告二

一、实验名称
BGP同步
二、实验要求
分析BGP同步的好处,BGP同步的路由情况,以及在什么情况下使用同步。

三、实验拓扑
四、重要实验配置
Igp的配置:
RT1:
RT2:
RT3:
RT4:
BGP的配置RT1:
RT2:
RT5:
RT6:
五、实验现象
各设备的bpg表:
RT1:
RT2:
RT1路由表:
用ping命令进行全网互联的测试
在RT5上进行跟踪
六、实验分析
分析PC5(10.5.5.10)访问PC6(10.6.6.10)的过程
PC5:10.6.6.10与自己不在同一个网段,它将数据包发送给网关10.5.5.1(RT5)
RT5:查找路由表,发现:
RT1:查找路由表,发现:
RT3:查找路由表,发现:
RT4:查找路由表:发现:
一直到目标地址。

BGP同步,就是使IGP和BGP达到同步,如果没有达到同步的路由,将不会通告给邻居,也不会转发出去。

但是如果
开启同步的话,也有一点的危害,如果BGP的路由条目过多,发布到IGP的话,就会导致IGP路由器崩溃。

所以小心认真使用。

七、实验总结
通过本次实验,我掌握了BGP同步的概念,在什么情况下使用BGP同步,使用BGP同步的时候,要注意些什么,以及我们应该怎样去解决这种状况,显然BGP同步还是比较简单的。

BGP协议综合实验

BGP协议综合实验

R2(config-router)#neighbor 5.5.5.5 peer-group dcnp R2(config-router)#exit' R5(config)#router bgp 125 R5(config-router)#bgp router-id 5.5.5.5 R5(config-router)#neighbor dcnp peer-group R5(config-router)#neighbor dcnp remote-as 125 R5(config-router)#neighbor dcnp update-source loopback 0 R5(config-router)#neighbor dcnp next-hop-self R5(config-router)#neighbor 1.1.1.1 peer-group dcnp R5(config-router)#neighbor 2.2.2.2 peer-group dcnp R5(config-router)#neighbor 4.4.4.4 remote-as 4 R5(config-router)#neighbor 4.4.4.4 update-source loopback 0 R5(config-router)#neighbor 4.4.4.4 ebgp-multihop 2 R4(config)#router bgp 4 R4(config-router)#bgp router-id 4.4.4.4 R4(config-router)#neighbor 5.5.5.5 remote-as 125 R4(config-router)#neighbor 5.5.5.5 update-source loopback 0 R4(config-router)#neighbor 5.5.5.5 ebgp-multihop 2 R4(config-router)#^Z 3 在 R1,R2,R5 上启用 ospf 协议,在 R3 和 R4 上宣告路由,R4 和 R5 上配置默认路由 R1(config)#router ospf 110 R1(config-router)#network 12.1.1.0 0.0.0.255 ar R1(config-router)#network 12.1.1.0 0.0.0.255 area 0 R1(config-router)#network 1.1.1.0 0.0.0.255 area 0 R1(config-router)#^Z R2(config)#router ospf 110 R2(config-router)#network 12.1.1.0 0.0.0.255 area 0 R2(config-router)#network 13.1.1.0 0.0.0.255 area 0 R2(config-router)#network 2.2.2.0 0.0.0.255 area 0 R2(config-router)#network 25.1.1.0 0.0.0.255 area 0 R2(config-router)#exit R5(config)#ip route 4.4.4.0 255.255.255.0 45.1.1.4 R5(config)#router ospf 110 R5(config-router)#network 25.1.1.0 0.0.0.255 area 0 R5(config-router)#network 5.5.5.0 0.0.0.255 area 0 R4(config)#ip route 5.5.5.0 255.255.255.0 45.1.1.5 R4(config)#router bgp 4 R4(config-router)#network 4.4.4.0 mask 255.255.255.0 4 在 R1,R2,R5 上关闭同步 R1(config)#router bgp 125 R1(config-router)#no synchronization R2(config)#router bgp 125 R2(config-router)#no synchronization R5(config)#router bgp 125 R5(config-router)#no synchronization R5(config-router)#^Z 5 在 R3 和 R4 上 ping 命令测试 R3#ping 4.4.4.4 source 3.3.3.3
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

BGP综合实验
基本配置略。

注意的是我的RT1上的源地址是12.12.12.1所有ipv6地址是2002:c0c:c01:2::1(你自己的是什么就写什么)
同理RT5上我用的源地址是5.5.5.5,ipv6地址是2002:505:505:2:1
BGP配置
Ospf配置略。

加入验证增加安全
注意把12.12.12.0网段发布下不然IPV6隧道路由你还得引入什么的
6TO4隧道
RT1(注意先开启ipv6功能)
ipv6 route-static 2002:: 16 Tunnel 0两边加入静态路由
可以看到没有问题
选路问题
选路有多种方法我这里修改的通过BGP修改下一跳,别的方法我也迷糊,- -!
首先我们看RT2的路由表,我只是截取了部分我们想看的太多
我们先做RT1到RT5的路由选路,原理是做一个route-policy的过滤器,在第一个节点匹配10.0.0.1和11.0.0.1这个网段的或者这个IP,动作是修改下一跳为3.3.3.3(这个3.3.3.3可以让你断一条链路的情况下也能互通)我这个是为了方便在这RT5的一边做的
同样匹配10.0.1.1和11.0.1.1这个,动作是修改下一跳为4.4.4.4
应用到import和export两个方向上
还需要注意的是11.0.0.1和11.0.1.1这两条路由产生了黑洞,黑洞在RT3和RT4上我没还需要在RT3和RT4上加入静态路由解决黑洞
[RT3]ip route-static 11.0.0.0 24 5.5.5.5
[RT4]ip route-static 11.0.1.0 24 5.5.5.5
这样我们再看路由表
RT2上
RT5上
OK了命令简单想费劲
RT1上测试
RT5上
来回路径一致。

相关文档
最新文档