Community discussions

MUM Europe 2020
 
muaddib
just joined
Topic Author
Posts: 9
Joined: Wed Dec 17, 2014 12:25 pm

Connect to mikrotik without ethernet on linux

Mon Aug 14, 2017 11:04 pm

Hello Everybody,

I just received 2 CRS326, and I'm having issues with them. I have a Ubuntu laptop without ethernet and the CRS326 doesn't have a default config.
Winbox under wine doesn't see it when plugged via USB ethernet. A PC with a true ethernet port is able to recognize it via MAC discovery.

1) Is there a way to enable MAC discovery in Wine+Winbox, via the USB ethernet adapter? I tried several ones and no one works.

2) Is there a way to connect via MAC-TELNET in linux, via USB ethernet adapters?

3) Some USB ethernet adapters are not even capable of getting an IP, while they normally works on other devices (WRT-3200, TP-LINK switches). Is this normal?

4) Which Serial to USB adapter works? This one works with linux?

Moreover one is working fine, the other one had a power supply failure as soon as connected. I bought a new PSU but it's acting strange.

When I try to configure it via winbox, it doesn't want to keep the IP address. As soon as I save the config it reverts to 0.0.0.0, thus I can't use WebFig. I already tried to reset it. Am I doing something wrong? Could the power supply have damaged the memory? Is there a way to overwrite the firmware?
 
User avatar
JohnTRIVOLTA
Member Candidate
Member Candidate
Posts: 213
Joined: Sun Dec 25, 2016 2:05 pm
Location: BG/Sofia

Re: Connect to mikrotik without ethernet on linux

Mon Aug 14, 2017 11:31 pm

Get another mikrotik with wlan and set it on a bridge! Then connect the laptop with it and you can connect with winbox on the 2 level - mac address ! We are waiting for Woobm "Plug into a device to have a new management AP" !
 
muaddib
just joined
Topic Author
Posts: 9
Joined: Wed Dec 17, 2014 12:25 pm

Re: Connect to mikrotik without ethernet on linux

Tue Aug 15, 2017 1:27 am

But CRS326 doesnt have a USB port :( . Will this work with a non mikrotik device?
 
User avatar
sjwrick
Frequent Visitor
Frequent Visitor
Posts: 77
Joined: Tue Jul 25, 2006 10:12 pm

Re: Connect to mikrotik without ethernet on linux

Tue Aug 15, 2017 7:21 am

Can't you set the CRS326 to have a default config by pressing the reset button for a few seconds?
 
muaddib
just joined
Topic Author
Posts: 9
Joined: Wed Dec 17, 2014 12:25 pm

Re: Connect to mikrotik without ethernet on linux

Tue Aug 15, 2017 2:37 pm

Can't you set the CRS326 to have a default config by pressing the reset button for a few seconds?
the default configuration doens't allow me to connect. There is no DHCP or IP configured.

I was hoping that maybe I could connect by manually setting the ip, but it doesn't work.

I think that's bad engineering from Mikrotik, I don't know why there's a fashion of not having a default config.
 
User avatar
Steveocee
Forum Guru
Forum Guru
Posts: 1115
Joined: Tue Jul 21, 2015 10:09 pm
Location: UK
Contact:

Re: Connect to mikrotik without ethernet on linux

Tue Aug 15, 2017 4:01 pm

Set yourself a static IP on the USB-ethernet interface and as silly as this may sound, ensure it has a gateway IP set. It doesn't have to be in the same range as the CRS but for some reason I've found that I can't L2 discover from my Ubuntu laptop (even via real ethernet port) unless a gateway and IP are set on that interface.
Steve "Steveocee" Carter
PC Gamer, Airsofter, MikroTik Nerd
My Website - My MikroTik Tutorials
 
User avatar
doneware
Trainer
Trainer
Posts: 541
Joined: Mon Oct 08, 2012 8:39 pm
Location: Hungary

Re: Connect to mikrotik without ethernet on linux

Tue Aug 15, 2017 4:55 pm

2) Is there a way to connect via MAC-TELNET in linux, via USB ethernet adapters?

you can download mac-telnet source and complile for your box, but there must be also precompiled binaries in most repositiores.
https://github.com/haakonnessjoen/MAC-Telnet

there is a man page for this: http://lunatic.no/2010/10/routeros-mac- ... nux-users/

the best feature of it is that it also can connect to device based on "name" (read: system identity) not just based on mac-address. for this feature to work the device must run "ip neighbor discovery" on the connecting interface. and you can "listen" to mndp advertisements:
cy-bear:~ bat$ ./mactelnet -l
Searching for MikroTik routers... Abort with CTRL+C.

