BGP的同步规则(上)


一、拓扑图:

BGP的同步规则(上)
 
二、BGP同步规则:
1
、配置完各路由器的IP地址和BGP协议。R2R4再互指邻居。同时注意把R2上的router-id指高。以便R4能学到完整路由。
2、配置完之后,看一下各路由器中学习到的全网bgp路由:
 
R1#sh ip route bgp
     10.0.0.0/30 is subnetted, 4 subnets
B       10.1.255.4 [20/0] via 10.1.255.2, 01:30:06
B       10.1.255.12 [20/0] via 10.1.255.2, 01:30:06
B       10.1.255.8 [20/0] via 10.1.255.2, 01:30:36
     150.150.0.0/24 is subnetted, 1 subnets
B       150.150.1.0 [20/0] via 10.1.255.2, 01:30:06
 
R2#sh ip route bgp
     10.0.0.0/30 is subnetted, 4 subnets
B       10.1.255.12 [200/0] via 10.1.255.10, 01:31:06
B       10.1.255.8 [200/0] via 10.1.255.6, 01:31:13
     130.130.0.0/24 is subnetted, 1 subnets
B       130.130.1.0 [20/0] via 10.1.255.1, 01:31:13
     150.150.0.0/24 is subnetted, 1 subnets
B       150.150.1.0 [200/0] via 10.1.255.14, 01:31:01
R3#sh ip route bgp
     10.0.0.0/30 is subnetted, 4 subnets
B       10.1.255.0 [200/0] via 10.1.255.5, 01:31:21
B       10.1.255.12 [200/0] via 10.1.255.10, 04:52:27
     130.130.0.0/24 is subnetted, 1 subnets
B       130.130.1.0 [200/0] via 10.1.255.1, 01:31:15
     150.150.0.0/24 is subnetted, 1 subnets
B       150.150.1.0 [200/0] via 10.1.255.14, 04:52:22
R4#sh ip route bgp
     10.0.0.0/30 is subnetted, 4 subnets
B       10.1.255.4 [200/0] via 10.1.255.9, 01:32:32
B       10.1.255.0 [200/0] via 10.1.255.5, 01:31:39
     130.130.0.0/24 is subnetted, 1 subnets
B       130.130.1.0 [200/0] via 10.1.255.1, 01:31:34
     150.150.0.0/24 is subnetted, 1 subnets
B       150.150.1.0 [20/0] via 10.1.255.14, 04:52:46
R5#sh ip route bgp
     10.0.0.0/30 is subnetted, 4 subnets
B       10.1.255.4 [20/0] via 10.1.255.13, 04:53:03
B       10.1.255.0 [20/0] via 10.1.255.13, 01:31:56
B       10.1.255.8 [20/0] via 10.1.255.13, 04:53:03
     130.130.0.0/24 is subnetted, 1 subnets
B       130.130.1.0 [20/0] via 10.1.255.13, 01:31:25
 
3、从上面看到,各路由器全网的BGP路由都能学到,那么现在我们根据拓扑图在R2/R3/R4中运行ospf 协议。看一下对整个网络的影响:
 
R2(config)#router ospf 1
R2(config-router)#net 10.1.255.0 0.0.0.3 area 0
R2(config-router)#net 10.1.255.4 0.0.0.3 area 0
 
R3(config)#router ospf 1
R3(config-router)#net 10.1.255.4 0.0.0.3 area 0
R3(config-router)#net 10.1.255.8 0.0.0.3 area 0
 
R4(config)#router ospf 1
R4(config-router)#net 10.1.255.8 0.0.0.3 area 0
R4(config-router)#net 10.1.255.12 0.0.0.3 area 0
 
 
4、在配置完之后,发现对所有的路由器并没有影响,只是启用了ospf区域的路由以o来显示,但都能学习到全网的路由:
 
R1#sh ip route
………………
 10.0.0.0/30 is subnetted, 4 subnets
B       10.1.255.4 [20/0] via 10.1.255.2, 00:00:34
C       10.1.255.0 is directly connected, Serial1/1
B       10.1.255.12 [20/0] via 10.1.255.2, 00:00:03
B       10.1.255.8 [20/0] via 10.1.255.2, 00:00:03
     130.130.0.0/24 is subnetted, 1 subnets
C       130.130.1.0 is directly connected, Loopback0
     150.150.0.0/24 is subnetted, 1 subnets
