Cisco developer sandbox lab

Cisco sandbox

sandbox 提供給咱們一個免費的開發平臺,能夠基於該平臺作不少和思科網絡設備、軟件有關的代碼開發、腳本測試、自動化配置等工做:git

  • 學習研究網絡知識,提高本身
  • 學習研究思科設備、軟件提供的API接口
  • 全天候支持
  • 提供虛擬機、模擬器、以及真實網絡設備等選擇
  • 最重要的是,以上全免費

首次進入sandbox,連接爲:devnetsandbox.cisco.com/RM/Topology,登陸便可使用,支持不少種登陸方式:github

能夠經過github、facebook、cco等帳號登入
Sandbox 支持多種登陸方式

Sandbox提供2種模式的lab

截止至2018年末,sandbox提供了約68個labs,按運行申請模式不一樣分爲:編程

  • Regular 58個,須要預留單獨使用,個性化配置
  • Always_On 10個,共享模式,一直在線提供訪問,不容許修改配置

Always_On 特色

該類lab比較簡單,爲了解cisco sandbox提供一種快捷的實現方式:json

  • 不須要申請和預留,隨時可使用
  • 無需初始化配置
  • 共享訪問
  • API支持

若是須要個性化的設置和複雜的網絡拓撲結構,則須要申請使用regular sandbox。api

可編程的NX-OS lab

NX-OS Programmability是其中一個Always on sandbox,該lab提供nexus 3k/9K 的各類不一樣的設備訪問方式,實現:瀏覽器

  • 測試設備的可重複利用的、可編程的腳本自動化工具
  • 測試NXAPI接口,包括CLI、REST
  • 測試netconf
  • YANG model
  • restconf(草稿標準)

咱們能夠經過首頁找到該LAB,詳細的信息請訪問網頁。bash

簡單的訪問方法

因爲是共享lab,訪問方式比較簡單和固定:cookie

  • Nexus 9000v Host : sbx-nxos-mgmt.cisco.com
  • SSH Port: 8181
  • NETCONF Port: 10000
  • NXAPI Ports: 80 (http) & 443 (HTTPS)
  • RESTCONF Port : 443 (HTTPS)
  • Credentials(demo帳戶):
    • Username: admin
    • Password: Admin_1234!

若是須要嘗試一下經過nxapi訪問設備,能夠在瀏覽器中輸入地址:sbx-nxos-mgmt.cisco.com ,使用上述「demo帳戶」的用戶名和密碼登陸,便可以顯示Nexus 9K sandbox。網絡

如圖顯示命令"show interface brief"的輸出:ssh

經過NXAPI CLI訪問設備,並顯示命令show interface brief
經過NXAPI CLI訪問設備,並顯示命令:show interface brief

咱們也可使用ssh登陸設備

ssh admin@sbx-nxos-mgmt.cisco.com -p 8181
複製代碼

檢查剛剛經過nxapi訪問設備的細節:

2018 December 30 09:57:55.897 ngx_http_auth_pam_authenticate:381 pid:31473 PAM: client ip len:12
2018 December 30 09:57:55.897 ngx_http_auth_pam_authenticate:389 pid:31473 PAM: remote ip:10.79.98.239
2018 December 30 09:57:55.919 ngx_http_auth_pam_authenticate:414 pid:31473 PAM: Successfully authenticated user ' admin', remote ip:10.79.98.239
2018 December 30 09:57:55.919 ngx_http_cookie_set:651 pid:31473 creating cookie cleanup_cnt:0
2018 December 30 09:57:55.919 ngx_http_ins_api_post_body_handler:550 pid:12186 Input Message [
  {
    "jsonrpc": "2.0",
    "method": "cli",
    "params": {
      "cmd": "show interface brief",
      "version": 1
    },
    "id": 1
  }
]
2018 December 30 09:57:55.919 is_nxapi_jsonrpc_request:298 pid:12186 Found jsonrpc request
2018 December 30 09:57:55.919 nxapi_jsonrpc_input_handler:101 pid:12186 Parsing json rpc request
2018 December 30 09:57:55.919 nxapi_jsonrpc_parse_request:901 pid:12186 JSONRPC Batch request found, starting par
se.