MAC-Address       Identity (platform version hardware) uptime
0:c:42:d1:41:a9   batswitch (MikroTik 6.40.1 (stable) RB750GL) up 0 days 14 hours
6c:3b:6b:66:eb:77 mflexhub (MikroTik 6.41rc6 (testing) RB952Ui-5ac2nD) up 0 days 4 hours
d4:ca:6d:fd:4d:ed ipfk-router (MikroTik 6.39.2 (stable) CRS125-24G-1S) up 63 days 0 hours
this is a handy stuff i use everyday on my mac.
#TR0359
 
muaddib
just joined
Topic Author
Posts: 9
Joined: Wed Dec 17, 2014 12:25 pm

Re: Connect to mikrotik without ethernet on linux

Tue Aug 15, 2017 5:25 pm

the best feature of it is that it also can connect to device based on "name" (read: system identity) not just based on mac-address. for this feature to work the device must run "ip neighbor discovery" on the connecting interface. and you can "listen" to mndp advertisements:
thank you, mactelnet -l is much more practical than linux device enumeration.

Anyhow it is not working alone, I can't connect to the router, the connection fails.
Set yourself a static IP on the USB-ethernet interface and as silly as this may sound, ensure it has a gateway IP set. It doesn't have to be in the same range as the CRS but for some reason I've found that I can't L2 discover from my Ubuntu laptop (even via real ethernet port) unless a gateway and IP are set on that interface.
Thank you very much for pointing me toward the right direction.

To connect I had to:
1) Set a random manual ip.
2) set a fake gateway
3) try different adapters

Some USB adapters works, some don't. What's strange is that an adapter who can't connect on an already configured router, instead works via mactelnet. And viceversa.
Why is that? anyone else experienced compatibility issues with USB ethernet adapters?
Why is this process not documented anywhere? Am I the first one to experience this?
Is it normal for the CRS216 to not have a default configuration? How can I modify the default config, so that when I manually reset it, it reverts to a functioning state?
 
User avatar
doneware
Trainer
Trainer
Posts: 541
Joined: Mon Oct 08, 2012 8:39 pm
Location: Hungary

Re: Connect to mikrotik without ethernet on linux

Tue Aug 15, 2017 5:40 pm

with the manual ip setting you will solve some issues. normally if you have dhcp enabled on your ethernet, after it fails to get an ip address with DHCP it will default to an IPv4 link local address (also known as zeroconf) from 169.254.0.0/16, which is again "fake" but at least an address.

btw, mactelnet operates with 0.0.0.0 and 255.255.255.255 addresses for communication, and is unencrypted. this being broadcast traffic will be seen in every point of your LAN, so be vary :-)

you don't need no gateway entry for it to function.
some mactelnet implementations have issues with multiple active interfaces (like ethernet _and_ wifi) and may try to talk on the "other" interface, but you can fix that with a command line argument. the same is true for multiple usb ethernets.

all-in-all it does not matter, what kind of ethernet adapter you are using, it is not device dependent - it must be ethernet or wlan.
#TR0359
 
User avatar
doneware
Trainer
Trainer
Posts: 541
Joined: Mon Oct 08, 2012 8:39 pm
Location: Hungary

Re: Connect to mikrotik without ethernet on linux

Tue Aug 15, 2017 5:43 pm

Is it normal for the CRS216 to not have a default configuration? How can I modify the default config, so that when I manually reset it, it reverts to a functioning state?
no, it is not normal, but i faced this situation multiple times with a wide range of devices which ought to have defconf: hap, hex, rb450, rb850 and also crs125
if you do a /system reset-configuration no-defaults=no
it should fix it.

i think it can happen accidentally during tests as the device boots and a keystroke is received on the console (r for revert) and on the next boot you have an empty config...
#TR0359
 
muaddib
just joined
Topic Author
Posts: 9
Joined: Wed Dec 17, 2014 12:25 pm

Re: Connect to mikrotik without ethernet on linux

Tue Aug 15, 2017 5:49 pm

with the manual ip setting you will solve some issues. normally if you have dhcp enabled on your ethernet, after it fails to get an ip address with DHCP it will default to an IPv4 link local address (also known as zeroconf) from 169.254.0.0/16, which is again "fake" but at least an address.
Maybe this is because it works on Win but not Linux.
you don't need no gateway entry for it to function.
anyhow if I don't set it, it doesn't work. Very strange :shock:
some mactelnet implementations have issues with multiple active interfaces (like ethernet _and_ wifi) and may try to talk on the "other" interface, but you can fix that with a command line argument. the same is true for multiple usb ethernets.
how can I force to use a given adapter? I couldn't find it with a quick search.
all-in-all it does not matter, what kind of ethernet adapter you are using, it is not device dependent - it must be ethernet or wlan.
That's what bugs me the most!!!! Should I open a bug with mikrotik?

BTW the situation with Winbox is even worse. I can't make it to works, it doesn't find any device.
 
User avatar
doneware
Trainer
Trainer
Posts: 541
Joined: Mon Oct 08, 2012 8:39 pm
Location: Hungary

Re: Connect to mikrotik without ethernet on linux

