How a router know where to send a packet with the exit interface route command?
When configuring a Cisco router, a static route can be added using the following commands:
ip route 192.0.2.128 255.255.255.128 192.0.2.48
ip route 192.0.2.128 255.255.255.128 f0/0
If I use the second option, how does R1 know who's the next host and therefore which MAC address it should use as the destination when it wants to reach the 192.0.2.0/25 network? With a /30 network it's easy to assume that the next hop is the only remaining address in the subnet but with a larger subnet like in the example below, I don't get how this works.
route
add a comment |
When configuring a Cisco router, a static route can be added using the following commands:
ip route 192.0.2.128 255.255.255.128 192.0.2.48
ip route 192.0.2.128 255.255.255.128 f0/0
If I use the second option, how does R1 know who's the next host and therefore which MAC address it should use as the destination when it wants to reach the 192.0.2.0/25 network? With a /30 network it's easy to assume that the next hop is the only remaining address in the subnet but with a larger subnet like in the example below, I don't get how this works.
route
add a comment |
When configuring a Cisco router, a static route can be added using the following commands:
ip route 192.0.2.128 255.255.255.128 192.0.2.48
ip route 192.0.2.128 255.255.255.128 f0/0
If I use the second option, how does R1 know who's the next host and therefore which MAC address it should use as the destination when it wants to reach the 192.0.2.0/25 network? With a /30 network it's easy to assume that the next hop is the only remaining address in the subnet but with a larger subnet like in the example below, I don't get how this works.
route
When configuring a Cisco router, a static route can be added using the following commands:
ip route 192.0.2.128 255.255.255.128 192.0.2.48
ip route 192.0.2.128 255.255.255.128 f0/0
If I use the second option, how does R1 know who's the next host and therefore which MAC address it should use as the destination when it wants to reach the 192.0.2.0/25 network? With a /30 network it's easy to assume that the next hop is the only remaining address in the subnet but with a larger subnet like in the example below, I don't get how this works.
route
route
edited 5 hours ago
psmears
24115
24115
asked 16 hours ago
NakruleNakrule
13515
13515
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The second option is something to avoid. It is acceptable for point-to-point interfaces like serial or tunnel interfaces, but on broadcast media (such as Ethernet), it is "close to illegal" to use (regardless of whether the directly attached subnet is /25, /30 or /31).
If configuring the route this way is possible at all (I seem to remember that recent IOS and IOS-XE based routers don't allow it), the router will attempt ARP resolution of the destination IP address of the packet-to-be-forwarded.
Another (Cisco) router may respond to that request, if a) it has proxy arp enabled on the given interface [1] and b) it has a route to the actual destination.
However, also any other system on that broadcast domain may respond to that ARP broadcast, and could "attract" the traffic to itself (and may do all sorts of interesting things with it, since it just got itself into a man-in-the-middle position for free).
In short: Don't do it that way.
And while we're at it: don't use the first option either (unless you're on NX-OS). A properly configured static route looks like this:
ip route <destination network> <destination subnet mask> <egress interface> <next hop ip>
or - in your case
ip route 192.0.2.128 255.255.255.128 fastEthernet0/0 192.0.2.48
Reasoning: without the egress interface, a recursive route lookup is taking place to find an egress interface towards the given next hop. Most of the time, this will be an interface into a directly attached subnet.
However, some strange things may occur if that usually "up" interface into the next hop's (local) subnet goes down, and if the next hop's subnet is still learned via some dynamic routing protocol: then the given static route may not disappear from the routing table (and thus will continue to be redistributed into possibly present dynamic routing protocols, leading to all sorts of strange effects).
Not so if the egress interface is given. If that goes down, the static route vanishes from the routing table, in all cases.
[1] ceterum censeo: proxy arp should be disabled wherever one encounters it (unless it's really, really, really needed).
Thank you very much for that clear and detailed answer !
– Nakrule
9 hours ago
To be fair, the man-in-the-middle situation you describe is always possible with ARP - it's always a broadcast followed by a race-to-reply.
– psmears
8 hours ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "496"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fnetworkengineering.stackexchange.com%2fquestions%2f57055%2fhow-a-router-know-where-to-send-a-packet-with-the-exit-interface-route-command%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The second option is something to avoid. It is acceptable for point-to-point interfaces like serial or tunnel interfaces, but on broadcast media (such as Ethernet), it is "close to illegal" to use (regardless of whether the directly attached subnet is /25, /30 or /31).
If configuring the route this way is possible at all (I seem to remember that recent IOS and IOS-XE based routers don't allow it), the router will attempt ARP resolution of the destination IP address of the packet-to-be-forwarded.
Another (Cisco) router may respond to that request, if a) it has proxy arp enabled on the given interface [1] and b) it has a route to the actual destination.
However, also any other system on that broadcast domain may respond to that ARP broadcast, and could "attract" the traffic to itself (and may do all sorts of interesting things with it, since it just got itself into a man-in-the-middle position for free).
In short: Don't do it that way.
And while we're at it: don't use the first option either (unless you're on NX-OS). A properly configured static route looks like this:
ip route <destination network> <destination subnet mask> <egress interface> <next hop ip>
or - in your case
ip route 192.0.2.128 255.255.255.128 fastEthernet0/0 192.0.2.48
Reasoning: without the egress interface, a recursive route lookup is taking place to find an egress interface towards the given next hop. Most of the time, this will be an interface into a directly attached subnet.
However, some strange things may occur if that usually "up" interface into the next hop's (local) subnet goes down, and if the next hop's subnet is still learned via some dynamic routing protocol: then the given static route may not disappear from the routing table (and thus will continue to be redistributed into possibly present dynamic routing protocols, leading to all sorts of strange effects).
Not so if the egress interface is given. If that goes down, the static route vanishes from the routing table, in all cases.
[1] ceterum censeo: proxy arp should be disabled wherever one encounters it (unless it's really, really, really needed).
Thank you very much for that clear and detailed answer !
– Nakrule
9 hours ago
To be fair, the man-in-the-middle situation you describe is always possible with ARP - it's always a broadcast followed by a race-to-reply.
– psmears
8 hours ago
add a comment |
The second option is something to avoid. It is acceptable for point-to-point interfaces like serial or tunnel interfaces, but on broadcast media (such as Ethernet), it is "close to illegal" to use (regardless of whether the directly attached subnet is /25, /30 or /31).
If configuring the route this way is possible at all (I seem to remember that recent IOS and IOS-XE based routers don't allow it), the router will attempt ARP resolution of the destination IP address of the packet-to-be-forwarded.
Another (Cisco) router may respond to that request, if a) it has proxy arp enabled on the given interface [1] and b) it has a route to the actual destination.
However, also any other system on that broadcast domain may respond to that ARP broadcast, and could "attract" the traffic to itself (and may do all sorts of interesting things with it, since it just got itself into a man-in-the-middle position for free).
In short: Don't do it that way.
And while we're at it: don't use the first option either (unless you're on NX-OS). A properly configured static route looks like this:
ip route <destination network> <destination subnet mask> <egress interface> <next hop ip>
or - in your case
ip route 192.0.2.128 255.255.255.128 fastEthernet0/0 192.0.2.48
Reasoning: without the egress interface, a recursive route lookup is taking place to find an egress interface towards the given next hop. Most of the time, this will be an interface into a directly attached subnet.
However, some strange things may occur if that usually "up" interface into the next hop's (local) subnet goes down, and if the next hop's subnet is still learned via some dynamic routing protocol: then the given static route may not disappear from the routing table (and thus will continue to be redistributed into possibly present dynamic routing protocols, leading to all sorts of strange effects).
Not so if the egress interface is given. If that goes down, the static route vanishes from the routing table, in all cases.
[1] ceterum censeo: proxy arp should be disabled wherever one encounters it (unless it's really, really, really needed).
Thank you very much for that clear and detailed answer !
– Nakrule
9 hours ago
To be fair, the man-in-the-middle situation you describe is always possible with ARP - it's always a broadcast followed by a race-to-reply.
– psmears
8 hours ago
add a comment |
The second option is something to avoid. It is acceptable for point-to-point interfaces like serial or tunnel interfaces, but on broadcast media (such as Ethernet), it is "close to illegal" to use (regardless of whether the directly attached subnet is /25, /30 or /31).
If configuring the route this way is possible at all (I seem to remember that recent IOS and IOS-XE based routers don't allow it), the router will attempt ARP resolution of the destination IP address of the packet-to-be-forwarded.
Another (Cisco) router may respond to that request, if a) it has proxy arp enabled on the given interface [1] and b) it has a route to the actual destination.
However, also any other system on that broadcast domain may respond to that ARP broadcast, and could "attract" the traffic to itself (and may do all sorts of interesting things with it, since it just got itself into a man-in-the-middle position for free).
In short: Don't do it that way.
And while we're at it: don't use the first option either (unless you're on NX-OS). A properly configured static route looks like this:
ip route <destination network> <destination subnet mask> <egress interface> <next hop ip>
or - in your case
ip route 192.0.2.128 255.255.255.128 fastEthernet0/0 192.0.2.48
Reasoning: without the egress interface, a recursive route lookup is taking place to find an egress interface towards the given next hop. Most of the time, this will be an interface into a directly attached subnet.
However, some strange things may occur if that usually "up" interface into the next hop's (local) subnet goes down, and if the next hop's subnet is still learned via some dynamic routing protocol: then the given static route may not disappear from the routing table (and thus will continue to be redistributed into possibly present dynamic routing protocols, leading to all sorts of strange effects).
Not so if the egress interface is given. If that goes down, the static route vanishes from the routing table, in all cases.
[1] ceterum censeo: proxy arp should be disabled wherever one encounters it (unless it's really, really, really needed).
The second option is something to avoid. It is acceptable for point-to-point interfaces like serial or tunnel interfaces, but on broadcast media (such as Ethernet), it is "close to illegal" to use (regardless of whether the directly attached subnet is /25, /30 or /31).
If configuring the route this way is possible at all (I seem to remember that recent IOS and IOS-XE based routers don't allow it), the router will attempt ARP resolution of the destination IP address of the packet-to-be-forwarded.
Another (Cisco) router may respond to that request, if a) it has proxy arp enabled on the given interface [1] and b) it has a route to the actual destination.
However, also any other system on that broadcast domain may respond to that ARP broadcast, and could "attract" the traffic to itself (and may do all sorts of interesting things with it, since it just got itself into a man-in-the-middle position for free).
In short: Don't do it that way.
And while we're at it: don't use the first option either (unless you're on NX-OS). A properly configured static route looks like this:
ip route <destination network> <destination subnet mask> <egress interface> <next hop ip>
or - in your case
ip route 192.0.2.128 255.255.255.128 fastEthernet0/0 192.0.2.48
Reasoning: without the egress interface, a recursive route lookup is taking place to find an egress interface towards the given next hop. Most of the time, this will be an interface into a directly attached subnet.
However, some strange things may occur if that usually "up" interface into the next hop's (local) subnet goes down, and if the next hop's subnet is still learned via some dynamic routing protocol: then the given static route may not disappear from the routing table (and thus will continue to be redistributed into possibly present dynamic routing protocols, leading to all sorts of strange effects).
Not so if the egress interface is given. If that goes down, the static route vanishes from the routing table, in all cases.
[1] ceterum censeo: proxy arp should be disabled wherever one encounters it (unless it's really, really, really needed).
edited 5 hours ago
psmears
24115
24115
answered 15 hours ago
Marc 'netztier' LuethiMarc 'netztier' Luethi
3,872420
3,872420
Thank you very much for that clear and detailed answer !
– Nakrule
9 hours ago
To be fair, the man-in-the-middle situation you describe is always possible with ARP - it's always a broadcast followed by a race-to-reply.
– psmears
8 hours ago
add a comment |
Thank you very much for that clear and detailed answer !
– Nakrule
9 hours ago
To be fair, the man-in-the-middle situation you describe is always possible with ARP - it's always a broadcast followed by a race-to-reply.
– psmears
8 hours ago
Thank you very much for that clear and detailed answer !
– Nakrule
9 hours ago
Thank you very much for that clear and detailed answer !
– Nakrule
9 hours ago
To be fair, the man-in-the-middle situation you describe is always possible with ARP - it's always a broadcast followed by a race-to-reply.
– psmears
8 hours ago
To be fair, the man-in-the-middle situation you describe is always possible with ARP - it's always a broadcast followed by a race-to-reply.
– psmears
8 hours ago
add a comment |
Thanks for contributing an answer to Network Engineering Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fnetworkengineering.stackexchange.com%2fquestions%2f57055%2fhow-a-router-know-where-to-send-a-packet-with-the-exit-interface-route-command%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown