{"id":49,"date":"2020-07-16T23:30:17","date_gmt":"2020-07-16T15:30:17","guid":{"rendered":"https:\/\/blog.swineson.me\/en\/?p=49"},"modified":"2020-07-17T00:54:40","modified_gmt":"2020-07-16T16:54:40","slug":"mop-the-unknown-mac-telnet-protocol-on-cisco-routers","status":"publish","type":"post","link":"https:\/\/blog.swineson.me\/en\/mop-the-unknown-mac-telnet-protocol-on-cisco-routers\/","title":{"rendered":"MOP: The Unknown &#8220;MAC Telnet&#8221; Protocol on Cisco Routers"},"content":{"rendered":"<p>When I was replacing all my buggy little MikroTik RouterOS boxes and VMs with some new shiny (and also buggy) Cisco ISR1000s and CSR1000vs a few years ago, there were several things that I missed so much that existed on the former but not on the latter. One of them was the &#8220;MAC Winbox&#8221; and &#8220;MAC Telnet&#8221; capability with which you can plug your maintenance workstation into the router with an Ethernet cable, fire up a Winbox, and it will let you configure the router through a layer 2 connection. It require no valid IP configuration, so it would work as long as you doesn&#8217;t shut down the port and there is no wild switch ACL in place. Newer routers have USB console ports, and I do have a console cable in my EDC, but a router&#8217;s ability to be configured without a console cable is still its big advantage to me.<\/p>\n<p>Imagine my face today when I learned that Cisco routers (IOS and IOS XE) do support a layer 2 protocol with remote console capability. And the protocol is not new. The protocol is from the 1980s and IOS has been quietly supporting it for years. It has even been enabled by default for years. It is still being supported (as of IOS XE 17.2).<\/p>\n<p><!--more--><\/p>\n<p>Let me introduce you to the <em>Maintenance Operation Protocol<\/em>. MOP is designed to be a remote management protocol for VMS. It initially had a lot more capabilities: installing software, remote rebooting, etc., but what we actually need (and the Cisco OSes actually implemented) is its remote console function. The protocol packets are encapsulated directly in Ethernet frames, so it will work across a bridge\/switch and without a valid IP configuration.<\/p>\n<p>Let&#8217;s spin up a lab VM and see it in action.<\/p>\n<h1>MOP Server Configuration<\/h1>\n<p>It is simple to enable MOP on a Cisco IOS\/IOS XE system.<\/p>\n<ul>\n<li>MOP should be enabled on interface level<\/li>\n<li>AAA (username\/password authentication) should be configured<\/li>\n<li>VTY should be reserved for MOP<\/li>\n<\/ul>\n<p>Here is a minimal configuration:<\/p>\n<pre class=\"lang:default decode:true \">! set up AAA\r\naaa new-model\r\naaa authorization exec default local\r\nusername admin privilege 15 secret super-strong-passw0rd\r\n\r\n! enable MOP on interface level\r\ninterface GigabitEthernet1\r\n no shutdown\r\n mop enable\r\n\r\n! reserve VTY for MOP\r\nline vty 1 4\r\n transport input mop<\/pre>\n<h1>MOP Client Configuration<\/h1>\n<p>It&#8217;s too hard to find a working VMS installation now, so I&#8217;ll use my Debian 10 for demonstration. We only need the client so remember to disable the server:<\/p>\n<pre class=\"lang:sh decode:true\">apt install latd\r\nsystemctl disable --now latd<\/pre>\n<p>Then we simply connect to the router with an interface and a MAC address:<\/p>\n<pre class=\"lang:default decode:true\">root@localhost:~# ip link set eth0 up\r\nroot@localhost:~# moprc -i eth0 -v 00:02:00:00:00:00\r\nMaintenance Version: 3.0.0\r\n\r\nConsole connected (press CTRL\/D when finished)\r\n\r\nUsername: admin\r\nPassword:\r\n\r\nRouter&gt;\r\n<\/pre>\n<p>You might need to press Enter after the <span class=\"lang:default highlight:0 decode:true crayon-inline \">Console connected<\/span> message to make the username prompt show up.<\/p>\n<h1>Things Worth Noting<\/h1>\n<h2>Default Configuration<\/h2>\n<p>IOS and IOS XE defaults to enable MOP if you have a empty but defined <span class=\"lang:default highlight:0 decode:true crayon-inline \">interface<\/span> configuration block and the interface is a Ethernet interface (no matter how fast it is). In recent versions, if the interface does not exist before, <span class=\"lang:default highlight:0 decode:true crayon-inline \">no mop enabled<\/span> will be generated automatically when the interface is detected.<\/p>\n<h2>Cisco Implementation Specific Problems<\/h2>\n<p>If you don&#8217;t connect with a <span class=\"lang:default highlight:0 decode:true crayon-inline \">-v<\/span> flag, the connection will fail:<\/p>\n<pre class=\"lang:default decode:true\">root@localhost:~# moprc -i eth0 00:02:00:00:00:01\r\ntarget does not support remote console\r\n\r\n<\/pre>\n<p>If MOP is enabled on the interface but other configurations are missing, you will get this instead:<\/p>\n<pre class=\"lang:default decode:true \">root@localhost:~# moprc -i eth0 -v 00:02:00:00:00:01\r\nMaintenance Version: 3.0.0\r\n\r\nConsole connected (press CTRL\/D when finished)\r\n\r\nTarget does not respond\r\n\r\n<\/pre>\n<h2>Monitoring MOP Activity<\/h2>\n<p>MOP connected users will show up in <span class=\"lang:default highlight:0 decode:true crayon-inline \">show user<\/span> :<\/p>\n<pre class=\"lang:default decode:true\">Router#show user\r\n    Line       User       Host(s)              Idle       Location\r\n*  0 con 0                idle                 00:00:00\r\n   1 vty 0     admin      idle                 00:00:06 UNKNOWN\r\n\r\n  Interface    User               Mode         Idle     Peer Address\r\n\r\n<\/pre>\n<p>MOP packets statistics can be viewed with <span class=\"lang:default highlight:0 decode:true crayon-inline \">show interface &lt;interface&gt; accounting<\/span> :<\/p>\n<pre class=\"lang:default decode:true\">Router#show interfaces GigabitEthernet1 accounting\r\nGigabitEthernet1\r\n                Protocol    Pkts In   Chars In   Pkts Out  Chars Out\r\n                   Other          0          0          0          0\r\n                      IP          0          0          0          0\r\n                 DEC MOP       1945     116700       1899     114110\r\n                     ARP          0          0          0          0\r\n<\/pre>\n<p>And connection logs can be displayed with <span class=\"lang:default highlight:0 decode:true crayon-inline \">debug mop<\/span> :<\/p>\n<pre class=\"lang:default decode:true\">*Jul 16 15:20:00.096: MOP: Reserving console for 0002.0000.0002\r\n*Jul 16 15:20:00.098: MOP(GigabitEthernet1): Got request_id message from 0002.0000.0002\r\n*Jul 16 15:20:00.098: MOP(GigabitEthernet1): Sending sysid message to 0002.0000.0002\r\n\r\n*Jul 16 15:20:06.427: MOP: Console released by 0002.0000.0002\r\n<\/pre>\n<h2>MOP System ID Messages<\/h2>\n<p>There is an auxiliary configuration at the interface level:<\/p>\n<pre class=\"lang:default decode:true \">interface GigabitEthernet1\r\n mop sysid<\/pre>\n<p>If enabled, IOS will send out packets periodically to announce its support for MOP protocol. I haven&#8217;t found it useful in any ways.<\/p>\n<hr \/>\n<p>References:<\/p>\n<ul>\n<li><a href=\"http:\/\/linux-decnet.sourceforge.net\/docs\/maintop30.txt\" target=\"_blank\" rel=\"noopener noreferrer\">DECnet DIGITAL Network Architecture Maintenance Operations Functional Specification Version 3.0.0<\/a><\/li>\n<li><a href=\"https:\/\/insinuator.net\/2015\/08\/cisco-and-the-maintenance-operation-protocol-mop\/\" target=\"_blank\" rel=\"noopener noreferrer\">Cisco and the Maintenance Operation Protocol (MOP)<\/a><\/li>\n<li><a href=\"https:\/\/web.archive.org\/web\/20160102131234\/http:\/\/blogs.cisco.com\/security\/router_spring_cleaning_-_no_mop_required\" target=\"_blank\" rel=\"noopener noreferrer\">Router Spring Cleaning \u2013 No MOP Required<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>When I was replacing all my buggy little MikroTik RouterOS boxes and VMs with some new shiny (and also buggy) Cisco ISR1000s and CSR1000vs a few years ago, there were several things that I missed so much that existed on the former but not on the latter. One of them was the &#8220;MAC Winbox&#8221; and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[7,8,9],"tags":[],"class_list":["post-49","post","type-post","status-publish","format-standard","hentry","category-cisco","category-cisco-ios","category-cisco-ios-xe"],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/posts\/49"}],"collection":[{"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/comments?post=49"}],"version-history":[{"count":9,"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/posts\/49\/revisions"}],"predecessor-version":[{"id":58,"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/posts\/49\/revisions\/58"}],"wp:attachment":[{"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/media?parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/categories?post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.swineson.me\/en\/wp-json\/wp\/v2\/tags?post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}