Tue Aug 15, 2017 6:15 pm

how can I force to use a given adapter? I couldn't find it with a quick search.
another version of mactelnet has it: https://github.com/elceef/mactelnet
Here are some mac-telnet usage information:

# ./mactelnet --help
Usage: ./mactelnet <ifname> <MAC> <username> [password]

Parameters:
ifname Network interface that the RouterOS resides on. (ex: eth0)
MAC MAC-Address of the RouterOS device. Use mndp to discover them.
username Your username.
password Your password.

if you set "ifname" to "eth0" or whatever your network device is on linux, mactelnet should be only talking through this interface only
if i have some time i will make a patch for the recent version to be able to bind it to a specific interface. i just looked at the code of 2 Star 4 Fork 2 haakonnessjoen to see how it works. it basically skips loopback, and looks for the first interface with mac-address (e.g. ethernet or wifi) then it starts to talk on this.
#TR0359
 
muaddib
just joined
Topic Author
Posts: 9
Joined: Wed Dec 17, 2014 12:25 pm

Re: Connect to mikrotik without ethernet on linux

Tue Aug 15, 2017 6:16 pm

Is it normal for the CRS216 to not have a default configuration? How can I modify the default config, so that when I manually reset it, it reverts to a functioning state?
no, it is not normal, but i faced this situation multiple times with a wide range of devices which ought to have defconf: hap, hex, rb450, rb850 and also crs125
if you do a /system reset-configuration no-defaults=no
it should fix it.

i think it can happen accidentally during tests as the device boots and a keystroke is received on the console (r for revert) and on the next boot you have an empty config...
Thank you, the reset fixed it, but if I manually reset the router the problems reappears :(

Also upgrading the OS and the firmware increased speed and stability.

One question though: If I set it in bridge mode I can't reach webfig. If I set it in router mode I can't reach the internet. Is this still normal?

I'm no network engineer, I will hire one to setup the network. I just want to make sure that my hardware is not broken.

Is there a self health test for the router? to check if anything is broken inside?
 
User avatar
doneware
Trainer
Trainer
Posts: 541
Joined: Mon Oct 08, 2012 8:39 pm
Location: Hungary

Re: Connect to mikrotik without ethernet on linux

Tue Aug 15, 2017 6:26 pm

One question though: If I set it in bridge mode I can't reach webfig. If I set it in router mode I can't reach the internet. Is this still normal?
well, if you do this via "quickset" then this may be true. i don't really (never ever) use quickset as it is only good if you have blank config - if you have anything set up manually before, it will just screw it up.

when the box is in bridge mode, it acts as a L2 device. and by default it does not have no ip address. so you need to run "dhcp-client" on the bridge interface. then it will request from the DHCP server. but obviously in this case it will not be routing anything. but as far as i know, its a crs210, so essentially a switch, with very limited routing throughput. don't set it up as a bridge, as it currently uses the CPU to do bridging instead of the hw switch chip, so your throughput will be terrible.
indeed you need an experienced network engineer, familiar with mikrotik switches to have an optimal config.

if the box is in router mode, then i guess it will have an "external" interface, say ether1, and the rest is bridged together as internal network. at least in this case you'd need
- dhcp client running on the external interface
- firewall nat rule to do masquerading
but don't do this on the crs2xx series switches. they are absolutely not meant for this.
Is there a self health test for the router? to check if anything is broken inside?
you can check the installation with the following command:
[bat@hgw2] /ip firewall nat> /system check-installation 
  status: installation is ok
it will go from 0% to 100% and say whether you are ok. but this checks only the operating system (routerOS) and will not reveal no hw issues.
so far i think you do not have any...
you may check /system resource print for bad blocks on the flash maybe.
#TR0359
 
muaddib
just joined
Topic Author
Posts: 9
Joined: Wed Dec 17, 2014 12:25 pm

Re: Connect to mikrotik without ethernet on linux

Tue Aug 15, 2017 6:52 pm


well, if you do this via "quickset" then this may be true. i don't really (never ever) use quickset as it is only good if you have blank config - if you have anything set up manually before, it will just screw it up.


I was hoping that quickset would have given me a working system, with internet and webfig, but no :( .

indeed you need an experienced network engineer, familiar with mikrotik switches to have an optimal config.
yes, but then I would have had to pay a technician whom couldn't have done anything, due to faulty hardware :(

I want to make sure it works. The switch immediately had a problem with the PSU. I opened an RMA with my supplier and:

1) Mikrotik suggested me to try another PSU
2) When I asked to send me one, they told me to buy one to hasten the process :O
3) Now that the switch boots, they simply closed the RMA :( :( :(

Now I'm afraid that the memory got damaged or something because it behaves differently than the other one I bought.

Is this normal for mikrotik? Should I insist to have the router substituted?

Who is online

Users browsing this forum: MSN [Bot] and 18 guests