Answer the question
In order to leave comments, you need to log in
How does Mikrotik/RouterOS know the ip address of the gateway if I set the physical interface as the gateway?
I take a fresh Mikrotik with routeros 6.35.2 and
make it a complete reset of the config, without using the standard
one, that is, it turns out a "bare" config without an ip address
, I have a subnet 31.200
. - Mikrotik
do the following configuration on it
/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, I do not specify the ip address of the gateway, I specify the physical interface
the question is, why does the Internet work with this configuration? :) (e.g. ping to 8.8.8.8) the
trace shows 31.200.235.141 as the first hop, but how did he know it?
Of course, I understand that as a person it’s not difficult for me to guess that the gateway is 31.200.235.141, but Mikrotik is not a person)
I certainly have no doubt that this is even described somewhere in the Mikrotik manual but I didn’t find it myself :(
it’s very interesting what mechanism for determining
and what will happen if the network, for example, becomes not / 30, but / 29
Answer the question
In order to leave comments, you need to log in
See /ip routes print
Is there a default gateway? I think no.
The answer lies in the question itself. Gateway CISCO. By default, they have proxy-arp enabled on their interfaces.
With other equipment - not the fact that it will be possible to repeat the specified scheme.
Cisco has proxy arp enabled on interfaces. If you look at ip-arp, you'll see that a bunch of ip addresses have a single poppy mapped to them. You can use this feature, but it eats up the RAM. Therefore I for classical routing. The subnet mask in this case does not matter, even though / 8
In short, the first hop was recognized by the poppy address behind the ether1 interface. In
more detail HOW it all works - the OSI model (the second level of network interaction) will answer.
You need to read how classic static routing works .
The router looks at the packet header, determines the DST IP address, and looks up in the routing table which interface to send the packet to, making recursive queries to its own routing table if necessary.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question