curious: since switch's ports have mac addresses....

kr0sys

n00b
Joined
Jun 10, 2004
Messages
41
..as I understand that they do. As a frame moves across the switch, does it forward the frame leaving the source and destination mac address intact as they are or does the switch replace the frame's source mac with the mac address of the switch port that the frame is exiting the switch on?

I've been left confused since I understand that routers leave the IP addresses intact, but replace the mac addys. Knowing that switch ports have mac addresses is this the same case?

thanks
 
The MAC addresses are left as-is. Otherwise the receiving computer wouldn't have a valid address to respond to. Besides, switch ports generally don't have MAC addresses; although the entire switch will have a MAC address if it's a managed switch.
 
The MAC addresses are left as-is. Otherwise the receiving computer wouldn't have a valid address to respond to. Besides, switch ports generally don't have MAC addresses; although the entire switch will have a MAC address if it's a managed switch.

Switch ports do have MAC Addresses:

Code:
FastEthernet0/2 is down, line protocol is down (notconnect)
  Hardware is Fast Ethernet, address is 000f.235b.4182 [b](bia 000f.235b.4182)[/b]

FastEthernet0/3 is down, line protocol is down (notconnect)
  Hardware is Fast Ethernet, address is 000f.235b.4183 [b](bia 000f.235b.4183)[/b]

That's from my 3500.

You're right though, the MACs shouldn't change when going through layer 2 devices. They change when going through layer 3 devices (routers).
 
I know the MAC address of the ports are used in the spanning tree root selection process. I also know that on older switches the identify of a port was its MAC address not some arbitrary number like port 1, or port 2. This comes into play when you have clients connected to the ports. There is a table of some sort that maps the port on the switch to the MAC address of the host connected to it. I am probably oversimplifying it, but thats basically how it does forwarding. Now the question is, is the MAC address of the switch-port used as the port identifier in the lookup table? I don't think it is anymore, but I could be very wrong on this....
 
They do? If I arp -a, I don't see them.

You wouldn't see them, they wouldn't be added to the table as you would never arp for their IPs (if they even have one configured). You also won't have the IP of a WAP in your ARP table when you're using wireless, but that doesn't mean it has no MAC or IP.
 
There is a table of some sort that maps the port on the switch to the MAC address of the host connected to it.

It's called a Source Address Table according to my awesome note-taking skills in lecture.

They do? If I arp -a, I don't see them.
As Vito_Corleone said, you wouldn't see it because ARP maps IP addresses to the respective MAC addresses.
 
Vito_Corleone said:
Never heard that before. Cisco refers to it as the MAC/CAM table.
My professor uses both "SAT" and "MAC Table" synonymously. I guess if we get the point is what matters. :p
 
You wouldn't see them, they wouldn't be added to the table as you would never arp for their IPs (if they even have one configured). You also won't have the IP of a WAP in your ARP table when you're using wireless, but that doesn't mean it has no MAC or IP.

I gave the vlan1 interface on one of these 2900xl's an ip address and pung it. An arp -a revealed the IP's MAC. The MAC that the switch gave to the vlan1 interface was different than the mac assigned to the switchport the packets traveled over, fa0/6. I'm guessing the switch has a large pool of MACs to choose from, at least as many for all the vlans it can support as well as any network layer interfaces it can support. My guess is thats a HUGE pool.

If an AP was assigned an IP, wouldnt the IP be assigned a MAC similar to the way this switch did it? Different than its link layer AP mac address I would think.

great discussion
 
You wouldn't see the MAC of the port you were connected to, you would see the MAC of the VLAN Interface. Here is the MAC of my VLAN 10 interface (SVI) on my 3550:

Code:
LAB_CORE#sh int vlan 10
Vlan10 is up, line protocol is up
  Hardware is EtherSVI, address is 000f.235b.4180 (bia 000f.235b.4180)

And here is my ARP table after pinging the address of the VLAN 10 Interface:

Code:
Internet Address      Physical Address      Type
192.168.10.6          00-0f-23-5b-41-80     dynamic

It matches.

APs should all have IPs so they can be managed, and anything with an IP will have a MAC. You won't see an AP in your ARP table because they are just bridges (like switches). But if you ping it, you should see the MAC associated with whatever interface you've pinged as your computer has sent out an ARP message looking for the MAC for that IP. Here's the same thing posted above, but with my WAP:

Code:
WAP#sh int bvi1
BVI1 is up, line protocol is up
  Hardware is BVI, address is 0016.c823.3b1c

Internet Address      Physical Address      Type
192.168.10.2          00-16-c8-23-3b-1c     dynamic

Does it make more sense?
 
I gave the vlan1 interface on one of these 2900xl's an ip address and pung it. An arp -a revealed the IP's MAC. The MAC that the switch gave to the vlan1 interface was different than the mac assigned to the switchport the packets traveled over, fa0/6. I'm guessing the switch has a large pool of MACs to choose from, at least as many for all the vlans it can support as well as any network layer interfaces it can support. My guess is thats a HUGE pool.

That is interesting. You should post the MAC addresses so we can check. Because the first 3 bytes of a MAC address correspond to a "vendor" (if I remember correctly) I would like to see what is assigned to the vlan interfaces just out of curiosity.

If an AP was assigned an IP, wouldnt the IP be assigned a MAC similar to the way this switch did it? Different than its link layer AP mac address I would think.

great discussion

I'm not exactly sure what you mean here. An IP address wouldn't be assigned a MAC address as far as I know. From what I remember they are totally separate layers, which means IP knows nothing of the underlying things that it sits upon. This is why IP has been implemented on things other than ethernet (I think).
 
APs should all have IPs so they can be managed, and anything with an IP will have a MAC. You won't see an AP in your ARP table because they are just bridges (like switches). But if you ping it, you should see the MAC associated with whatever interface you've pinged as your computer has sent out an ARP message looking for the MAC for that IP. Here's the same thing posted above, but with my WAP:

Are you saying that a physical port on an AP could serve two purposes, one purpose being able to communicate via IP for management of the AP, and the other purpose as being a typical bridge? That makes sense if that is what you are saying.

So if you want to access the AP for management you inciate an ARP for the IP of the of the AP, and the MAC address of the bridge port is returned and communication is established. For all other purposes your traffic is simply forwarded by the bridge. When traffic is forwarded by a bridge/switch it is not modified, which means that the packets forwarded retain their source and destination MAC addresses. The switch just takes packets in one physical port, makes a decision about what port the destination MAC of the frame is, and then sends it out that port.
 
A physical port on many devices can serve a multitude of purposes. In my WAP's case, it has one FastEthernet port that is used to pass all traffic and for management of the device.

An L3 switch can only be using one port (maybe Fa0/1), but doing tons of stuff with it. If it is routing, you could have it set as a host's default gateway, and if you're on the host you could ping any (virtual) interface it has that is up. For instance, if you are configured on VLAN 1 with a gateway of 192.168.1.1 (the switch's VLAN 1 interface), and the switch has 192.168.2.1 for VLAN 2, you could ping VLAN 2 (maybe 192.168.2.1), which should give you a different MAC in your ARP table, and get replies. You would still be using the same interface, but communicating with various IP/MAC addresses.

And yea, if a bridge/switch is just passing frames the Source and Destination MACs shouldn't be changed until they hit a layer 3 device.
 
I will have to check back in my notes, but the only time the MAC address for the physical ports is used is when you enable them for L3 (routing) services by assigning them and IP address and no switchport command.

I know there is a documented routine on how the switch chooses the addresses, but I am having trouble finding it right now.
 
Back
Top