2018 December 30 09:57:55.919 _parse_in_req_msg_jsonrpc_store_nxversion:75 pid:12186 Input request version: 0
2018 December 30 09:57:55.919 _parse_in_req_msg_jsonrpc_username:668 pid:12186 cookie had user ''
2018 December 30 09:57:55.920 _parse_in_req_msg_jsonrpc_username:682 pid:12186 auth header had user 'admin'
2018 December 30 09:57:55.920 nxapi_jsonrpc_input_handler:109 pid:12186 Running jsonrpc commands
2018 December 30 09:57:55.920 nxapi_jsonrpc_run_cmds:453 pid:12186 JSON-RPC method '0'
2018 December 30 09:57:55.920 pterm_idle_vsh_sweep:677 pid:12186 pterm_idle_vsh_sweep
2018 December 30 09:57:55.920 pterm_get_vsh:720 pid:12186 vsh found: child_pid = 12260, fprd = 0x817cfc0, fpwr = 
0x817d120, fd = 18, user = admin, vdc id = 1
2018 December 30 09:57:55.920 pterm_write_to_vsh:447 pid:12186 In vsh [18] Writing cmd "configure terminal"
2018 December 30 09:57:55.922 pterm_write_to_vsh:532 pid:12186 Cmd 'configure terminal' returned with '0'
2018 December 30 09:57:55.922 pterm_write_to_vsh:637 pid:12186 Done processing vsh output (ret=0)
2018 December 30 09:57:55.922 pterm_write_to_vsh:447 pid:12186 In vsh [18] Writing cmd "show interface brief | xm l "
2018 December 30 09:57:56.230 pterm_write_to_vsh:532 pid:12186 Cmd 'show interface brief | xml ' returned with '0 '
2018 December 30 09:57:56.230 pterm_write_to_vsh:637 pid:12186 Done processing vsh output (ret=0)
2018 December 30 09:57:56.230 _jsonrpc_store_vsh_cmd:129 pid:12186 output size 47188
2018 December 30 09:57:56.238 _jsonrpc_store_result_xml:61 pid:12186 Sanitizing output from vsh
2018 December 30 09:57:56.241 _jsonrpc_store_result_xml:82 pid:12186 valid xml, build json for:show interface bri
ef
2018 December 30 09:57:56.244 pterm_write_to_vsh:447 pid:12186 In vsh [18] Writing cmd "end"
2018 December 30 09:57:56.246 pterm_write_to_vsh:532 pid:12186 Cmd 'end' returned with '0'
2018 December 30 09:57:56.246 pterm_write_to_vsh:637 pid:12186 Done processing vsh output (ret=0)
2018 December 30 09:57:56.246 nxapi_jsonrpc_input_handler:113 pid:12186 Formatting jsonrpc output
2018 December 30 09:57:56.246 nxapi_jsonrpc_input_handler:117 pid:12186 gather jsonrpc response
2018 December 30 09:57:56.248 nxapi_jsonrpc_input_handler:123 pid:12186 jsonrpc output ret:0
2018 December 30 09:57:56.248 ngx_http_ins_api_post_body_handler:575 pid:12186 Done processing request
2018 December 30 09:57:56.248 ngx_http_ins_api_post_body_handler:608 pid:12186 sent header
2018 December 30 09:57:56.248 ngx_http_ins_api_post_body_handler:650 pid:12186 Allocate response buffer:32667
2018 December 30 09:57:56.248 ngx_http_ins_api_post_body_handler:680 pid:12186 Sending response len: 32667
2018 December 30 09:57:56.248 ngx_http_ins_api_post_body_handler:681 pid:12186 Sending response now {
        "jsonrpc":      "2.0",
        "result":       {
                "body": {
                        "TABLE_interface":      {
                                "ROW_interface":        [{
                                                "interface":    "mgmt0",
                                                "state":        "up",
                                                "ip_addr":      "10.10.20.95",
                                                "speed":        "1000",
                                                "mtu":  1500
                                        }, {
                                                "i sbx-n9kv-ao# 複製代碼

-END

相關文章
相關標籤/搜索