Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Cisco Catalyst 2960-s, I want to configure user defined macros on it. I searched a lot in Cisco documentation but its not for beginners :(

  • How to create a user defined macro that runs when a device is connected on a port?
  • How to test the IP address of the connected device on an interface ?
  • How to block traffic on an interface without shutting it down?

Any ideas about how to do that??

share|improve this question
Can you give an example of what you want the macro to do when a device is connected? – Mike Pennington Sep 3 '13 at 0:37
The macro should compare the IP address of the connected device with if its different it will block the traffic. NB: 1. I don't use DHCP server, so addresses are set manually. 2. On each port i want to allow only one predefined IP address. – Ould Abba Sep 3 '13 at 11:14
There is a little bit of a problem here... the 2960S is a only a layer2 switch, it has no knowledge of IP addresses unless you enable something like IP Source Guard. How are you proposing that the switch would know that a port has an attached host that is – Mike Pennington Sep 5 '13 at 9:21
That's true its only L2 switch. But assuming I want to compare the mac address of the connected device and not its IP, can you give me a 'Hello word' macro? – Ould Abba Sep 5 '13 at 12:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.