1

I would want to buy a ethernet switch. But I have a question (maybe a noob's question...) that I can't find any answer on the forums... And I hope you will be able to answer. So if I buy an ethernet switch, connect it to network and connect 3pc to it (for instance), how many Mac adresses will be shown in output? For example, if the switch is connected to a router, how many Mac adresses will the router see? Just one, the switch 's Mac? Or each Mac adresses of any pc connected to the switch?

6
  • In what way is answering this question relevant to buying an Ethernet switch? Maybe if you explained what you were trying to do and why you need to know "how many MAC addresses" we could provide a better answer.
    – YLearn
    Sep 4, 2015 at 7:55
  • I'm behind a proxy which allow only 4 Mac adresses. I was wondering of by buying a switch I would be able to have more than 4 Mac adresses. Indeed proxy filters mac adresses. So we must declare our Mac adresses, 4 maximum. Declared Mac adresses are added by a network administrator to Whitelist. But I have more than 4 Mac adresses and I would want to connect all my devices. So my question is
    – frankee
    Sep 4, 2015 at 11:58
  • Based on your comment, you need a layer-3 device (router, layer-3 switch, etc.) between your switch and the proxy. This question is a little bit on the edge since you may be trying to circumvent the network policies of a network over which you have no control.
    – Ron Maupin
    Sep 4, 2015 at 14:58
  • @RonMaupin A Layer-2 bridge device capable of MAC NAT (e.g. every Linux machine) would also do this trick. Apr 1, 2017 at 12:11
  • You are confusing network layers. NAT happens at layer-3 or layer-4, but ethernet is at layer-2. Ethernet switches are transparent devices. They do not modify frames, except to add a VLAN tag on a trunk. What you want doesn't exist.
    – Ron Maupin
    Apr 1, 2017 at 12:32

2 Answers 2

2

A switch learns the MAC addresses connected to each one of its ports. For example:

  • Port 1 - Connected to PC -Learns 1 MAC on this port.

  • Port 2 - Connected to router - Learns 1 MAC on this port.

  • Port 3 - Connected to hub - learns as many MACs as PCs are connected to the hub.

The Switching table of the switch will be something like this:

     MAC              PORT
0f-aa-34-56            1
0a-17-40-12            2
09-11-11-11            3
05-65-23-59            3
0f-0a-71-62            3

The router on Port 2 will be able to communicate with any other PC (the PC on port 1 or any other one on Port 3) and works transparently. A switch can't modify mask or modify a MAC address.

The switch isolates ethernet collisions, so if a collsion happens on the hub , the router and the PC on Port 1 won't notice it.

4
  • OK so the router where the switch is connected will see all these Mac adresses? (switch connected to router)
    – frankee
    Sep 4, 2015 at 12:02
  • @frankee Yes. If you want to hide MAC adresses, use a router. The router removes the source MAC and replace it with its own MAC.
    – jcbermu
    Sep 4, 2015 at 12:05
  • Oook ! So for doing what I would want,I rather need a router. But the switch won't remove source Mac and replace them with its own, will it?
    – frankee
    Sep 4, 2015 at 12:09
  • @frankee A switch won't remove source Mac and replace them with its own. A router does that when is communicating different IP networks.
    – jcbermu
    Sep 4, 2015 at 12:59
1

In your question. If a router is connected directly with a switch, must know all the addresses that for some point, communicate with him. In th other hand, the switch always must show you 2 mac address per port, the port MAC, and the MAC of the NIC connected to him. This one, will be stored, by default, 300 seconds.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.