1. # Kubernetes CNI Calico GuideLine
  2. # 时间:20210813-[20:00-22:00]
  3. # 主题:Calico BGP RR
  4. # 文档:https://www.yuque.com/docs/share/19cd8bf3-6411-4ab9-82c9-46954f459964?# 《20210813-Calico BGP RR》
  5. # 作业:BGP RR企业实现方案
  1. # FAQ:
  2. [root@k8s-1 ~]# calicoctl node status
  3. Calico process is running.
  4. None of the BGP backend processes (BIRD or GoBGP) are running.
  5. # BIRD or GoBGP

BGP RR背景

image.png

  1. 由于水平分割的原理:防环
  2. 为了保证中转AS300内所有路由器都能学习到完整的BGP路由信息,我们不得不在该AS内的每一台路由器上运行BGP并且建立全互联的IBGP对等体关系。
  3. 为了防止AS内产生环路,BGP设备不将从IBGP对等体学到的路由通告给其他IBGP对等体,并与所有IBGP对等体建立全连接。
  4. # 所以上边的内容为:
  5. 由于IBGP水平分割的存在,为了保证所有的BGP路由器都能学习到完整的BGP路由,就必须在AS内实现IBGP全互联,这就导致AS内部需要维护大量的BGP连接,从而影响网络性能,路由反射器(Route Reflector,RR)可以“放宽”水平分割原则,解决该问题。
  6. 为保证IBGP对等体之间的连通性,需要在IBGP对等体之间建立全连接关系。假设在一个AS内部有n台设备,那么建立的IBGP连接数就为n(n-1)/2。当设备数目很多时,设备配置将十分复杂,而且配置后网络资源和CPU资源的消耗都很大。在IBGP对等体间使用路由反射器可以解决以上问题。

BGP RR基本概念

  1. 为保证IBGP对等体之间的连通性,需要在IBGP对等体之间建立全连接关系。假设在一个AS内部有n台设备,那么建立的IBGP连接数就为n(n-1)/2。当设备数目很多时,设备配置将十分复杂,而且配置后网络资源和CPU资源的消耗都很大。在IBGP对等体间使用路由反射器可以解决以上问题。

20210813-Calico BGP RR - 图2

  1. 路由反射器RR(Route Reflector):允许把从IBGP对等体学到的路由反射到其他IBGP对等体的BGP设备,类似OSPF网络中的DR。
  2. 客户机(Client):与RR形成反射邻居关系的IBGP设备。在AS内部客户机只需要与RR直连。
  3. 非客户机(Non-Client):既不是RR也不是客户机的IBGP设备。在AS内部非客户机与RR之间,以及所有的非客户机之间仍然必须建立全连接关系。
  4. 始发者(Originator):在AS内部始发路由的设备。Originator_ID属性用于防止集群内产生路由环路。
  5. 集群(Cluster):路由反射器及其客户机的集合。Cluster_List属性用于防止集群间产生路由环路。

路由学习原则

image.png
路由学习原则

  1. 对以上三张图的解说:
  2. #1.如果路由学习自非Client IBGP的对等体,则反射给所有Client。
  3. 理解:R2从R3学习到路由,由于水平分割的原理,所以它不会把路由通告给R5。
  4. #2.如果路由学习自Client,则反射给所有非Cilent的IBGP对等体,和除了自己以外的Client。
  5. # 正常路由学习
  6. #3.如果路由学习自EBGP对等体,则发送给所有的Client和非Client对等体
  7. # 正常路由学。BGP 的全连接,实现路由全部学习到。

