Community discussions

MikroTik App
 
User avatar
az1984
newbie
Topic Author
Posts: 28
Joined: Thu Sep 14, 2017 3:58 pm
Location: Germany

No API connection

Wed Apr 25, 2018 11:44 pm

Hi,

I just got some problems using the API Interface of my RB2011UiAS.
I'am not able to connect via the API-port. The IP service is enabled and there are no firewall rules which would deny it. For testing I made a log-filter-rule which shows me, if there are any API-related packets. When I use Telnet to port 8728 I see two log entrys for the API but my putty-window closes immediately.

If I use the native Windows telnet client, the window stays open but I still got no connection.

I really don't know whats the matter. I also updated to new RouterOS 6.42.1 but nothing changed.

The log does'nt tell me anything about that (except the filter-log-rule).

Any ideas? Thanks
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: No API connection

Thu Apr 26, 2018 3:14 am

What makes you think that you can chat with API like this? It's not compatible with telnet, it uses own protocol. If you want to test whether the connection can be established or not, select "Raw" as connection type in PuTTY. Then the connection should stay open and you can type whatever you want, but you still won't get anything useful back.
 
User avatar
az1984
newbie
Topic Author
Posts: 28
Joined: Thu Sep 14, 2017 3:58 pm
Location: Germany

Re: No API connection

Thu Apr 26, 2018 8:21 am

I was pretty unsure about this, but I found the following link where somebody says it would work:

https://forum.splynx.com/t/mikrotik-api-error/449

Whatever....when I use the Raw connection in Putty I see API packets in torch but my "real" API connection does'nt work. I'am trying to use it with the C# implementation tik4net. It still says it could'nt connect. Is there any way to debug API on router-site? Just to go sure the router does'nt deny or block the connection?
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: No API connection

Thu Apr 26, 2018 9:00 pm

And what about your logging rule, does it see anything, when you try to connect from C#? If it's really trying to connect to router, you should see something logged, like you did with telnet. If not, then the client is doing something wrong and not connecting to router at all.
 
User avatar
az1984
newbie
Topic Author
Posts: 28
Joined: Thu Sep 14, 2017 3:58 pm
Location: Germany

Re: No API connection

Fri Apr 27, 2018 8:56 am

Got it working now. It was more a C# related problem than a router one.

Who is online

Users browsing this forum: jebz and 35 guests