Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Source IP and MAC address

2 PC's connected by 2 routers in between. PC1 sends to PC2. When the data reaches PC2 what is the source MAC and IP. Is it the closest router to 2? Is it the IP of PC1 and MAC of router2? Been digging through my Cisco press books and cannot find it. Please let me know if further clarification is needed of the example.

6 REPLIES
Hall of Fame Super Blue

Re: Source IP and MAC address

Hi

PC1 -> R1 -> (fa0/1) R2 (fa0/0) -> PC2

When data reaches PC2

source Mac address = R2 fa0/0

source IP address = PC1

Source and destination IP address do not change (unless your are Natting somewhere).

Source and destaintion mac-addresses change at each layer 3 hop.

HTH

Jon

New Member

Re: Source IP and MAC address

Had a feeling that was it, just wanted to confirm. Thank-you !

New Member

Re: Source IP and MAC address

So the following is true?

PC1 -> SW1 -> R1 (gateway) -> SW2 > PC2

PC1 sends an IP packet to PC2 with source IP of PC1 and destination IP of PC2.

It is framed on Ethernet by PC1 NIC with souce MAC of PC1 but destination MAC of... R1?

SW1 has R1's MAC in it's MAC-Addr table so forwards the unicast out the port to R1. No changes to anyone's MAC or IP addresses.

When packet reaches R1, it strips of the layer 2 frame (with old src MAC of PC1 and dest MAC of R1) routes it out Ethernet port toward PC2 with PC2's destination MAC and IP addresses but with R1's source IP and MACs?

SW2 again leaves IP and MAC addresses untouched?

Hall of Fame Super Blue

Re: Source IP and MAC address

Hi

Yes to all of that. SW2 will not rewrite either the mac-address or the IP address. Just for completeness

when PC1 sends packet to PC2 the destination mac-address is the mac-address of the interface on R1 that connects to the PC1 network. When R1 sends the frame out to PC2 the source mac-address is now the mac-address of the interface on R1 that connects to PC2 network.

HTH

Jon

New Member

Re: Source IP and MAC address

Are you sure everything is true? My statement asked if R1 changed the source IP of the packet fowarded out the ethernet port connected to PC2's LAN to R1's IP address on the interface connected to the PC2 LAN.

Sounds like the source and destination IP addresses never change. If they did, then how would an ICMP packet ever make it back to PC1?

Hall of Fame Super Blue

Re: Source IP and MAC address

Oops, sincere apologies, i read it a bit too quick for my own good. As i said in my original answer the source and destination IP addresses never change (NAT aside) so you are correct in this post in that R1 will not change the IP addresses at all just the mac-addresses.

Jon

491
Views
9
Helpful
6
Replies