Calico BGP RR Mode

  1. #1. 关闭Calico BGP Full Mesh
  2. [root@k8s-1 ~]# cat patch-bgp-rr.sh
  3. # if exist,use this:
  4. #calicoctl patch bgpconfiguration default -p '{"spec": {"nodeToNodeMeshEnabled": false}}'
  5. #if not exist,use below:
  6. cat << EOF | calicoctl create -f -
  7. apiVersion: projectcalico.org/v3
  8. kind: BGPConfiguration
  9. metadata:
  10. name: default
  11. spec:
  12. logSeverityScreen: Info
  13. nodeToNodeMeshEnabled: false
  14. asNumber: 64512
  15. EOF
  16. [root@k8s-1 ~]#
  17. #2.设置指定Node为RR,比如选择ks8-1为RR,"添加router-reflector标签,设置routeReflectorClusterID"。
  18. [root@k8s-1 ~]# cat 4-config-rr.yaml
  19. apiVersion: projectcalico.org/v3
  20. kind: Node
  21. metadata:
  22. creationTimestamp: null
  23. name: k8s-1
  24. labels:
  25. # 设置标签
  26. i-am-a-route-reflector: true
  27. spec:
  28. bgp:
  29. ipv4Address: 172.12.1.11/24
  30. # 设置集群ID
  31. routeReflectorClusterID: 224.0.0.1
  32. orchRefs:
  33. - nodeName: k8s-1
  34. orchestrator: k8s
  35. [root@k8s-1 ~]#
  36. #3. 配置BGPPeer资源,告诉Node节点路由反射器。
  37. [root@k8s-1 ~]# cat 3-rr-peer.sh
  38. cat << EOF | calicoctl create -f -
  39. kind: BGPPeer
  40. apiVersion: projectcalico.org/v3
  41. metadata:
  42. name: peer-to-rrs
  43. spec:
  44. # 规则1:普通 bgp node 与 rr 建立连接
  45. nodeSelector: !has(i-am-a-route-reflector)
  46. peerSelector: has(i-am-a-route-reflector)
  47. ---
  48. kind: BGPPeer
  49. apiVersion: projectcalico.org/v3
  50. metadata:
  51. name: rr-mesh
  52. spec:
  53. # 规则2:route reflectors 之间也建立连接
  54. nodeSelector: has(i-am-a-route-reflector)
  55. peerSelector: has(i-am-a-route-reflector)
  56. EOF
  57. [root@k8s-1 ~]#
  58. #4.查看BGP RR status:
  59. # RR 上查看:
  60. [root@k8s-1 ~]# calicoctl node status
  61. Calico process is running.
  62. IPv4 BGP status
  63. +--------------+---------------+-------+------------+-------------+
  64. | PEER ADDRESS | PEER TYPE | STATE | SINCE | INFO |
  65. +--------------+---------------+-------+------------+-------------+
  66. | 172.12.1.12 | node specific | up | 2021-08-09 | Established |
  67. +--------------+---------------+-------+------------+-------------+
  68. IPv6 BGP status
  69. No IPv6 peers found.
  70. [root@k8s-1 ~]#
  71. # BGP Client 查看:
  72. [root@k8s-2 ~]# calicoctl node status
  73. Calico process is running.
  74. IPv4 BGP status
  75. +--------------+-----------+-------+----------+-------------+
  76. | PEER ADDRESS | PEER TYPE | STATE | SINCE | INFO |
  77. +--------------+-----------+-------+----------+-------------+
  78. | 172.12.1.11 | global | up | 13:12:37 | Established |
  79. +--------------+-----------+-------+----------+-------------+
  80. IPv6 BGP status
  81. No IPv6 peers found.
  82. [root@k8s-2 ~]#
  83. # 测试环境Template:
  84. [root@k8s-1 ~]# cat cni_demo_template.yaml
  85. apiVersion: apps/v1
  86. kind: DaemonSet
  87. metadata:
  88. labels:
  89. app: cni
  90. name: cni
  91. spec:
  92. selector:
  93. matchLabels:
  94. app: cni
  95. template:
  96. metadata:
  97. labels:
  98. app: cni
  99. spec:
  100. containers:
  101. - image: burlyluo/nettoolbox
  102. name: nettoolbox
  103. [root@k8s-1 ~]#
  104. #env:
  105. # k8s-1-[BGP RR]
  106. [root@k8s-1 ~]# kubectl get pods -o wide
  107. NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
  108. cni-78pg6 1/1 Running 1 128d 10.244.231.194 k8s-1 <none> <none>
  109. cni-gjt72 1/1 Running 1 128d 10.244.200.200 k8s-2 <none> <none>
  110. # 路由表信息:
  111. [root@k8s-1 ~]# route -n
  112. Kernel IP routing table
  113. Destination Gateway Genmask Flags Metric Ref Use Iface
  114. 0.0.0.0 172.12.1.2 0.0.0.0 UG 100 0 0 ens33
  115. 10.244.200.192 172.12.1.12 255.255.255.192 UG 0 0 0 ens33
  116. 10.244.231.192 0.0.0.0 255.255.255.192 U 0 0 0 *
  117. 10.244.231.194 0.0.0.0 255.255.255.255 UH 0 0 0 calieb5ce3f8586
  118. 172.12.1.0 0.0.0.0 255.255.255.0 U 100 0 0 ens33
  119. 172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
  120. [root@k8s-1 ~]#
  121. # k8s-2-[BGP Client]
  122. [root@k8s-2 ~]# route -n
  123. Kernel IP routing table
  124. Destination Gateway Genmask Flags Metric Ref Use Iface
  125. 0.0.0.0 172.12.1.2 0.0.0.0 UG 100 0 0 ens33
  126. 10.244.200.192 0.0.0.0 255.255.255.192 U 0 0 0 *
  127. 10.244.200.197 0.0.0.0 255.255.255.255 UH 0 0 0 cali2e2bedebfa9
  128. 10.244.200.198 0.0.0.0 255.255.255.255 UH 0 0 0 cali6068269d8a9
  129. 10.244.200.199 0.0.0.0 255.255.255.255 UH 0 0 0 calib3f6025fba8
  130. 10.244.200.200 0.0.0.0 255.255.255.255 UH 0 0 0 calia83bc313c94
  131. 10.244.231.192 172.12.1.11 255.255.255.192 UG 0 0 0 ens33
  132. 172.12.1.0 0.0.0.0 255.255.255.0 U 100 0 0 ens33
  133. 172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
  134. [root@k8s-2 ~]#