B       150.150.1.0 [20/0] via 10.1.255.2, 00:00:03
 
R2#sh ip route
………………
     10.0.0.0/30 is subnetted, 4 subnets
C       10.1.255.4 is directly connected, Serial1/1
C       10.1.255.0 is directly connected, Serial1/0
O       10.1.255.12 [110/192] via 10.1.255.6, 00:10:33, Serial1/1
O       10.1.255.8 [110/128] via 10.1.255.6, 00:10:33, Serial1/1
     130.130.0.0/24 is subnetted, 1 subnets
B       130.130.1.0 [20/0] via 10.1.255.1, 00:07:06
     150.150.0.0/24 is subnetted, 1 subnets
B       150.150.1.0 [200/0] via 10.1.255.14, 00:06:54
 
R3#sh ip route
………………
     10.0.0.0/30 is subnetted, 4 subnets
C       10.1.255.4 is directly connected, Serial1/0
O       10.1.255.0 [110/128] via 10.1.255.5, 00:11:10, Serial1/0
O       10.1.255.12 [110/128] via 10.1.255.10, 00:11:10, Serial1/1
C       10.1.255.8 is directly connected, Serial1/1
     130.130.0.0/24 is subnetted, 1 subnets
B       130.130.1.0 [200/0] via 10.1.255.1, 00:07:42
     150.150.0.0/24 is subnetted, 1 subnets
B       150.150.1.0 [200/0] via 10.1.255.14, 00:07:31
 
R4#sh ip route
………………
     10.0.0.0/30 is subnetted, 4 subnets
O       10.1.255.4 [110/128] via 10.1.255.9, 00:11:47, Serial1/0
O       10.1.255.0 [110/192] via 10.1.255.9, 00:11:47, Serial1/0
C       10.1.255.12 is directly connected, Serial1/1
C       10.1.255.8 is directly connected, Serial1/0
     130.130.0.0/24 is subnetted, 1 subnets
B       130.130.1.0 [200/0] via 10.1.255.1, 00:08:07
     150.150.0.0/24 is subnetted, 1 subnets
B       150.150.1.0 [20/0] via 10.1.255.14, 00:08:07
 
R5#sh ip route
………………
     10.0.0.0/30 is subnetted, 4 subnets
B       10.1.255.4 [20/0] via 10.1.255.13, 00:08:31
B       10.1.255.0 [20/0] via 10.1.255.13, 00:08:31
C       10.1.255.12 is directly connected, Serial1/0
B       10.1.255.8 [20/0] via 10.1.255.13, 00:08:00
     130.130.0.0/24 is subnetted, 1 subnets
B       130.130.1.0 [20/0] via 10.1.255.13, 00:08:31
     150.150.0.0/24 is subnetted, 1 subnets
C       150.150.1.0 is directly connected, Loopback0
 
 
5、那么在R1/R2/R3都开启同步,看一下对EBGP有什么影响:
 
R2(config)#router bgp 64513
R2(config-router)#syn
 
R3(config)#router bgp 64513
R3(config-router)#syn
 
R4(config)#router bgp 64513
R4(config-router)#syn
 
6、发现R1R2学不到150.150.1.0/24这条路由了:
 
R1#sh ip route
………………
     10.0.0.0/30 is subnetted, 4 subnets
B       10.1.255.4 [20/0] via 10.1.255.2, 00:08:49
C       10.1.255.0 is directly connected, Serial1/1
B       10.1.255.12 [20/0] via 10.1.255.2, 00:08:49
B       10.1.255.8 [20/0] via 10.1.255.2, 00:08:49
     130.130.0.0/24 is subnetted, 1 subnets
C       130.130.1.0 is directly connected, Loopback0
 
R2#sh ip route
………………
     10.0.0.0/30 is subnetted, 4 subnets
C       10.1.255.4 is directly connected, Serial1/1
C       10.1.255.0 is directly connected, Serial1/0
O       10.1.255.12 [110/192] via 10.1.255.6, 00:49:28, Serial1/1
O       10.1.255.8 [110/128] via 10.1.255.6, 00:49:28, Serial1/1
     130.130.0.0/24 is subnetted, 1 subnets
B       130.130.1.0 [20/0] via 10.1.255.1, 00:09:00
 
 
             (一篇发不了,请接着看下篇)
上一篇:mysql触发器学习


下一篇:Photoshop人物美化:调偏黄色皮肤