cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6935
Views
0
Helpful
3
Replies

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

padramas
Cisco Employee
Cisco Employee

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.

2 Accepted Solutions

Accepted Solutions

paul.matthews
Level 5
Level 5

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.

View solution in original post

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

HTH

Rick

View solution in original post

3 Replies 3

mahmoodmkl
Level 7
Level 7

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

paul.matthews
Level 5
Level 5

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.

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

HTH

Rick
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card