Calico BGP RR路由器演示

image.png

  1. # 配置:
  2. ##########################################################################################################################################################
  3. <AR1>dis cu
  4. [V200R003C00]
  5. #
  6. sysname AR1
  7. #
  8. snmp-agent local-engineid 800007DB03000000000000
  9. snmp-agent
  10. #
  11. clock timezone China-Standard-Time minus 08:00:00
  12. #
  13. portal local-server load flash:/portalpage.zip
  14. #
  15. drop illegal-mac alarm
  16. #
  17. wlan ac-global carrier id other ac id 0
  18. #
  19. set cpu-usage threshold 80 restore 75
  20. #
  21. aaa
  22. authentication-scheme default
  23. authorization-scheme default
  24. accounting-scheme default
  25. domain default
  26. domain default_admin
  27. local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
  28. local-user admin service-type http
  29. #
  30. firewall zone Local
  31. priority 15
  32. #
  33. interface GigabitEthernet0/0/0
  34. ip address 10.1.12.1 255.255.255.0
  35. #
  36. interface GigabitEthernet0/0/1
  37. ip address 10.1.13.1 255.255.255.0
  38. #
  39. interface GigabitEthernet0/0/2
  40. #
  41. interface NULL0
  42. #
  43. interface LoopBack0
  44. ip address 1.1.1.1 255.255.255.255
  45. #
  46. bgp 123
  47. router-id 1.1.1.1
  48. peer 2.2.2.2 as-number 123
  49. peer 3.3.3.3 as-number 123
  50. #
  51. ipv4-family unicast
  52. undo synchronization
  53. peer 2.2.2.2 enable
  54. peer 2.2.2.2 reflect-client
  55. peer 3.3.3.3 enable
  56. peer 3.3.3.3 reflect-client
  57. #
  58. ospf 1 router-id 1.1.1.1
  59. area 0.0.0.0
  60. network 0.0.0.0 255.255.255.255
  61. #
  62. user-interface con 0
  63. authentication-mode password
  64. user-interface vty 0 4
  65. user-interface vty 16 20
  66. #
  67. wlan ac
  68. #
  69. return
  70. <AR1>
  71. <AR1>
  72. ##########################################################################################################################################################
  73. <AR2>dis cu
  74. [V200R003C00]
  75. #
  76. sysname AR2
  77. #
  78. snmp-agent local-engineid 800007DB03000000000000
  79. snmp-agent
  80. #
  81. clock timezone China-Standard-Time minus 08:00:00
  82. #
  83. portal local-server load flash:/portalpage.zip
  84. #
  85. drop illegal-mac alarm
  86. #
  87. wlan ac-global carrier id other ac id 0
  88. #
  89. set cpu-usage threshold 80 restore 75
  90. #
  91. aaa
  92. authentication-scheme default
  93. authorization-scheme default
  94. accounting-scheme default
  95. domain default
  96. domain default_admin
  97. local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
  98. local-user admin service-type http
  99. #
  100. firewall zone Local
  101. priority 15
  102. #
  103. interface GigabitEthernet0/0/0
  104. ip address 10.1.12.2 255.255.255.0
  105. #
  106. interface GigabitEthernet0/0/1
  107. #
  108. interface GigabitEthernet0/0/2
  109. #
  110. interface NULL0
  111. #
  112. interface LoopBack0
  113. ip address 2.2.2.2 255.255.255.255
  114. #
  115. bgp 123
  116. router-id 2.2.2.2
  117. peer 1.1.1.1 as-number 123
  118. peer 1.1.1.1 connect-interface LoopBack0
  119. #
  120. ipv4-family unicast
  121. undo synchronization
  122. peer 1.1.1.1 enable
  123. #
  124. ospf 1 router-id 2.2.2.2
  125. area 0.0.0.0
  126. network 0.0.0.0 255.255.255.255
  127. #
  128. user-interface con 0
  129. authentication-mode password
  130. user-interface vty 0 4
  131. user-interface vty 16 20
  132. #
  133. wlan ac
  134. #
  135. return
  136. ##########################################################################################################################################################
  137. <AR3>dis current-configuration
  138. [V200R003C00]
  139. #
  140. sysname AR3
  141. #
  142. snmp-agent local-engineid 800007DB03000000000000
  143. snmp-agent
  144. #
  145. clock timezone China-Standard-Time minus 08:00:00
  146. #
  147. portal local-server load flash:/portalpage.zip
  148. #
  149. drop illegal-mac alarm
  150. #
  151. wlan ac-global carrier id other ac id 0
  152. #
  153. set cpu-usage threshold 80 restore 75
  154. #
  155. aaa
  156. authentication-scheme default
  157. authorization-scheme default
  158. accounting-scheme default
  159. domain default
  160. domain default_admin
  161. local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
  162. local-user admin service-type http
  163. #
  164. firewall zone Local
  165. priority 15
  166. #
  167. interface GigabitEthernet0/0/0
  168. #
  169. interface GigabitEthernet0/0/1
  170. ip address 10.1.13.2 255.255.255.0
  171. #
  172. interface GigabitEthernet0/0/2
  173. #
  174. interface NULL0
  175. #
  176. interface LoopBack0
  177. ip address 3.3.3.3 255.255.255.255
  178. #
  179. interface LoopBack1
  180. ip address 33.33.33.33 255.255.255.255
  181. #
  182. interface LoopBack2
  183. ip address 44.44.44.44 255.255.255.0
  184. #
  185. bgp 123
  186. router-id 3.3.3.3
  187. peer 1.1.1.1 as-number 123
  188. peer 1.1.1.1 connect-interface LoopBack0
  189. #
  190. ipv4-family unicast
  191. undo synchronization
  192. network 33.33.33.33 255.255.255.255
  193. network 44.44.44.0 255.255.255.0
  194. peer 1.1.1.1 enable
  195. #
  196. ospf 1 router-id 3.3.3.3
  197. area 0.0.0.0
  198. network 0.0.0.0 255.255.255.255
  199. #
  200. user-interface con 0
  201. authentication-mode password
  202. user-interface vty 0 4
  203. user-interface vty 16 20
  204. #
  205. wlan ac
  206. #
  207. return
  208. ##########################################################################################################################################################
  209. <AR1>dis bgp peer
  210. BGP local router ID : 1.1.1.1
  211. Local AS number : 123
  212. Total number of peers : 2 Peers in established state : 2
  213. Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
  214. fRcv
  215. 2.2.2.2 4 123 30 32 0 00:28:17 Established
  216. 0
  217. 3.3.3.3 4 123 32 32 0 00:28:15 Established
  218. 2
  219. <AR1>dis bgp rou
  220. <AR1>dis bgp routing-table
  221. BGP Local router ID is 1.1.1.1
  222. Status codes: * - valid, > - best, d - damped,
  223. h - history, i - internal, s - suppressed, S - Stale
  224. Origin : i - IGP, e - EGP, ? - incomplete
  225. Total Number of Routes: 2
  226. Network NextHop MED LocPrf PrefVal Path/Ogn
  227. *>i 33.33.33.33/32 3.3.3.3 0 100 0 i
  228. *>i 44.44.44.0/24 3.3.3.3 0 100 0 i
  229. ##########################################################################################################################################################
  230. <AR2>dis bgp peer
  231. BGP local router ID : 2.2.2.2
  232. Local AS number : 123
  233. Total number of peers : 1 Peers in established state : 1
  234. Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
  235. fRcv
  236. 1.1.1.1 4 123 79 77 0 01:15:28 Established
  237. 2
  238. <AR2>dis bgp rou
  239. <AR2>dis bgp routing-table
  240. BGP Local router ID is 2.2.2.2
  241. Status codes: * - valid, > - best, d - damped,
  242. h - history, i - internal, s - suppressed, S - Stale
  243. Origin : i - IGP, e - EGP, ? - incomplete
  244. Total Number of Routes: 2
  245. Network NextHop MED LocPrf PrefVal Path/Ogn
  246. *>i 33.33.33.33/32 3.3.3.3 0 100 0 i
  247. *>i 44.44.44.0/24 3.3.3.3 0 100 0 i
  248. <AR2>
  249. ##########################################################################################################################################################
  250. <AR3>dis bgp peer
  251. BGP local router ID : 3.3.3.3
  252. Local AS number : 123
  253. Total number of peers : 1 Peers in established state : 1
  254. Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
  255. fRcv
  256. 1.1.1.1 4 123 80 80 0 01:16:03 Established
  257. 0
  258. <AR3>dis bgp rou
  259. <AR3>dis bgp routing-table
  260. BGP Local router ID is 3.3.3.3
  261. Status codes: * - valid, > - best, d - damped,
  262. h - history, i - internal, s - suppressed, S - Stale
  263. Origin : i - IGP, e - EGP, ? - incomplete
  264. Total Number of Routes: 2
  265. Network NextHop MED LocPrf PrefVal Path/Ogn
  266. *> 33.33.33.33/32 0.0.0.0 0 0 i
  267. *> 44.44.44.0/24 0.0.0.0 0 0 i

