BGP反射器实验
一、实验拓扑
二、实验步骤
R2 network 10.0.1.16与不network
R3 network 10.0.1.20 与不network
R1>sys
System View: return to User View with Ctrl+Z.
[R1]bgp 65002
[R1-bgp]peer 4.4.4.4 as-num 65002
[R1-bgp]peer 4.4.4.4 next-hop-local
[R1-bgp]peer 4.4.4.4 conn
[R1-bgp]peer 4.4.4.4 connect-interface lo
[R1-bgp]peer 4.4.4.4 connect-interface LoopBack0
[R1-bgp]group rr internal
[R1-bgp]peer rr net
[R1-bgp]peer rr next-hop-local
[R1-bgp]peer rr reflect-client
[R1-bgp]peer rr con
[R1-bgp]peer rr connect-interface lo0
[R1-bgp]peer 2.2.2.2 group rr
[R1-bgp]peer 3.3.3.3 group rr
[R1-bgp]
%Aug 29 16:20:17:63 2012 R1 RM/3/RMLOG:
BGP.: 2.2.2.2 State is changed from OPENCONFIRM to ESTABLISHED.
%Aug 29 16:21:30:313 2012 R1 RM/3/RMLOG:
BGP.: 3.3.3.3 State is changed from OPENCONFIRM to ESTABLISHED.
%Aug 29 16:23:25:828 2012 R1 RM/3/RMLOG:
BGP.: 4.4.4.4 State is changed from OPENCONFIRM to ESTABLISHED.
[R1-bgp]
[R1-bgp]
[R1-bgp]re
[R1-bgp]ref
[R1-bgp]reflector cluster-id mm
^
% Wrong parameter found at '^' position.
[R1-bgp]reflector cluster-id ?
INTEGER<1-4294967295> Configure cluster-id as a decimal value
X.X.X.X Configure cluster-id in IPV4 address format
[R1-bgp]reflector cluster-id 1
[R4]bgp 65002
[R4-bgp]peer 1.1.1.1 as-num 65002
[R4-bgp]peer 1.1.1.1 next-hop-local
[R4-bgp]peer 1.1.1.1 connect-int lo0
[R4-bgp]group nn internal
[R4-bgp]group nn next-hop-local
%Aug 29 16:22:48:172 2012 R4 RM/3/RMLOG:
BGP.: 1.1.1.1 State is changed from OPENCONFIRM to ESTABLISHED.
^
% Too many parameters found at '^' position.
[R4-bgp]group nn next-hop-local
^
% Too many parameters found at '^' position.
[R4-bgp]peer rr next-hop-local
No such peer-group
[R4-bgp]peer nn next-hop-local
[R4-bgp]peer nn reflect-client
[R4-bgp]peer nn connect-int lo0
[R4-bgp]peer 2.2.2.2 group nn
[R4-bgp]peer 3.3.3.3 group nn
[R4-bgp]
%Aug 29 16:24:55:172 2012 R4 RM/3/RMLOG:
BGP.: 2.2.2.2 State is changed from OPENCONFIRM to ESTABLISHED.
%Aug 29 16:25:04:172 2012 R4 RM/3/RMLOG:
BGP.: 3.3.3.3 State is changed from OPENCONFIRM to ESTABLISHED.
[R4-bgp]
[R4-bgp]
[R4-bgp]refle cluster-id 1
[R2]bgp 65002
[R2-bgp]peer 1.1.1.1 as-num 65002
[R2-bgp]peer 1.1.1.1 connect-int lo0
[R2-bgp]peer 4.4.4.4 as-num 65002
[R2-bgp]peer 4.4.4.4 conn
%Aug 29 16:19:42:906 2012 R2 RM/3/RMLOG:
BGP.: 1.1.1.1 State is changed from OPENCONFIRM to ESTABLISHED.
ect-int lo0
[R2-bgp]
[R3]bgp 65002
[R3-bgp]peer 1.1.1.1 as-num 65002
[R3-bgp]peer 1.1.1.1 connect-int lo0
[R3-bgp]peer 4.4.4.4 as-num 65002
[R3-bgp]peer 4.4.4.
%Aug 29 16:21:31:110 2012 R3 RM/3/RMLOG:
BGP.: 1.1.1.1 State is changed from OPENCONFIRM to ESTABLISHED.
4 connect-int lo0
[R2]bgp 65002
[R2-bgp]peer 10.0.1.18 as-num 65001
[R3]bgp 65002
[R3-bgp]peer 10.0.1.22 as-num 65003
[R3-bgp]
[R5]bgp 65001
[R5-bgp]peer 10.0.1.17 as-num 65002
[R5-bgp]net 5.5.5.5 32
[R5-bgp]net 10.10.5.1 32
[R5-bgp]net 10.0.1.16 30
[R5-bgp]
[R6]bgp 65003
[R6-bgp]peer 10.0.1.21 as-num 65002
[R6-bgp]net 6.6.6.6 32
[R6-bgp]net 10.10.6.1 32
[R6-bgp]net 10.0.1.20 30
[R6-bgp]
[R2]ip rout 10.10.0.0 16 null0 (下一跳是自己)
[R2]bgp 65002
[R2-bgp]net 10.10.0.0 16 (配了R2,R3需要配吗)
Routing Tables: Public
Destinations : 9 Routes : 9
Destination/Mask Proto Pre Cost NextHop Interface
5.5.5.5/32 Direct 0 0 127.0.0.1 InLoop0
6.6.6.6/32 BGP 255 0 10.0.1.17 Eth0/1/0
10.0.1.16/30 Direct 0 0 10.0.1.18 Eth0/1/0
10.0.1.18/32 Direct 0 0 127.0.0.1 InLoop0
10.10.0.0/16 BGP 255 0 10.0.1.17 Eth0/1/0
10.10.5.1/32 Direct 0 0 127.0.0.1 InLoop0
10.10.6.1/32 BGP 255 0 10.0.1.17 Eth0/1/0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
Routing Tables: Public
Destinations : 9 Routes : 9
Destination/Mask Proto Pre Cost NextHop Interface
5.5.5.5/32 BGP 255 0 10.0.1.21 Eth0/1/1
6.6.6.6/32 Direct 0 0 127.0.0.1 InLoop0
10.0.1.20/30 Direct 0 0 10.0.1.22 Eth0/1/1
10.0.1.22/32 Direct 0 0 127.0.0.1 InLoop0
10.10.0.0/16 BGP 255 0 10.0.1.21 Eth0/1/1
10.10.5.1/32 BGP 255 0 10.0.1.21 Eth0/1/1
10.10.6.1/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
[R2]dis ip rout
Routing Tables: Public
Destinations : 20 Routes : 20
Destination/Mask Proto Pre Cost NextHop Interface
1.1.1.1/32 OSPF 10 10 10.0.1.5 Eth0/1/0
2.2.2.2/32 Direct 0 0 127.0.0.1 InLoop0
3.3.3.3/32 OSPF 10 30 10.0.1.5 Eth0/1/0
4.4.4.4/32 OSPF 10 20 10.0.1.5 Eth0/1/0
5.5.5.5/32 BGP 255 0 10.0.1.18 Eth0/1/2
6.6.6.6/32 BGP 255 0 10.0.1.22 Eth0/1/0
10.0.1.0/30 OSPF 10 20 10.0.1.5 Eth0/1/0
10.0.1.4/30 Direct 0 0 10.0.1.6 Eth0/1/0
10.0.1.6/32 Direct 0 0 127.0.0.1 InLoop0
10.0.1.8/30 OSPF 10 30 10.0.1.5 Eth0/1/0
10.0.1.16/30 Direct 0 0 10.0.1.17 Eth0/1/2
10.0.1.17/32 Direct 0 0 127.0.0.1 InLoop0
10.0.1.20/30 OSPF 10 40 10.0.1.5 Eth0/1/0
10.10.0.0/16 Static 60 0 0.0.0.0 NULL0
10.10.1.1/32 OSPF 10 10 10.0.1.5 Eth0/1/0
10.10.2.1/32 OSPF 10 20 10.0.1.5 Eth0/1/0
10.10.5.1/32 BGP 255 0 10.0.1.18 Eth0/1/2
10.10.6.1/32 BGP 255 0 10.0.1.22 Eth0/1/0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
前提:R3上没有使用静态注入的方式发布AS65002业务网段(Loop1)的聚合路由
[R6]trace -a 6.6.6.6 10.10.1.1
traceroute to 10.10.1.1(10.10.1.1) 30 hops max,40 bytes packet, press CTRL_C to break
1 10.0.1.21 15 ms 20 ms 10 ms
2 10.0.1.9 30 ms 20 ms 10 ms
3 10.10.1.1 40 ms 10 ms 20 ms
分析路由表
Routing Tables: Public
Destinations : 9 Routes : 9
Destination/Mask Proto Pre Cost NextHop Interface
5.5.5.5/32 BGP 255 0 10.0.1.21 Eth0/1/1
6.6.6.6/32 Direct 0 0 127.0.0.1 InLoop0
10.0.1.20/30 Direct 0 0 10.0.1.22 Eth0/1/1
10.0.1.22/32 Direct 0 0 127.0.0.1 InLoop0
10.10.0.0/16 BGP 255 0 10.0.1.21 Eth0/1/1
10.10.5.1/32 BGP 255 0 10.0.1.21 Eth0/1/1
10.10.6.1/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
Routing Tables: Public
Destinations : 20 Routes : 20
Destination/Mask Proto Pre Cost NextHop Interface
1.1.1.1/32 OSPF 10 20 10.0.1.9 Eth0/1/3
2.2.2.2/32 OSPF 10 30 10.0.1.9 Eth0/1/3 (递归到1.9转发)
3.3.3.3/32 Direct 0 0 127.0.0.1 InLoop0
4.4.4.4/32 OSPF 10 10 10.0.1.9 Eth0/1/3
5.5.5.5/32 BGP 255 0 10.0.1.18 Eth0/1/3
6.6.6.6/32 BGP 255 0 10.0.1.22 Eth0/1/1
10.0.1.0/30 OSPF 10 20 10.0.1.9 Eth0/1/3
10.0.1.4/30 OSPF 10 30 10.0.1.9 Eth0/1/3
10.0.1.8/30 Direct 0 0 10.0.1.10 Eth0/1/3
10.0.1.10/32 Direct 0 0 127.0.0.1 InLoop0
10.0.1.16/30 OSPF 10 40 10.0.1.9 Eth0/1/3
10.0.1.20/30 Direct 0 0 10.0.1.21 Eth0/1/1
10.0.1.21/32 Direct 0 0 127.0.0.1 InLoop0
10.10.0.0/16 BGP 255 0 2.2.2.2 Eth0/1/3
10.10.1.1/32 OSPF 10 20 10.0.1.9 Eth0/1/3
10.10.2.1/32 OSPF 10 10 10.0.1.9 Eth0/1/3
10.10.5.1/32 BGP 255 0 10.0.1.18 Eth0/1/3
10.10.6.1/32 BGP 255 0 10.0.1.22 Eth0/1/1
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
Routing Tables: Public
Destinations : 20 Routes : 20
Destination/Mask Proto Pre Cost NextHop Interface
1.1.1.1/32 OSPF 10 10 10.0.1.1 Eth0/1/0
2.2.2.2/32 OSPF 10 20 10.0.1.1 Eth0/1/0
3.3.3.3/32 OSPF 10 10 10.0.1.10 Eth0/1/1
4.4.4.4/32 Direct 0 0 127.0.0.1 InLoop0
5.5.5.5/32 BGP 255 0 10.0.1.18 Eth0/1/0
6.6.6.6/32 BGP 255 0 10.0.1.22 Eth0/1/1
10.0.1.0/30 Direct 0 0 10.0.1.2 Eth0/1/0
10.0.1.2/32 Direct 0 0 127.0.0.1 InLoop0
10.0.1.4/30 OSPF 10 20 10.0.1.1 Eth0/1/0
10.0.1.8/30 Direct 0 0 10.0.1.9 Eth0/1/1
10.0.1.9/32 Direct 0 0 127.0.0.1 InLoop0
10.0.1.16/30 OSPF 10 30 10.0.1.1 Eth0/1/0
10.0.1.20/30 OSPF 10 20 10.0.1.10 Eth0/1/1
10.10.0.0/16 BGP 255 0 2.2.2.2 Eth0/1/0
10.10.1.1/32 OSPF 10 10 10.0.1.1 Eth0/1/0
10.10.2.1/32 Direct 0 0 127.0.0.1 InLoop0
10.10.5.1/32 BGP 255 0 10.0.1.18 Eth0/1/0
10.10.6.1/32 BGP 255 0 10.0.1.22 Eth0/1/1
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
Routing Tables: Public
Destinations : 20 Routes : 20
Destination/Mask Proto Pre Cost NextHop Interface
1.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
2.2.2.2/32 OSPF 10 10 10.0.1.6 Eth0/1/0
3.3.3.3/32 OSPF 10 20 10.0.1.2 Eth0/1/2
4.4.4.4/32 OSPF 10 10 10.0.1.2 Eth0/1/2
5.5.5.5/32 BGP 255 0 10.0.1.18 Eth0/1/0
6.6.6.6/32 BGP 255 0 10.0.1.22 Eth0/1/2
10.0.1.0/30 Direct 0 0 10.0.1.1 Eth0/1/2
10.0.1.1/32 Direct 0 0 127.0.0.1 InLoop0
10.0.1.4/30 Direct 0 0 10.0.1.5 Eth0/1/0
10.0.1.5/32 Direct 0 0 127.0.0.1 InLoop0
10.0.1.8/30 OSPF 10 20 10.0.1.2 Eth0/1/2
10.0.1.16/30 OSPF 10 20 10.0.1.6 Eth0/1/0
10.0.1.20/30 OSPF 10 30 10.0.1.2 Eth0/1/2
10.10.0.0/16 BGP 255 0 2.2.2.2 Eth0/1/0
10.10.1.1/32 Direct 0 0 127.0.0.1 InLoop0 (到达目的)
10.10.2.1/32 OSPF 10 10 10.0.1.2 Eth0/1/2
10.10.5.1/32 BGP 255 0 10.0.1.18 Eth0/1/0
10.10.6.1/32 BGP 255 0 10.0.1.22 Eth0/1/2
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
R3上使用了静态注入的方式发布AS65002业务网段(Loop1)的聚合路由
[R6]trace -a 6.6.6.6 10.10.1.1
traceroute to 10.10.1.1(10.10.1.1) 30 hops max,40 bytes packet, press CTRL_C to break
1 10.0.1.21 10 ms 20 ms <1 ms
2 10.0.1.9 10 ms <1 ms 20 ms
3 10.10.1.1 10 ms 20 ms <1 ms
区别: R3上路由不同
[R3]dis ip rout
Routing Tables: Public
Destinations : 20 Routes : 20
Destination/Mask Proto Pre Cost NextHop Interface
1.1.1.1/32 OSPF 10 20 10.0.1.9 Eth0/1/3
2.2.2.2/32 OSPF 10 30 10.0.1.9 Eth0/1/3
3.3.3.3/32 Direct 0 0 127.0.0.1 InLoop0
4.4.4.4/32 OSPF 10 10 10.0.1.9 Eth0/1/3
5.5.5.5/32 BGP 255 0 10.0.1.18 Eth0/1/3
6.6.6.6/32 BGP 255 0 10.0.1.22 Eth0/1/1
10.0.1.0/30 OSPF 10 20 10.0.1.9 Eth0/1/3
10.0.1.4/30 OSPF 10 30 10.0.1.9 Eth0/1/3
10.0.1.8/30 Direct 0 0 10.0.1.10 Eth0/1/3
10.0.1.10/32 Direct 0 0 127.0.0.1 InLoop0
10.0.1.16/30 OSPF 10 40 10.0.1.9 Eth0/1/3
10.0.1.20/30 Direct 0 0 10.0.1.21 Eth0/1/1
10.0.1.21/32 Direct 0 0 127.0.0.1 InLoop0
10.10.0.0/16 Static 60 0 0.0.0.0 NULL0
10.10.1.1/32 OSPF 10 20 10.0.1.9 Eth0/1/3
10.10.2.1/32 OSPF 10 10 10.0.1.9 Eth0/1/3
10.10.5.1/32 BGP 255 0 10.0.1.18 Eth0/1/3
10.10.6.1/32 BGP 255 0 10.0.1.22 Eth0/1/1
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
另外:
Routing Tables: Public
Destinations : 20 Routes : 20
Destination/Mask Proto Pre Cost NextHop Interface
1.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
2.2.2.2/32 OSPF 10 10 10.0.1.6 Eth0/1/0
3.3.3.3/32 OSPF 10 20 10.0.1.2 Eth0/1/2
4.4.4.4/32 OSPF 10 10 10.0.1.2 Eth0/1/2
5.5.5.5/32 BGP 255 0 10.0.1.18 Eth0/1/0
6.6.6.6/32 BGP 255 0 10.0.1.22 Eth0/1/2
10.0.1.0/30 Direct 0 0 10.0.1.1 Eth0/1/2
10.0.1.1/32 Direct 0 0 127.0.0.1 InLoop0
10.0.1.4/30 Direct 0 0 10.0.1.5 Eth0/1/0
10.0.1.5/32 Direct 0 0 127.0.0.1 InLoop0
10.0.1.8/30 OSPF 10 20 10.0.1.2 Eth0/1/2
10.0.1.16/30 OSPF 10 20 10.0.1.6 Eth0/1/0
10.0.1.20/30 OSPF 10 30 10.0.1.2 Eth0/1/2
10.10.0.0/16 BGP 255 0 2.2.2.2 Eth0/1/0
10.10.1.1/32 Direct 0 0 127.0.0.1 InLoop0
10.10.2.1/32 OSPF 10 10 10.0.1.2 Eth0/1/2
10.10.5.1/32 BGP 255 0 10.0.1.18 Eth0/1/0
10.10.6.1/32 BGP 255 0 10.0.1.22 Eth0/1/2
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
Routing Tables: Public
Destinations : 20 Routes : 20
Destination/Mask Proto Pre Cost NextHop Interface
1.1.1.1/32 OSPF 10 10 10.0.1.1 Eth0/1/0
2.2.2.2/32 OSPF 10 20 10.0.1.1 Eth0/1/0
3.3.3.3/32 OSPF 10 10 10.0.1.10 Eth0/1/1
4.4.4.4/32 Direct 0 0 127.0.0.1 InLoop0
5.5.5.5/32 BGP 255 0 10.0.1.18 Eth0/1/0
6.6.6.6/32 BGP 255 0 10.0.1.22 Eth0/1/1
10.0.1.0/30 Direct 0 0 10.0.1.2 Eth0/1/0
10.0.1.2/32 Direct 0 0 127.0.0.1 InLoop0
10.0.1.4/30 OSPF 10 20 10.0.1.1 Eth0/1/0
10.0.1.8/30 Direct 0 0 10.0.1.9 Eth0/1/1
10.0.1.9/32 Direct 0 0 127.0.0.1 InLoop0
10.0.1.16/30 OSPF 10 30 10.0.1.1 Eth0/1/0
10.0.1.20/30 OSPF 10 20 10.0.1.10 Eth0/1/1
10.10.0.0/16 BGP 255 0 3.3.3.3 Eth0/1/1
10.10.1.1/32 OSPF 10 10 10.0.1.1 Eth0/1/0
10.10.2.1/32 Direct 0 0 127.0.0.1 InLoop0
10.10.5.1/32 BGP 255 0 10.0.1.18 Eth0/1/0
10.10.6.1/32 BGP 255 0 10.0.1.22 Eth0/1/1
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
根据开销选择的?
[R3]bgp 65002
[R3-bgp]undo net 10.10.0.0 16
[R3-bgp]qui
Routing Tables: Public
Destinations : 20 Routes : 20
Destination/Mask Proto Pre Cost NextHop Interface
1.1.1.1/32 OSPF 10 10 10.0.1.1 Eth0/1/0
2.2.2.2/32 OSPF 10 20 10.0.1.1 Eth0/1/0
3.3.3.3/32 OSPF 10 10 10.0.1.10 Eth0/1/1
4.4.4.4/32 Direct 0 0 127.0.0.1 InLoop0
5.5.5.5/32 BGP 255 0 10.0.1.18 Eth0/1/0
6.6.6.6/32 BGP 255 0 10.0.1.22 Eth0/1/1
10.0.1.0/30 Direct 0 0 10.0.1.2 Eth0/1/0
10.0.1.2/32 Direct 0 0 127.0.0.1 InLoop0
10.0.1.4/30 OSPF 10 20 10.0.1.1 Eth0/1/0
10.0.1.8/30 Direct 0 0 10.0.1.9 Eth0/1/1
10.0.1.9/32 Direct 0 0 127.0.0.1 InLoop0
10.0.1.16/30 OSPF 10 30 10.0.1.1 Eth0/1/0
10.0.1.20/30 OSPF 10 20 10.0.1.10 Eth0/1/1
10.10.0.0/16 BGP 255 0 2.2.2.2 Eth0/1/0
10.10.1.1/32 OSPF 10 10 10.0.1.1 Eth0/1/0
10.10.2.1/32 Direct 0 0 127.0.0.1 InLoop0
10.10.5.1/32 BGP 255 0 10.0.1.18 Eth0/1/0
10.10.6.1/32 BGP 255 0 10.0.1.22 Eth0/1/1
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
为什么开销是0?一个区域里!