Will router forward a packet through the same interface it received from?

Answered Question
Nov 18th, 2007

Hello All,

Need your help on understanding a basic functionality of a router.

Question

Will router forward packets on the same interface it received from i.e. say

a packet received on ethernet interface,it looks up routing table and determines that it needs to be sent back on same interface.

Hope the answer to above question will also explain the working principle of the following network.

Internet

|

firewall

|

Switch--router-->it can reach a few subnets

|

PCs

PC are configured with router interface as gateway and a static default route on router pointing towards firewall's interface.

Thanks in advance for your time.

I have this problem too.
0 votes
Correct Answer by Richard Burts about 9 years 1 week ago

To add a little bit to the answer from Paul, IOS routers do not have any restriction about forwarding packets out the interface that they were received on. Note that the default behavior of PIX and of ASA is different and by default they will not forward back out the interface on which the packet was received. In recent versions of code for PIX and ASA it is possible to over-ride this behavior and to enable forwarding back out the same interface.

One example may help understand a situation where a router forwards back out the same interface: assume that some PCs are configure in one subnet (perhaps 172.16.1.0/24) and some other PCs are configured in a different subnet (perhaps 172.16.51.0/24) and the router is configured with a primary interface address of 172.16.1.1 and with a secondary address of 172.16.51.1, then a PC at address 172.16.1.87 attempting to get to address 172.16.51.99 would forward to its default gateway at 172.16.1.1. The router would receive this and would forward back out the same interface to reach 172.16.51.99. So secondary addressing is one of the common situations where a router might forward back out the same interface.

HTH

Rick

Correct Answer by paul.matthews about 9 years 1 week ago

Yes, a router can forward a packet out of the received interface.

I presume the firewall and PCs are all in the same subnet? If so, any traffic that needs to go to the firewall will be forwarded by te ruter to the firewall. The exact behaviour depends upon how the router is configured, and how the PCs behave.

If the router has HSRP configured, it will just forward the packets to the router. If the router is a single router and no HSRP, then when the router revieves a packet that needs to go to the firewall, it will forward the packet and send an ICMP redirect to the PC, effectively saying to the PC to send that traffic direct, as that is a better route. That behaviour can be disabled.

P.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
mahmoodmkl Sun, 11/18/2007 - 22:33

Hi

The router forwards the traffic at layer 3.

The pc will not send any traffic to the router unless it is destined for remote networks.

If it is destined for remote network it will be forwarded to the default gateway configured in the PC i.e u r router.When the router recieves this packet it looks up for the destination address and does a route lookup in its routing table and determines the exit interface through which it can reach the network for which the packet is destined and forwards it.

Thanks

Mahmood

Correct Answer
paul.matthews Mon, 11/19/2007 - 00:29

Yes, a router can forward a packet out of the received interface.

I presume the firewall and PCs are all in the same subnet? If so, any traffic that needs to go to the firewall will be forwarded by te ruter to the firewall. The exact behaviour depends upon how the router is configured, and how the PCs behave.

If the router has HSRP configured, it will just forward the packets to the router. If the router is a single router and no HSRP, then when the router revieves a packet that needs to go to the firewall, it will forward the packet and send an ICMP redirect to the PC, effectively saying to the PC to send that traffic direct, as that is a better route. That behaviour can be disabled.

P.

Correct Answer
Richard Burts Mon, 11/19/2007 - 04:57

To add a little bit to the answer from Paul, IOS routers do not have any restriction about forwarding packets out the interface that they were received on. Note that the default behavior of PIX and of ASA is different and by default they will not forward back out the interface on which the packet was received. In recent versions of code for PIX and ASA it is possible to over-ride this behavior and to enable forwarding back out the same interface.

One example may help understand a situation where a router forwards back out the same interface: assume that some PCs are configure in one subnet (perhaps 172.16.1.0/24) and some other PCs are configured in a different subnet (perhaps 172.16.51.0/24) and the router is configured with a primary interface address of 172.16.1.1 and with a secondary address of 172.16.51.1, then a PC at address 172.16.1.87 attempting to get to address 172.16.51.99 would forward to its default gateway at 172.16.1.1. The router would receive this and would forward back out the same interface to reach 172.16.51.99. So secondary addressing is one of the common situations where a router might forward back out the same interface.

HTH

Rick

Actions

This Discussion