Community discussions

MikroTik App

Search found 28 matches

by MakroTok
Wed Mar 27, 2024 12:56 am
Forum: General
Topic: Connect two Mikrotik with gray IP using WireGuard
Replies: 9
Views: 1260

Re: Connect two Mikrotik with gray IP using WireGuard

Without really knowing I'd assume you'd have to configure both sied as if they'd be road warriors to each other...
Or like site-to-site but with DDNS names instead of IPs (which finally would be the same)
by MakroTok
Wed Mar 27, 2024 12:30 am
Forum: General
Topic: HowTo configure WireGuard in same subnet?
Replies: 3
Views: 1225

HowTo configure WireGuard in same subnet?

My subnet is rather large 10.0.0.0/16 (no, I don't need 65k clients, but it's convenient to use 10.0.A.0, 10.0.B.0, ... for various categories / persons). I also have a working WireGuard Road Warrior configuration in a dedicated 172.17.20.0.1/24 subnet. I wouldn't mind to keep it as it is right but ...
by MakroTok
Fri Mar 15, 2024 2:02 am
Forum: General
Topic: Hairpin NAT: Is there a simple solution?
Replies: 29
Views: 18895

Re: Hairpin NAT: Is there a simple solution?

For dynamic WANIPs the dst nat rule usually has something like in-interface-list=WAN, which we replace with dst-address-list=external_wan where externel_wan is a firewall address list entry with an address=DDNSname If you have public address directly on router, you can skip DDNS and use this as DHC...
by MakroTok
Tue Mar 05, 2024 7:38 pm
Forum: Scripting
Topic: Retrieveing a global variable readonly to a local variable
Replies: 9
Views: 1878

Re: Retrieveing a global variable readonly to a local variable

@Amm0 Not that I need or want to use this kind of trickery, but one could use *any* setting that can be easily found and use the comment field (disabling the setting), i.e. one could use (as an example) a (bogus, disabled) static route or a firewall nat or filter rule? All true. Same concept: use s...
by MakroTok
Mon Mar 04, 2024 6:34 pm
Forum: Scripting
Topic: Retrieveing a global variable readonly to a local variable
Replies: 9
Views: 1878

Re: Retrieveing a global variable readonly to a local variable

If I may, it is not particularly easy to read when you use variable names that are also common names or properties. If I get this right, your snippet, using var_1, var_2 instead of name and value is: :local var_1 "foo"; :local var_2 [/system/script/environment/get [/system/script/environm...
by MakroTok
Mon Mar 04, 2024 4:18 pm
Forum: Scripting
Topic: Retrieveing a global variable readonly to a local variable
Replies: 9
Views: 1878

Re: Retrieveing a global variable readonly to a local variable

For a global variable with the "fixed" name "foo" one could just do: :global foo; For a global variable where the name is "dynamic", eg. because it is e.g. derieved from :jobname one could write :global variablename [:jobname]; :global value; [:parse "global $vari...
by MakroTok
Sun Mar 03, 2024 11:39 pm
Forum: Scripting
Topic: Retrieveing a global variable readonly to a local variable
Replies: 9
Views: 1878

Retrieveing a global variable readonly to a local variable

Is there a more elegant solution to retrieve the value of a global variable without defining one? :local name "foo"; :local value [/system/script/environment/get [/system/script/environment/find name="$name"] value]; This is a just minimal example but instead of the fixed value &...
by MakroTok
Sun Mar 03, 2024 2:27 pm
Forum: Scripting
Topic: Built in function library
Replies: 142
Views: 158856

Re: Built in function library

I'd love $0 to return the script name. This definetly needs to be a RouterOS functionality as one cannot work around on its own. (Use case would be similar to busybox where one has one binary which behaves differntly depending on the name of the symbolic link used to call it.) One could use e.g. th...
by MakroTok
Sun Mar 03, 2024 11:19 am
Forum: Scripting
Topic: Built in function library
Replies: 142
Views: 158856

Re: Built in function library

I'd love $0 to return the script name. This definetly needs to be a RouterOS functionality as one cannot work around on its own. (Use case would be similar to busybox where one has one binary which behaves differntly depending on the name of the symbolic link used to call it.) One could use e.g. the...
by MakroTok
Fri Mar 01, 2024 7:47 pm
Forum: Scripting
Topic: fetch seems to behave different when called in function [SOLVED]
Replies: 12
Views: 7809

Re: fetch seems to behave different when called in function [SOLVED]

The globals can be set up by another script (as far as I understood the scripting system) so that this script could be easily shared, e.g. here or in my documentation about my ride to set up the router... Seems omitting the value of the globals works only when called via shell or by the PPP profile...
by MakroTok
Fri Mar 01, 2024 7:37 pm
Forum: Scripting
Topic: fetch seems to behave different when called in function [SOLVED]
Replies: 12
Views: 7809

Re: fetch seems to behave different when called in function [SOLVED]

BTW my current solution was to "unroll" the script and get rid of the functions, but that feels very strange to me as I tried to train myself to seprate stuff and have small working parts and now I have to do the opposite... Here is the result for DDNs updates used for PPP on-up events. It...
by MakroTok
Fri Mar 01, 2024 7:10 pm
Forum: Scripting
Topic: fetch seems to behave different when called in function [SOLVED]
Replies: 12
Views: 7809

Re: fetch seems to behave different when called in function [SOLVED]

For scripts that have many functions like this sms-read.rsc I'm using global functions since it will be needed to pass a lot functions arguments it they are local, but in this case I'm unsettling them ( :set SomeGlobalVar ) after script is done just to avoid functions hanging in environment. Using ...
by MakroTok
Fri Mar 01, 2024 7:03 pm
Forum: Scripting
Topic: fetch seems to behave different when called in function [SOLVED]
Replies: 12
Views: 7809

Re: fetch seems to behave different when called in function [SOLVED]

Whole system has to fit in 16MB, so there are some limits on how many features scripting can have... so no linter to find the "use of undefined global in function". There is ":import verbose=yes <scriptfile.rsc>" that helps find what line something is failing. 16MB is really no ...
by MakroTok
Fri Mar 01, 2024 11:17 am
Forum: Scripting
Topic: fetch seems to behave different when called in function [SOLVED]
Replies: 12
Views: 7809

Re: fetch seems to behave different when called in function [SOLVED]

As a software engineer by profession it still boggles my mind why I have to refere to already globally defined variables... It is done to prevent accidental access/modification of global variables. Remember it is not required to declare local variables, so any set command could unintentionally use ...
by MakroTok
Thu Feb 29, 2024 8:05 pm
Forum: Scripting
Topic: fetch seems to behave different when called in function [SOLVED]
Replies: 12
Views: 7809

Re: fetch seems to behave different when called in function [SOLVED]

Many thanks for the replies. It really bugged me why it was not working. Now I understood that without referring to the variable it would be undefined and instead of :local result [/tool fetch url=$afraidSyncURL as-value output=user] I was actually calling :local result [/tool fetch url= as-value ou...
by MakroTok
Thu Feb 29, 2024 3:07 pm
Forum: Scripting
Topic: fetch seems to behave different when called in function [SOLVED]
Replies: 12
Views: 7809

fetch seems to behave different when called in function [SOLVED]

I'm trying to get my feet wet with MikroTik scripts. After having a basic script I'm trying to clean it up a bit and wrap certain parts into functions. When doing this with the fetch function it seems to behave different: # MikroTik script to update the DNS entry when Internet connection has been # ...
by MakroTok
Sat Jul 29, 2023 11:36 pm
Forum: General
Topic: Broken compatibility / wrong SFP ↔ RJ45 1G transceiver temperature since RouterOS > 7.7 [SOLVED]
Replies: 4
Views: 1979

Re: Broken compatibility / wrong SFP ↔ RJ45 1G transceiver temperature since RouterOS > 7.7 [SOLVED]

I have a similar issue. The working setup on my RB5009UG+S+ is based on 7.7 and uses a SFP (Zyxel PMG3000-D20B), had to skip 7.8 and 7.9 since the SFP was not recognized.
With 7.10.2 the SFP is shut down due to temperature, but the SFP is no hotter than 51° at anytime ...
by MakroTok
Thu Mar 02, 2023 6:58 pm
Forum: General
Topic: Feature requests
Replies: 1792
Views: 680624

Re: Feature requests

I'd like to suggest a dedicated "Feature requests" sub-forum. A sub-forum would allow one feature request per topic and discussion on this specific topic alone. Having all feature requests thrown into one thread is not helpful on discussion or working out details on a solution which would ...
by MakroTok
Mon Feb 27, 2023 10:09 am
Forum: General
Topic: REST API "wishlist"
Replies: 0
Views: 383

REST API "wishlist"

Is there a way on how to address eventual shortcomings of the REST API? I just got started playing with it are finding smaller issues here and there... My list (yet): CORS (naturally), for the time being I use a CORS proxy but that's just not as it should be. Pagination - is there a way to do this? ...
by MakroTok
Wed Feb 22, 2023 6:37 pm
Forum: Scripting
Topic: Please remove SSL requirement for REST Api
Replies: 15
Views: 3741

Re: Please remove SSL requirement for REST Api

But I do think improving the "Let's Encrypt" support to allow different auth method would also help this "quickest path to playing with REST" use case. A broader definition of: /certificate/enable-ssl-certificate could, optionally, generate a self-signed certs to make HTTPS work...
by MakroTok
Wed Feb 22, 2023 12:02 pm
Forum: Scripting
Topic: Please remove SSL requirement for REST Api
Replies: 15
Views: 3741

Re: Please remove SSL requirement for REST Api

It would be very much appreciated if this requirement gets dropped. It adds additional burden on people just wanting to "play" with the REST API. For people who want to secure their network, I guess they wouldn't consider to activate telnet or www at all. For the rest of us, please let us ...
by MakroTok
Mon Feb 13, 2023 1:59 pm
Forum: Scripting
Topic: "Dynamic" repetitive configuration of interfaces [SOLVED]
Replies: 2
Views: 1624

Re: "Dynamic" repetitive configuration of interfaces [SOLVED]

Many thanks for the feedback and the useful tipps. I directly adopted your version :D
by MakroTok
Sun Feb 12, 2023 1:54 am
Forum: Scripting
Topic: "Dynamic" repetitive configuration of interfaces [SOLVED]
Replies: 2
Views: 1624

"Dynamic" repetitive configuration of interfaces [SOLVED]

Some long time ago I have written a configuration (with a lot of help from the forum) which was initially targeting the "hEX RB750GR3". Now people started using it also with "HAP ac lite". The main difference is that the former has 5 ports and the later only 4. As the people usin...
by MakroTok
Mon Dec 09, 2019 11:41 am
Forum: Beginner Basics
Topic: Setting up a PPPoE server on VLAN [SOLVED]
Replies: 1
Views: 5352

Re: Setting up a PPPoE server on VLAN [SOLVED]

After some fiddling I got it working. All LAN interfaces can be used either for PPPoE or to access the hEX to configure it. The rules for the firewall filter are used to make the hEX reachable as a DNS server (which it was not before since the PPPoE interfaces are not regarded as LAN). See: https://...
by MakroTok
Mon Dec 09, 2019 11:32 am
Forum: Beginner Basics
Topic: Cannot access Mikrotik DNS from PPPoE clients over VLAN [SOLVED]
Replies: 4
Views: 2656

Re: Cannot access Mikrotik DNS from PPPoE clients over VLAN [SOLVED]

It's probably rule #5 which blocks all accesses via PPPoE connections to router itself. My suggestion: add exceptions such as add chain=input action=accept src-address=192.168.200.0/24 protocol=tcp dst-port=53 place-before=5 add chain=input action=accept src-address=192.168.200.0/24 protocol=udp ds...
by MakroTok
Fri Dec 06, 2019 9:46 pm
Forum: Beginner Basics
Topic: Cannot access Mikrotik DNS from PPPoE clients over VLAN [SOLVED]
Replies: 4
Views: 2656

Re: Cannot access Mikrotik DNS from PPPoE clients over VLAN [SOLVED]

What about your firewall filters in chain=input, isn't it blocked there? Havent changed anything on the firewall since I really don't know much about firewalls :roll: Here is the (still untouched) firewall filter configuration: [admin@MikroTik] /ip firewall filter> print Flags: X - disabled, I - in...
by MakroTok
Fri Dec 06, 2019 7:35 pm
Forum: Beginner Basics
Topic: Cannot access Mikrotik DNS from PPPoE clients over VLAN [SOLVED]
Replies: 4
Views: 2656

Cannot access Mikrotik DNS from PPPoE clients over VLAN [SOLVED]

Using a hEX v6.46 (factory resetted and configured as router gettings its address via DHCP) I created a PPPoE server which provides its services over VLAN7. The purpose is to be able to use any port (ether2-5) to access the hEX and also to be able to use the same ports for PPPoE if required. I might...
by MakroTok
Wed Dec 04, 2019 8:05 pm
Forum: Beginner Basics
Topic: Setting up a PPPoE server on VLAN [SOLVED]
Replies: 1
Views: 5352

Setting up a PPPoE server on VLAN [SOLVED]

I'm testing software which goes as an add-on on routers. These routers are special insofar as they connect to uplink only via PPPoE on VLAN7 so I cannot just attach them to a regular switch and get started. (And I don't want to use these test-devices as my main router because of possible downtime an...