Generating layer-2 broadcast from a regular IP packet

The Wake-on-LAN discussion we had a while ago brought us nowhere; there's simply no way to generate UDP packets on the router. I thought I could use Application Performance Monitor's Tcl scripts to generate the packet, but it looks like APM has been removed from recent IOS releases (and it's not clear whether you can use APM without a peer router).

The discussion nonetheless had an interesting side effect. Robert Turnšek sent me an interesting trick: with static ARP you can generate layer-2 broadcasts with a layer-3 unicast packet.

Let's assume your LAN has IP prefix 10.2.3.0/24 and you want to use 10.2.3.77 as the IP address that will generate MAC-layer broadcasts (you need to give this address to a WOL program). Configure arp 10.2.3.77 FFFF.FFFF.FFFF and you're done.

You might wonder how this technique differs from directed subnet broadcast. The important difference is that although every IP host on the subnet will receive the layer-2 broadcast, they will ignore the packet since it's not addressed to them. This solution is thus not vulnerable to the smurf attack.

3 comments:

  1. To achieve this goal I use "update arp" in dhcp pool. The same result but simpler management.

    ReplyDelete
  2. Hi,

    this is the way i tested the Layer 2 Feature Stormcontrol Broadcast in NFRU Tests on every customer site with IPerf ;-)

    HTH

    ReplyDelete
  3. @Anonymous#1: this is not "arp security", it's a completely different problem (changing L3 unicast into L2 broadcast). How would you apply "update arp" to solve this problem?

    @Anonymous#2: thanks for the tip!

    @Anonymous#*: would you please consider using at least an alias, so I don't have to sequence-number the responses :)

    ReplyDelete

You don't have to log in to post a comment, but please do provide your real name/URL. Anonymous comments might get deleted.

Ivan Pepelnjak, CCIE#1354, is the chief technology advisor for NIL Data Communications. He has been designing and implementing large-scale data communications networks as well as teaching and writing books about advanced technologies since 1990. See his full profile, contact him or follow @ioshints on Twitter.