前期準備
- ESXi主機上創(chuàng)建虛擬機安裝EVE-NG
- EVE-NG上的虛機和連線描述如下:
- mgmt-net可以讓虛機之間互通蟀瞧,并可以訪問外網(wǎng)
- 創(chuàng)建多臺CentOS7.7的虛機昭躺,基于TF&k8s集成部署(deployer/master/node)
- master(contrail)的eth0的IP為192.168.122.177/24
- 創(chuàng)建vMX虛擬交換機(vmx14.1),ge-0/0/2的IP為192.168.122.102/24
- 從master可以ssh登錄虛擬交換機
- 到deployer上查看ansible部署contrail的配置文檔,查看BGP AS號(64512)
[root@deployer contrail-ansible-deployer]# cat contrail_configuration.md | grep BGP
BGP_PORT=${BGP_PORT:-179}
BGP_AUTO_MESH=${BGP_AUTO_MESH:-'true'}
BGP_ASN=${BGP_ASN:-64512}
[root@deployer contrail-ansible-deployer]#
- 確認master的BGP端口在監(jiān)聽
[root@master01 ~]# ss -apn | grep 179 | grep tcp
tcp LISTEN 0 128 192.168.122.177:179 *:* users:(("contrail-contro",pid=3192,fd=33))
[root@master01 ~]#
- 為了簡化配置商架,BGP就不設(shè)置認證了
驗證過程
vMX初始配置
- 因為要通過vMX的環(huán)回端口lo0和TF建立iBGP鄰居甸私,所以基礎(chǔ)配置如下
set interfaces ge-0/0/2 unit 0 family inet address 192.168.122.102/24
set interfaces lo0 unit 0 family inet address 1.1.1.1/32
set routing-options router-id 1.1.1.1
set routing-options autonomous-system 64512
set protocols bgp group tf-peer type internal
set protocols bgp group tf-peer local-address 1.1.1.1
set protocols bgp group tf-peer neighbor 192.168.122.177
master添加路由
- 為了從master可以到達1.1.1.1诚些,需要添加一條靜態(tài)路由
[root@master01 ~]# ip route add 1.1.1.1/32 via 192.168.122.102
[root@master01 ~]# ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=64 time=2.63 ms
^C
--- 1.1.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.637/2.637/2.637/0.000 ms
[root@master01 ~]#
TF添加BGP Router
- 起始TF&k8s部署完畢后砸烦,默認就會將TF本身添加為BGP Router
- 下面需要手動將vMX添加為新的BGP router
-
同頁面上家破,指定master作為peer
-
在TF的WebUI上门粪,可以看到master下新出現(xiàn)了新添加的vMX的信息
如果需要對新加的BGP Router表項進行修改,為了防止沒有更新成功拟蜻,建議采用“先刪后加”的方式酝锅,更加穩(wěn)妥
vMX的BGP配置
- 此時BGP鄰居并未建立
netops@vMX-1> show bgp neighbor
Peer: 192.168.122.177 AS 64512 Local: 1.1.1.1 AS 64512
Type: Internal State: Active Flags: <>
Last State: Idle Last Event: Start
Last Error: Open Message Error
Options: <Preference LocalAddress AddressFamily Rib-group Refresh>
Address families configured: inet-vpn-unicast route-target inet-mvpn evpn
Local Address: 1.1.1.1 Holdtime: 90 Preference: 170
Number of flaps: 3
Last flap event: RecvNotify
Error: 'Open Message Error' Sent: 1 Recv: 0
Error: 'Cease' Sent: 0 Recv: 12
netops@vMX-1>
-
抓取BGP的協(xié)議報文,發(fā)現(xiàn)是因為BGP notification報文中攜帶的capability不匹配導致無法建立
需要將vMX相關(guān)的address-family激活,新加配置
set protocols bgp group tf-peer family inet-vpn unicast
set protocols bgp group tf-peer family evpn signaling
set protocols bgp group tf-peer family inet-mvpn signaling
set protocols bgp group tf-peer family route-target
查看結(jié)果
- 在vMX上,BGP鄰居狀態(tài)已經(jīng)是Established,驗證成功
netops@vMX-1> show bgp neighbor
Peer: 192.168.122.177+32878 AS 64512 Local: 1.1.1.1+179 AS 64512
Type: Internal State: Established Flags: <Sync>
Last State: OpenConfirm Last Event: RecvKeepAlive
Last Error: Open Message Error
Options: <Preference LocalAddress AddressFamily Rib-group Refresh>
Address families configured: inet-vpn-unicast route-target inet-mvpn evpn
Local Address: 1.1.1.1 Holdtime: 90 Preference: 170
Number of flaps: 2
Last flap event: RecvNotify
Error: 'Open Message Error' Sent: 1 Recv: 0
Error: 'Cease' Sent: 0 Recv: 10
Peer ID: 192.168.122.177 Local ID: 1.1.1.1 Active Holdtime: 90
Keepalive Interval: 30 Group index: 0 Peer index: 0
BFD: disabled, down
NLRI for restart configured on peer: inet-vpn-unicast route-target inet-mvpn evpn
NLRI advertised by peer: inet-vpn-unicast inet6-vpn-unicast route-target evpn
NLRI for this session: inet-vpn-unicast route-target evpn
Peer does not support Refresh capability
Stale routes from peer are kept for: 300
Peer does not support Restarter functionality
NLRI that restart is negotiated for: inet-vpn-unicast route-target evpn
NLRI of received end-of-rib markers: inet-vpn-unicast route-target evpn
NLRI of all end-of-rib markers sent: inet-vpn-unicast route-target evpn
Peer does not support 4 byte AS extension
Peer does not support Addpath
Table bgp.rtarget.0 Bit: 20000
RIB State: BGP restart is complete
RIB State: VPN restart is complete
Send state: in sync
Active prefixes: 0
Received prefixes: 7
Accepted prefixes: 7
Suppressed due to damping: 0
Advertised prefixes: 0
Table bgp.evpn.0
RIB State: BGP restart is complete
RIB State: VPN restart is complete
Send state: not advertising
Active prefixes: 0
Received prefixes: 0
Accepted prefixes: 0
Suppressed due to damping: 0
Table bgp.l3vpn.0
RIB State: BGP restart is complete
RIB State: VPN restart is complete
Send state: not advertising
Active prefixes: 0
Received prefixes: 0
Accepted prefixes: 0
Suppressed due to damping: 0
Last traffic (seconds): Received 22 Sent 23 Checked 23
Input messages: Total 5 Updates 4 Refreshes 0 Octets 290
Output messages: Total 3 Updates 0 Refreshes 0 Octets 211
Output Queue[1]: 0
Output Queue[2]: 0
Output Queue[3]: 0
netops@vMX-1>