How Mikrotik/RouterOS knows the ip address of the gateway, if I set as gateway the physical interface?

I mean Mikrotik with routeros 6.35.2
make him a full config reset, without using a standard
that is, it turns the "bare" configuration without an ip address

I have a subnet 31.200.235.140/30
where 31.200.235.141 gateway, Cisco 31.200.235.142 - Mikrotik

make the following configuration
/ip address
add address=31.200.235.142/30 interface=ether1 network=31.200.235.140
/ip route
add distance=1 gateway=ether1

that is the ip address of the gateway I do not specify, I specify the physical interface
the question is, why in this configuration, the Internet works? :) (for example there is a ping to 8.8.8.8)
the trace shows 31.200.235.141 as the first hop, but how did he know it?

I certainly understand that I as a man not hard to guess that the gateway is 31.200.235.141, but Mikrotik not people)
I'm certainly not somenvayus that it is even described in the manual Mikrotik but did not find myself :(
very interested in a mechanism for determining
and what will happen if the network is such as will not /30 and /29
July 9th 19 at 13:22
5 answers
July 9th 19 at 13:24
Solution
View /print the ip routes
The default gateway there? I think not.

The answer lies in the question itself. A CISCO gateway. BY default, the interfaces they have enabled proxy-arp.
With other equipment - not the fact that you have to repeat a specified pattern.
The vast majority of network equipment L3 can proxy-arp - delbert_Schuppe commented on July 9th 19 at 13:27
: Knows and uses the default - different things. - Baby_Berni commented on July 9th 19 at 13:30
: well, "to repeat the specified scheme" quite succeed, I think. - delbert_Schuppe commented on July 9th 19 at 13:33
That is, you think that can be such a mechanism? mikrotik sends to the cisk-arp request who is supposedly such 8.8.8.8 and cisk answers they say it is? But from the trace, the first hop after all 31.200.235.141, from where Mikrotik got this address? Because of cisk using proxy-arp would send Mikrotik only on your Mac. - alexa_Little commented on July 9th 19 at 13:36
It is the only possible option. - Baby_Berni commented on July 9th 19 at 13:39
you answer is correct. as-interface gateway can be only p2p connections. let's see if the can gateway and the arp table. soon all will become clear - Robyn commented on July 9th 19 at 13:42
ip arp print - clear) - alexa_Little commented on July 9th 19 at 13:45
July 9th 19 at 13:26
Cisco have enabled proxy-ARP on the interfaces. If you look in the ip-arp, you'll see that a bunch of IP addresses mapped to one Mac. To use this feature, but it pogibaet the RAM. Therefore, I am for classical routing. The subnet mask in this case is irrelevant, though /8
July 9th 19 at 13:28
Briefly, the first hop was recognized Mac address for interface ether1

More on HOW all this works - answer the OSI model (the second level of networking).
July 9th 19 at 13:30
You have read how the classic static routing.

The router looks at the packet header, determines DST IP address and searches the routing table, which interface to send the packet, if necessary, making reccursive requests to its own routing table.
July 9th 19 at 13:32
The mask is 30 bits(from 32) - leaves him no choice.
This is certainly the first thing that came to my mind. But you can't be 100% sure that the mechanism looks at the remaining IPS, and sends traffic to it? :)
Well, this is all conjecture? It would be desirable to find an accurate description of the mechanism/algorithm. - delbert_Schuppe commented on July 9th 19 at 13:35
Standards. There is in them such that in the restricted subnet 0 address take not 1 is the gateway, 2 is client. - Baby_Berni commented on July 9th 19 at 13:38
The answer is incorrect. - delbert_Schuppe commented on July 9th 19 at 13:41

Find more questions by tags Network equipmentMikrotikNetwork administration