Cisco Interfaces and MAC Address

lon21lon21 Member Posts: 201
I'm just reading how a packets gets sent across a remote network.

It says that when host A send a packet to host A the destination hardware address used is the default gateways's ethernet interface.

Does that mean to say, that a switch with 24 ports will have 24 MAC address assigned to each interface and that a router with 4 interfaces will have 4 MAC address assigned to each interface?
If this was the case then when host A does a ARP to the router the router would send out the MAC address on the interface on which is was received?

Also just to clarify, each mac address on a device is ONLY the device's mac address and not the host?

Thanks

Comments

  • lon21lon21 Member Posts: 201
    OK, I've done to further looking into and been thinking. I've concluded each interface on a Cisco device has each a MAC address. 24 ports = 24 mac address.

    If a ARP is sent from Host A for the default gateway's Mac address it would give you the router's interface MAC address of which Host A is connected too. :D
  • themagiconethemagicone Member Posts: 674
    You probably know this but remember that MAC address are layer 2. A host uses a ARP request for layer 2 address which then encases the packet in a frame. The frame is then forwarded to a switch. The switch will remember what MAC address there is on each port. If the MAC address isn't local it will forward it to the router who will then strip the frame and use layer 3 addressing. It then will forward the packet/frame with it's address as sender.

    MAC address on a switch can be static or dynamic. You can use MAC address as a form of port security. You can set it for it will only learn 1 (or more) MAC address and if you try to connect another device it will shut down the port.

    Make sense?
    Courses Completed at WGU: JIT2, LYT2, TFT2, SJT2, BFC2, TGT2, FXT2
    Courses Required For Me To Graduate WGU in MS: IT Network Managment: MCT2, LZT2, MBT1, MDT2, MNT2
    CU Done this term: 16 Total CU Done: 19
    Currently working on: Nothing Graduation Goal: 5/2013
  • hiddenknight821hiddenknight821 Member Posts: 1,209 ■■■■■■□□□□
    lon21 wrote: »
    OK, I've done to further looking into and been thinking. I've concluded each interface on a Cisco device has each a MAC address. 24 ports = 24 mac address.

    If a ARP is sent from Host A for the default gateway's Mac address it would give you the router's interface MAC address of which Host A is connected too. :D

    Your second statement is correct. However, your first statement is slightly incorrect. All switches have (number of interfaces) + an additional address. If you do the "show version" command, then you would notice the base MAC address. This is used for STP election process. The routers don't have one (don't need one for STP election), but it can use its interfaces if they are configured as "bridge."

    Just keep it simple. I am not sure where you got confused at. Let me set up a scenario where I can help you understand it better.

    Let's assume SwitchA's MAC address table is empty, and HostA is not yet connected to the network. HostA's ARP table is empty as well, but has its IP address, subnet mask, and default gateway properly configured. RouterA is connected to SwitchA's Fa0/24 interface. RouterA is connected to RouterB (another network). Now, I only need to cover how the packet transverses from HostA to one of RouterA's interfaces. So, how the packet gets to RouterB or another network can be covered later.
    1- HostA just connected to SwitchA's Fa0/1's interface.

    2- HostA attempts to send a datagram to the other network beyond RouterA using a destination IP address. When that happen, HostA sends an ARP broadcast.

    3- How did HostA determines to send an ARP request? Apparently, the ARP table is empty, and they have to send at least an ARP request to someone. To be more specific. The host uses the ANDing process comparing the destination address and the subnet mask with the host's IP address to determine whether the destination address is within the hostA's network.

    a) If sending the datagram outside of HostA's network, use the default gateway as the "targeted" address for the ARP request frame.

    b) Otherwise, use the current "targeted" address for the ARP request

    4- Obviously, the next step is that the default gateway on the network should perform an ARP reply. HostA would be asking "who has the IP of the default gateway? Please tell HostA." So, since the HostA is trying to send a datagram to a host on another network, HostA's MAC address would be listed in the MAC address table of SwitchA with Fa0/1 being the interface where HostA is located.

    5- SwitchA doesn't not know the MAC address of the default gateway, which is the RouterA's interface facing SwitchA. SwitchA has to flood the ARP request to all outgoing ports (except the incoming port) since the ARP request was a broadcast frame with the MAC address, FF:FF:FF:FF:FF:FF.

    6- Finally, the default gateway on RouterA picked up the ARP request, and replied with an unicast ARP reply using HostA as destination address this time.

    7- SwitchA receives an incoming ARP reply frame from the default gateway, and add the MAC address of the DG to the MAC address table with the Fa0/24 interface assigned to the entry.

    8- SwitchA then forward out the ARP reply frame out its Fa0/1 interface since the MAC address has HostA in its table.

    9- HostA then acknowledges the ARP reply frame, and add the MAC address of the default gateway to its ARP table so that it doesn't have to look for the gateway again.

    10- Now HostA is able to send a packet to the other network, encapsulating destination IP address in the Ethernet frame being forwarded to the DW.

    11- RouterA receives the frame, and strip off the Layer 2 header and encapsulate the packet again with a new Layer 2 header using RouterA interface (facing the other network)'s MAC address as the source address.

    Then you can figure out the rest at your own time as you are learning. I may be a little incorrect, since it has been a while for me to remember how this stuff work. Someone will correct me if I am wrong. So do not worry.
Sign In or Register to comment.