電訊茶室's Archiver

角色 發表於 2018-6-24 07:52

RouterOS - USB port to access serial devices including MikroTik routers

[i=s] 本帖最後由 角色 於 2018-6-24 19:00 編輯 [/i]

有的时候,我们不能用WinBox计入router,我们怎样办呢?那么只好用console port,不是很多RouterBoards都有console port (图一、二),只有部分才有。我们买什么线才能用上这个console port呢?我们需要一条像图三的线——USB to Serial Adaptor。我现在使用的是Unitek Y-105D,图四是Unitek 105-D的资料。

图一:CCR1009 router: Male serial port
[attach]4131[/attach]

图二:RB450G x2: Male serial port
[attach]4134[/attach]

图三:Unitek 105-D USB-to-Serial Cable
[attach]4135[/attach]

图四:Unitek 105-D说明
[attach]4136[/attach]

一般我们使用USB to Serial Adaptor是要注意它是否能与你的PC连接,有的需要drivers,而我选的Unitek 105D,在Window 10是不需要额外drivers,直插就能用上。在PC,你可以用Putty就可以连起来。

而我这次使用的目的就是遥控R1,然后通过USB port接USB-to-Serial Adaptor,再接R2,详细请看图五。

图五:Connection diagram
[attach]4137[/attach]

你把USB-to-Serial Adaptor插入R1(hAP ac^2),在GUI system->ports,你会看到图六

图六:USB-to-Serial Adaptor插入后的information
[attach]4139[/attach]

你双击图六的usb1,你会得到图七的画面:
图七:Adaptor settings
[attach]4138[/attach]

参考文献:
[url]https://forum.mikrotik.com/viewtopic.php?t=80285[/url]

[url]https://wiki.mikrotik.com/wiki/Manual:Port[/url]

[url]https://wiki.mikrotik.com/wiki/Serial_Port_Usage[/url]

角色 發表於 2018-6-24 13:26

[i=s] 本帖最後由 角色 於 2018-6-24 19:15 編輯 [/i]

[url]https://wiki.mikrotik.com/wiki/Serial_Port_Usage[/url]

因为这样插入,R1系统以为是console接入,如果我们需要R1去控制usb1 to access R2 console port,所以我们需要在R1 disable console。[code]
/system console disable 0
[/code].

然后输入下面指令, 会出现下面画面。[code]
/system serial-terminal usb1
[/code].

[attach]4141[/attach]

再按回车(Return key)几下就可以R2的login prompt。
[attach]4140[/attach]



The following information is used to set up the serial port for other settings if necessary.[code]
/port set usb1 baud-rate=19200 data-bits=8 parity=none stop-bits=1
/port set serial0 baud-rate=auto
[/code]

角色 發表於 2018-6-27 14:43

[i=s] 本帖最後由 角色 於 2018-6-27 14:48 編輯 [/i]

If MacOS is used, you can use the following command to connect the USB-to-Serial Port[code]
screen /dev/tty.usbserial 115200 -L
[/code]If Win7 or Win10 is used, you can config putty to use com3 and baud=115200. Please be noted that you need to install device driver the USB-to-Serial Adapter. For Unitek, the driver can be obtainable from the following website:

[url]http://www.unitek-it.com[/url]

頁: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.