API issue: missing port in telnet console url
Posted: Mon Jan 03, 2022 3:53 pm
In the docs, if you call
curl -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' http://127.0.0.1/api/labs/User1/Lab%201.unl/nodes
You get info about all the nodes in the lab. Like this...
"data": {
"1": {
"console": "telnet",
"cpu": 1,
"delay": 0,
"ethernet": 4,
"icon": "Router.png",
"id": 1,
"image": "vios-adventerprisek9-m-15.4-1.3.0.181",
"left": 358,
"name": "R1",
"ram": 512,
"status": 0,
"template": "vios",
"top": 330,
"type": "qemu",
"url": "telnet://127.0.0.1:32769",
"uuid": "ab60e9de-2599-4b67-919a-b769fb6e270d"
},
Note the url for the console. You can telnet to port 32769. I am trying to do the same on my lab EVE-NG, I get the following...
"2": {
"config": "0",
"config_list": [],
"console": "telnet",
"cpu": 4,
"cpu_usage": "0",
"delay": 0,
"ethernet": 8,
"firstmac": "50:01:00:02:00:00",
"icon": "128Ticon-new.png",
"id": 2,
"image": "128T-517",
"left": 333,
"name": "Seattle",
"ram": 8192,
"ram_usage": "0",
"sat": 0,
"status": 0,
"template": "128T",
"top": 249,
"type": "qemu",
"url": "telnet://10.192.16.254:0",
"uuid": "faec3668-d0f3-4859-95fe-699ece75c62b"
},
Note how the port is '0'. This looks to me like a bug in the API code. I am running 4.0.1-65 Pro.
Any suggestions? Thanks!
curl -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' http://127.0.0.1/api/labs/User1/Lab%201.unl/nodes
You get info about all the nodes in the lab. Like this...
"data": {
"1": {
"console": "telnet",
"cpu": 1,
"delay": 0,
"ethernet": 4,
"icon": "Router.png",
"id": 1,
"image": "vios-adventerprisek9-m-15.4-1.3.0.181",
"left": 358,
"name": "R1",
"ram": 512,
"status": 0,
"template": "vios",
"top": 330,
"type": "qemu",
"url": "telnet://127.0.0.1:32769",
"uuid": "ab60e9de-2599-4b67-919a-b769fb6e270d"
},
Note the url for the console. You can telnet to port 32769. I am trying to do the same on my lab EVE-NG, I get the following...
"2": {
"config": "0",
"config_list": [],
"console": "telnet",
"cpu": 4,
"cpu_usage": "0",
"delay": 0,
"ethernet": 8,
"firstmac": "50:01:00:02:00:00",
"icon": "128Ticon-new.png",
"id": 2,
"image": "128T-517",
"left": 333,
"name": "Seattle",
"ram": 8192,
"ram_usage": "0",
"sat": 0,
"status": 0,
"template": "128T",
"top": 249,
"type": "qemu",
"url": "telnet://10.192.16.254:0",
"uuid": "faec3668-d0f3-4859-95fe-699ece75c62b"
},
Note how the port is '0'. This looks to me like a bug in the API code. I am running 4.0.1-65 Pro.
Any suggestions? Thanks!