Tungsten Fabric實戰:對接vMX虛擬路由平臺填坑
下面做的實驗就是基於[EVE-NG]()模擬平臺,在CentOS虛擬機器上做
Tungsten Fabric&k8s整合部署,然後啟動vMX來做對接。
(編者按:本文著眼於能夠對接並對vMX下發配置,如有疑問,歡迎加入社群與開源SDN愛好者們一起交流)
準備
後續對python檔案的修改,都需要進入device-manager這個docker進行修改。
修改前記得先備份,例如:
# cp juniper_conf.py juniper_conf.py_bak
[root@master01 ~] # docker restart 001caca78cde
001caca78cde
[root@master01 ~] # tailf /var/log/contrail/contrail-device-manager.log
如果要自己向py檔案中新增列印資訊,下面是個例子。
self._logger.warning(">> password is % s" % self.user_creds[password])
# cd /usr/lib/python2.7/site-packages/device_manager
# cp juniper_conf.py_bak juniper_conf.py
坑一:
描述: Tungsten Fabric5.1.0版本預設對接物理交換機的功能是關閉的。
解決方法:參考微信公眾號【TF中文社群】-- 「 Tungsten Fabric入門寶典系列文章 」 ,需要手動新增一項,建議接著刪除所有contrail相關的容器後重建。
坑二:
def device_connect( self):
if not self._nc_manager or not self.is_connected():
try:
self._nc_manager = manager.connect(host= self.management_ip, port= 22,
[edit]
netops@ vMX- 3# set system services netconf ssh port 22 ,才好對接
坑三:
04/ 19/ 2020 08: 00: 53 PM [contrail-device-manager] [ ERROR]: could not establish netconf session with router 192.168.122.103: AuthenticationException( 'Authentication failed.',)
def device_connect( self):
if not self._nc_manager or not self.is_connected():
self._logger.warning( ">>keys are %s" % self.user_creds.keys())
self._logger.warning( ">>type of password is %s" % type( self.user_creds[ 'password']))
self._logger.warning( ">>password is %s" % self.user_creds[ 'password'])
try:
self._nc_manager = manager.connect(host= self.management_ip, port= 22,
username= self.user_creds[ 'username'],
#password=self.user_creds['password'],
password= "Test123",
坑四:
netops@vMX-3> show version
Hostname: vMX-3
Model: olive
Junos: 18.2R2.6
因此報錯。
04/20/2020 09:02:06 PM [contrail-device-manager] [ERROR]: product model mismatch: device model = olive, plugin mode = [ 'mx', 'vmx']
def validate_device( self):
if not self. device_config:
self.device_config = self.device_get()
if not self. device_config:
self.device_config = {}
return False
#model = self.device_config.get('product-model')
model = 'mx'
坑五:
04/19/2020 09:25:38 PM [contrail-device-manager] [ERROR]: Router 192.168.122.103: error: as_number: 'b'64512'': Use format 'x' or 'x.y' to specify number 'x' ( Range 1 .. 4294967295) or number with higher 2 bytes 'x' ( Range 0 .. 65535) ay
error: syntax error, expecting <rpc> or </rpc>
將conf_str列印出來
self._logger.warning(">>config_str is %s" % config_str)。
解決方法:經過大神指點,將contrail-controller-config-devicemgr映象從1912-latest替換為1910-laset。
[root@deployer ~] # docker pull opencontrailnightly/contrail-controller-config-devicemgr:1910-latest
[root@deployer ~] # docker tag opencontrailnightly/contrail-controller-config-devicemgr:1910-latest 192.168.122.211/contrail-controller-config-devicemgr:1910-latest
[root@deployer ~] # docker push 192.168.122.211/contrail-controller-config-devicemgr:1910-latest
[root@deployer ~] #
[root@deployer ~] # curl -X GET http://localhost/v2/contrail-controller-config-devicemgr/tags/list --cacert /etc/docker/certs.d/dockershare:2333/ca.crt | python -m json.tool
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 85 100 85 0 0 1072 0 -- :--:-- -- :--:-- -- :--:-- 1089
{
"name": "contrail-controller-config-devicemgr",
"tags": [
"1912-latest",
"1910-latest"
]
}
[root@deployer ~] #
12345678910111213141516
[root@master01 ~] # ping hub.juniper.net
PING deployer ( 192.168.122.211) 56( 84) bytes of data.
64 bytes from deployer ( 192.168.122.211): icmp_seq= 1 ttl= 64 time= 1.47 ms
^C
--- deployer ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.472/ 1.472/ 1.472/ 0.000 ms
[root@master01 ~] #
[root@master01 ~] # docker pull hub.juniper.net/contrail-controller-config-devicemgr:1910-latest
[root@master01 ~] #
[root@master01 ~] # docker image list | grep devicemgr
hub.juniper.net/contrail-controller-config-devicemgr 1912-latest c08868a27a0a 5 months ago 772MB
hub.juniper.net/contrail-controller-config-devicemgr 1910-latest a1b3ab402efc 5 months ago 862MB
[root@master01 ~] #
1234567891011121314
devicemgr:
image: "hub.juniper.net/contrail-controller-config-devicemgr:1910-latest"
[root@master01 config] # docker-compose -f /etc/contrail/config/docker-compose.yaml down
/usr/ lib/python2 .7/site-packages/requests/__init__.py: 91: RequestsDependencyWarning: urllib3 ( 1.24.3) or chardet ( 2.2.1) doesn 't match a supported version!
RequestsDependencyWarning)
Stopping config_devicemgr_1 ... done
Stopping config_dnsmasq_1 ... done
Stopping config_nodemgr_1 ... done
Stopping config_schema_1 ... done
Stopping config_svcmonitor_1 ... done
Stopping config_stats_1 ... done
Stopping config_api_1 ... done
Removing config_devicemgr_1 ... done
Removing config_dnsmasq_1 ... done
Removing config_nodemgr_1 ... done
Removing config_schema_1 ... done
Removing config_svcmonitor_1 ... done
Removing config_stats_1 ... done
Removing config_api_1 ... done
Removing config_node-init_1 ... done
[root@master01 config] #
[root@master01 config] # docker-compose -f /etc/contrail/config/docker-compose.yaml up -d
/usr/ lib/python2 .7/site-packages/requests/__init__.py: 91: RequestsDependencyWarning: urllib3 ( 1.24.3) or chardet ( 2.2.1) doesn 't match a supported version!
RequestsDependencyWarning)
Creating config_node-init_1 ... done
Creating config_schema_1 ... done
Creating config_api_1 ... done
Creating config_svcmonitor_1 ... done
Creating config_nodemgr_1 ... done
Creating config_dnsmasq_1 ... done
Creating config_stats_1 ... done
Creating config_devicemgr_1 ... done
[root@master01 config] #
1234567891011121314151617181920212223242526272829303132
驗證
-
Physical Router已經新增(role為None)
-
新增BGP Router
-
檢視vMX上新增配置
netops@vMX-3> show configuration | compare rollback 2
[edit]
+ groups {
+ / * Contrail Generated Group Config */
+ __contrail__ {
+ routing-options {
+ / * Global Routing Options */
+ router-id 3.3.3.3;
+ route-distinguisher-id 3.3.3.3;
+ autonomous-system 64512;
+ dynamic-tunnels {
+ _contrail_asn-64512 {
+ source-address 3.3.3.3;
+ gre;
+ destination-networks {
+ / * IP Fabric Subnet */
+ 192.168.122.0/24;
+ / * BGP Router : MX3 */
+ 3.3.3.3/32;
+ / * BGP Router : master01.local */
+ 192.168.122.177/32;
+ }
+ }
+ }
+ }
+ protocols {
+ / * Protocols Configuration */
+ bgp {
+ / * overlay_bgp: BGP Router: MX3, UUID: 2cf712e4-a3f2-4978-82a3-88c993754202 */
+ group _contrail_asn-64512 {
+ type internal;
+ local-address 3.3.3.3;
+ hold-time 90;
+ family inet-vpn {
+ unicast;
+ }
+ family evpn {
+ signaling;
+ }
+ family route-target;
+ export _contrail_ibgp _export_policy;
+ / * overlay_bgp: BGP Router: master01.local, UUID: b04bc39c-57ea-4f0e-b04a-3d2737ce242f */
+ neighbor 192.168.122.177 {
+ peer-as 64512;
+ }
+ }
+ }
+ }
+ policy-options {
+ / * iBGP Export Policy */
+ policy-statement _contrail_ibgp _export_policy {
+ term inet-vpn {
+ from family inet-vpn;
+ then {
+ next-hop self;
+ }
+ }
+ }
+ }
+ }
+ }
+ apply-groups __contrail__;
netops@vMX-3>
本文為盛科網路劉敬一的原創文章。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69957171/viewspace-2693242/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- TF實戰丨使用Vagrant安裝Tungsten Fabric
- 虛擬化平臺效能對比(KVM & VMware)
- [iOS]貝聊 IAP 實戰之見坑填坑iOS
- 實操:KVM虛擬化管理平臺操作
- [貝聊科技]貝聊 IAP 實戰之見坑填坑
- KVM虛擬化平臺管理
- 部署KVM虛擬化平臺
- React Native填坑之旅--多平臺支援之WebReact NativeWeb
- 交易平臺與託管平臺業務對接小結
- Springboot+Neo4j+實戰&填坑Spring Boot
- KVM 虛擬化管理平臺 VManagePlatformPlatform
- 新一代虛擬駕駛模擬平臺
- Tungsten Fabric解決方案指南-Gateway MXGateway
- .NET 跨平臺框架Avalonia UI: 填坑指北(一):熟悉UI操作框架UI
- nginx虛擬主機實戰Nginx
- Linux虛擬化平臺檢測Linux
- [os]Intel VT-x硬體虛擬化(vmx和vmcs)(1)Intel
- 小程式填坑實錄
- 填坑Ⅱ
- 利用DDP技術提升Tungsten Fabric vRouter效能VR
- Flutter完整開發實戰詳解(八、 實用技巧與填坑)Flutter
- php對接電信平臺,對接lot裝置傳送or接收資料(一)PHP
- Nginx實戰(一) 虛擬主機Nginx
- vSphere虛擬化管理平臺的功能
- PVE虛擬機器遷移至VMware平臺虛擬機
- 各種支付平臺對接系統原始碼原始碼
- kubernetes實戰篇之helm填坑與基本命令
- Flutter完整開發實戰詳解(三、打包與填坑篇)Flutter
- VR戀人上線 打造虛擬現實全新社交平臺VR
- Tungsten Fabric架構解析丨TF如何編排架構
- Tungsten Fabric解決方案指南-Kubernetes整合
- Magic Image FPGA虛擬視訊源平臺(二)FPGA
- 雲管理平臺——虛擬化管理功能介紹
- VMware NSX 4.1.2.3 - 網路安全虛擬化平臺
- VMmark 4.0.1 - 虛擬化平臺基準測試
- streamparse 填坑
- [填坑手冊]小程式新版訂閱訊息+雲開發實戰與跳坑
- 數加平臺 Quick BI 填坑之地理位置資訊轉換問題UI