Calico BGP生产环境网络选型

20210813-Calico BGP RR - 图5Calico BGP RR.png

  1. # BGP RR:
  2. <AR1>dis cu
  3. <AR1>dis current-configuration
  4. [V200R003C00]
  5. #
  6. sysname AR1
  7. #
  8. snmp-agent local-engineid 800007DB03000000000000
  9. snmp-agent
  10. #
  11. clock timezone China-Standard-Time minus 08:00:00
  12. #
  13. portal local-server load flash:/portalpage.zip
  14. #
  15. drop illegal-mac alarm
  16. #
  17. wlan ac-global carrier id other ac id 0
  18. #
  19. set cpu-usage threshold 80 restore 75
  20. #
  21. aaa
  22. authentication-scheme default
  23. authorization-scheme default
  24. accounting-scheme default
  25. domain default
  26. domain default_admin
  27. local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
  28. local-user admin service-type http
  29. #
  30. firewall zone Local
  31. priority 15
  32. #
  33. interface GigabitEthernet0/0/0
  34. ip address 10.1.13.1 255.255.255.0
  35. #
  36. interface GigabitEthernet0/0/1
  37. ip address 10.1.14.1 255.255.255.0
  38. #
  39. interface GigabitEthernet0/0/2
  40. #
  41. interface NULL0
  42. #
  43. interface LoopBack0
  44. ip address 1.1.1.1 255.255.255.255
  45. #
  46. bgp 100
  47. router-id 1.1.1.1
  48. peer 10.1.13.3 as-number 356
  49. peer 10.1.14.4 as-number 478
  50. #
  51. ipv4-family unicast
  52. undo synchronization
  53. peer 10.1.13.3 enable
  54. peer 10.1.14.4 enable
  55. #
  56. user-interface con 0
  57. authentication-mode password
  58. user-interface vty 0 4
  59. user-interface vty 16 20
  60. #
  61. wlan ac
  62. #
  63. return
  64. <AR1>
  65. #######################################################################################################################
  66. <AR3>dis current-configuration
  67. [V200R003C00]
  68. #
  69. sysname AR3
  70. #
  71. board add 0/4 1GEC
  72. #
  73. snmp-agent local-engineid 800007DB03000000000000
  74. snmp-agent
  75. #
  76. clock timezone China-Standard-Time minus 08:00:00
  77. #
  78. portal local-server load flash:/portalpage.zip
  79. #
  80. drop illegal-mac alarm
  81. #
  82. wlan ac-global carrier id other ac id 0
  83. #
  84. set cpu-usage threshold 80 restore 75
  85. #
  86. aaa
  87. authentication-scheme default
  88. authorization-scheme default
  89. accounting-scheme default
  90. domain default
  91. domain default_admin
  92. local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
  93. local-user admin service-type http
  94. #
  95. firewall zone Local
  96. priority 15
  97. #
  98. interface GigabitEthernet0/0/0
  99. ip address 10.1.13.3 255.255.255.0
  100. #
  101. interface GigabitEthernet0/0/1
  102. ip address 10.1.23.3 255.255.255.0
  103. #
  104. interface GigabitEthernet0/0/2
  105. ip address 10.1.35.3 255.255.255.0
  106. #
  107. interface GigabitEthernet4/0/0
  108. ip address 10.1.36.3 255.255.255.0
  109. #
  110. interface NULL0
  111. #
  112. interface LoopBack0
  113. ip address 3.3.3.3 255.255.255.255
  114. #
  115. bgp 356
  116. router-id 3.3.3.3
  117. peer 5.5.5.5 as-number 356
  118. peer 5.5.5.5 connect-interface LoopBack0
  119. peer 6.6.6.6 as-number 356
  120. peer 6.6.6.6 connect-interface LoopBack0
  121. peer 10.1.13.1 as-number 100
  122. #
  123. ipv4-family unicast
  124. undo synchronization
  125. peer 5.5.5.5 enable
  126. peer 5.5.5.5 reflect-client
  127. peer 6.6.6.6 enable
  128. peer 6.6.6.6 reflect-client
  129. peer 10.1.13.1 enable
  130. #
  131. ospf 1 router-id 3.3.3.3
  132. area 0.0.0.0
  133. network 0.0.0.0 255.255.255.255
  134. #
  135. user-interface con 0
  136. authentication-mode password
  137. user-interface vty 0 4
  138. user-interface vty 16 20
  139. #
  140. wlan ac
  141. #
  142. return
  143. <AR3>
  144. #######################################################################################################################
  145. <AR4>dis current-configuration
  146. [V200R003C00]
  147. #
  148. sysname AR4
  149. #
  150. board add 0/4 1GEC
  151. #
  152. snmp-agent local-engineid 800007DB03000000000000
  153. snmp-agent
  154. #
  155. clock timezone China-Standard-Time minus 08:00:00
  156. #
  157. portal local-server load flash:/portalpage.zip
  158. #
  159. drop illegal-mac alarm
  160. #
  161. wlan ac-global carrier id other ac id 0
  162. #
  163. set cpu-usage threshold 80 restore 75
  164. #
  165. aaa
  166. authentication-scheme default
  167. authorization-scheme default
  168. accounting-scheme default
  169. domain default
  170. domain default_admin
  171. local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
  172. local-user admin service-type http
  173. #
  174. firewall zone Local
  175. priority 15
  176. #
  177. interface GigabitEthernet0/0/0
  178. ip address 10.1.14.4 255.255.255.0
  179. #
  180. interface GigabitEthernet0/0/1
  181. ip address 10.1.24.4 255.255.255.0
  182. #
  183. interface GigabitEthernet0/0/2
  184. ip address 10.1.47.4 255.255.255.0
  185. #
  186. interface GigabitEthernet4/0/0
  187. ip address 10.1.48.4 255.255.255.0
  188. #
  189. interface NULL0
  190. #
  191. interface LoopBack0
  192. ip address 4.4.4.4 255.255.255.255
  193. #
  194. interface LoopBack1
  195. #
  196. bgp 478
  197. peer 7.7.7.7 as-number 478
  198. peer 7.7.7.7 connect-interface LoopBack0
  199. peer 8.8.8.8 as-number 478
  200. peer 8.8.8.8 connect-interface LoopBack0
  201. peer 10.1.14.1 as-number 100
  202. #
  203. ipv4-family unicast
  204. undo synchronization
  205. peer 7.7.7.7 enable
  206. peer 7.7.7.7 reflect-client
  207. peer 8.8.8.8 enable
  208. peer 8.8.8.8 reflect-client
  209. peer 10.1.14.1 enable
  210. #
  211. ospf 1 router-id 4.4.4.4
  212. area 0.0.0.0
  213. network 0.0.0.0 255.255.255.255
  214. #
  215. user-interface con 0
  216. authentication-mode password
  217. user-interface vty 0 4
  218. user-interface vty 16 20
  219. #
  220. wlan ac
  221. #
  222. return
  223. <AR4>
  224. #######################################################################################################################
  225. <AR5>dis current-configuration
  226. [V200R003C00]
  227. #
  228. sysname AR5
  229. #
  230. snmp-agent local-engineid 800007DB03000000000000
  231. snmp-agent
  232. #
  233. clock timezone China-Standard-Time minus 08:00:00
  234. #
  235. portal local-server load flash:/portalpage.zip
  236. #
  237. drop illegal-mac alarm
  238. #
  239. wlan ac-global carrier id other ac id 0
  240. #
  241. set cpu-usage threshold 80 restore 75
  242. #
  243. aaa
  244. authentication-scheme default
  245. authorization-scheme default
  246. accounting-scheme default
  247. domain default
  248. domain default_admin
  249. local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
  250. local-user admin service-type http
  251. #
  252. firewall zone Local
  253. priority 15
  254. #
  255. interface GigabitEthernet0/0/0
  256. ip address 10.1.35.5 255.255.255.0
  257. #
  258. interface GigabitEthernet0/0/1
  259. #
  260. interface GigabitEthernet0/0/2
  261. #
  262. interface NULL0
  263. #
  264. interface LoopBack0
  265. ip address 5.5.5.5 255.255.255.255
  266. #
  267. bgp 356
  268. router-id 5.5.5.5
  269. peer 3.3.3.3 as-number 356
  270. peer 3.3.3.3 connect-interface LoopBack0
  271. #
  272. ipv4-family unicast
  273. undo synchronization
  274. peer 3.3.3.3 enable
  275. #
  276. ospf 1 router-id 5.5.5.5
  277. area 0.0.0.0
  278. network 0.0.0.0 255.255.255.255
  279. #
  280. user-interface con 0
  281. authentication-mode password
  282. user-interface vty 0 4
  283. user-interface vty 16 20
  284. #
  285. wlan ac
  286. #
  287. return
  288. <AR5>
  289. #######################################################################################################################
  290. <AR6>dis current-configuration
  291. [V200R003C00]
  292. #
  293. sysname AR6
  294. #
  295. snmp-agent local-engineid 800007DB03000000000000
  296. snmp-agent
  297. #
  298. clock timezone China-Standard-Time minus 08:00:00
  299. #
  300. portal local-server load flash:/portalpage.zip
  301. #
  302. drop illegal-mac alarm
  303. #
  304. wlan ac-global carrier id other ac id 0
  305. #
  306. set cpu-usage threshold 80 restore 75
  307. #
  308. aaa
  309. authentication-scheme default
  310. authorization-scheme default
  311. accounting-scheme default
  312. domain default
  313. domain default_admin
  314. local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
  315. local-user admin service-type http
  316. #
  317. firewall zone Local
  318. priority 15
  319. #
  320. interface GigabitEthernet0/0/0
  321. ip address 10.1.36.6 255.255.255.0
  322. #
  323. interface GigabitEthernet0/0/1
  324. #
  325. interface GigabitEthernet0/0/2
  326. #
  327. interface NULL0
  328. #
  329. interface LoopBack0
  330. ip address 6.6.6.6 255.255.255.255
  331. #
  332. interface LoopBack1
  333. ip address 66.66.66.66 255.255.255.255
  334. #
  335. bgp 356
  336. router-id 6.6.6.6
  337. peer 3.3.3.3 as-number 356
  338. peer 3.3.3.3 connect-interface LoopBack0
  339. #
  340. ipv4-family unicast
  341. undo synchronization
  342. network 66.66.66.66 255.255.255.255
  343. peer 3.3.3.3 enable
  344. #
  345. ospf 1 router-id 6.6.6.6
  346. area 0.0.0.0
  347. network 0.0.0.0 255.255.255.255
  348. #
  349. user-interface con 0
  350. authentication-mode password
  351. user-interface vty 0 4
  352. user-interface vty 16 20
  353. #
  354. wlan ac
  355. #
  356. return
  357. <AR6>
  358. #######################################################################################################################
  359. <AR7>dis current-configuration
  360. [V200R003C00]
  361. #
  362. sysname AR7
  363. #
  364. snmp-agent local-engineid 800007DB03000000000000
  365. snmp-agent
  366. #
  367. clock timezone China-Standard-Time minus 08:00:00
  368. #
  369. portal local-server load flash:/portalpage.zip
  370. #
  371. drop illegal-mac alarm
  372. #
  373. wlan ac-global carrier id other ac id 0
  374. #
  375. set cpu-usage threshold 80 restore 75
  376. #
  377. aaa
  378. authentication-scheme default
  379. authorization-scheme default
  380. accounting-scheme default
  381. domain default
  382. domain default_admin
  383. local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
  384. local-user admin service-type http
  385. #
  386. firewall zone Local
  387. priority 15
  388. #
  389. interface GigabitEthernet0/0/0
  390. ip address 10.1.47.7 255.255.255.0
  391. #
  392. interface GigabitEthernet0/0/1
  393. #
  394. interface GigabitEthernet0/0/2
  395. #
  396. interface NULL0
  397. #
  398. interface LoopBack0
  399. ip address 7.7.7.7 255.255.255.255
  400. #
  401. interface LoopBack1
  402. ip address 77.77.77.77 255.255.255.255
  403. #
  404. bgp 478
  405. router-id 7.7.7.7
  406. peer 4.4.4.4 as-number 478
  407. peer 4.4.4.4 connect-interface LoopBack0
  408. #
  409. ipv4-family unicast
  410. undo synchronization
  411. network 77.77.77.77 255.255.255.255
  412. peer 4.4.4.4 enable
  413. #
  414. ospf 1 router-id 7.7.7.7
  415. area 0.0.0.0
  416. network 0.0.0.0 255.255.255.255
  417. #
  418. user-interface con 0
  419. authentication-mode password
  420. user-interface vty 0 4
  421. user-interface vty 16 20
  422. #
  423. wlan ac
  424. #
  425. return
  426. <AR7>
  427. #######################################################################################################################
  428. ping 测试:
  429. #ping的时候需要加源地址来ping:
  430. <AR7>ping -a 77.77.77.77 66.66.66.66
  431. PING 66.66.66.66: 56 data bytes, press CTRL_C to break
  432. Reply from 66.66.66.66: bytes=56 Sequence=1 ttl=252 time=30 ms
  433. Reply from 66.66.66.66: bytes=56 Sequence=2 ttl=252 time=30 ms
  434. Reply from 66.66.66.66: bytes=56 Sequence=3 ttl=252 time=40 ms
  435. Reply from 66.66.66.66: bytes=56 Sequence=4 ttl=252 time=40 ms
  436. Reply from 66.66.66.66: bytes=56 Sequence=5 ttl=252 time=40 ms
  437. --- 66.66.66.66 ping statistics ---
  438. 5 packet(s) transmitted
  439. 5 packet(s) received
  440. 0.00% packet loss
  441. round-trip min/avg/max = 30/36/40 ms
  442. <AR7>