Giter VIP home page Giter VIP logo

Comments (11)

woudanator avatar woudanator commented on July 19, 2024 1

I

so you are dropping all invalid traffic that includes 8728 put the following right at top of the table to accept traffic from 8728

do the below rule to allow it and move it to top

/ip firewall filter add dst-port=8728 protocol=tcp action=accept comment="Allow API Through" chain=input

see if that helps you

from routeros-client.

woudanator avatar woudanator commented on July 19, 2024

why are you using HTTPS it won't work as its not a rest API
in your host, you must add in the IP of the router and if you using a custom API port
you must add in the port example below

This works over a VPN as well

const api = new RouterOSClient({ host: "192.168.1.66" user: "admin" password: "admin" port: 8728 })

from routeros-client.

khertg avatar khertg commented on July 19, 2024

@woudanator
I created a VPN in this site https://www.hostddns.us/.
Then setup a ovpn client following this guide https://docs.hostddns.us/docs/vpn-remote/tutorial-mikrotik-ovpn-client/

I can now access the router remotely,
however when I tried using my vpn url its not working ( base on what you've said ).

Recently I also tried using the IP address of my vpn.
The same thing happened, unable to connect.

RosException: Timed out after 10 seconds
    at Connector.onTimeout (E:\Projects\mikrotek-test\node_modules\node-routeros\dist\connector\Connector.js:188:30)
    at Object.onceWrapper (events.js:299:28)
    at Socket.emit (events.js:210:5)
    at Socket._onTimeout (net.js:469:8)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7) {
  name: 'RosException',
  errno: 'SOCKTMOUT',
  message: 'Timed out after 10 seconds'
}

from routeros-client.

khertg avatar khertg commented on July 19, 2024

@woudanator
Here's what I'm trying to do.

Normally you can connect using routeros-client if you are connected locally in the mikrotik router ( LAN ).

What I'm trying to setup is to establish a connection remotely ( WAN )

from routeros-client.

woudanator avatar woudanator commented on July 19, 2024

have you established that the port is not blocked on the WAN as it might not allow you in via the VPN address due to firewall rules?

make sure you allow traffic to TCP port 8728

maybe try to use NMAP to see if the router allows you in

if you have a dynamic IP you would need to implement a resolver in nodejs to resolve the DNS name to an IP before connecting as far as i am aware routeros-client does not have this built-in but I might be wrong
`

from routeros-client.

woudanator avatar woudanator commented on July 19, 2024

Had a quick look at the DNS service you using and you need to forward traffic from port 8728 on your panel for your DNS so it allows traffic to the router at the moment if you followed the guide you only forwarded port 80 that gives you access to the web interface but not the api

from routeros-client.

khertg avatar khertg commented on July 19, 2024

I tested 2 VPN for port 80 and 8921.
Now I changed 8921 to 8728.

image

The same thing happened cant connect

from routeros-client.

khertg avatar khertg commented on July 19, 2024

Using local IP

image

Using the VPN IP

image

from routeros-client.

woudanator avatar woudanator commented on July 19, 2024

Hi

It shows the connection is being refused by the router what firewall rules do you have on your router

from routeros-client.

khertg avatar khertg commented on July 19, 2024

Which router do you mean ?
the ISP router or the Mikrotik router ?
Here are the firewall rules in my mikrotik

image

from routeros-client.

khertg avatar khertg commented on July 19, 2024

@woudanator
Thank you, you're amazing!
I can connect now.
Again many thanks.

from routeros-client.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.