IP Directed-Broadcast on Cisco IOS

Routers normally don’t forward any broadcast traffic that they receive on an interface on any other interfaces. There are however some exceptions to this rule.

When it comes to IP broadcasting, there are two types:

  • The special “this network” broadcast address 255.255.255.255. This can be used to reach all devices within the subnet.
  • The subnet broadcast address. For example 192.168.1.255/24 (last IP address in the subnet).

The subnet broadcast address is also called the IP directed broadcast. It’s the broadcast address of a specific subnet. When you try to send something to the broadcast address of another subnet, the router will drop it. This is however something we can change…

Let’s look at an example:

r1 sending directed broadcast

Above we have three routers, R1 is sending an IP packet with its own address as the source and the destination address is the broadcast address of subnet 192.168.23.255. When R2 receives this packet, it will not broadcast it on its FastEthernet0/1 interface.

Let’s configure these routers so we can debug this IP packet. I’ll also show you how to configure R2 so that it will forward the broadcast.

Routers normally don't forward any broadcast traffic that they receive on an interface on any other interfaces. There are however some exceptions to this rule. When it comes to IP broadcasting, there are two types: The special "this network" broadcast address 255.255.255.255. This can be used to rea

R1 and R3 have a default route so they can reach each other:

R1(config-if)#ip route 0.0.0.0 0.0.0.0 192.168.12.2
R3(config-if)#ip route 0.0.0.0 0.0.0.0 192.168.23.2

Before we send any packets, let’s enable IP packet debugging on all routers:

R1, R2 & R3
#debug ip packet 
IP packet debugging is on

Let’s send that packet from R1:

R1#ping 192.168.23.255
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.255, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 ms

It seems R1 is receiving a reply to its packet. Here’s the packet that R1 sent:

R1#
IP: s=192.168.12.1 (local), d=192.168.23.255 (FastEthernet0/0), len 100, sending

And here’s the reply that it receives:

R1#
s=192.168.12.2 (FastEthernet0/0), d=192.168.12.1 (FastEthernet0/0), len 100, rcvd 3

As you can see above, R2 is replying to this packet that R1 sent. We are not getting a reply from R3 however. This is because R2 is not forwarding the broadcast which we can verify with the following command:

R2#show ip interface FastEthernet 0/1 | include broadcast
  Directed broadcast forwarding is disabled

Directed broadcast forwarding is disabled by default on all interfaces. Let’s enable it:

R2(config)#interface FastEthernet 0/1
R2(config-if)#ip directed-broadcast

Let’s send another ping from R1:

R1#ping 192.168.23.255 repeat 1
Type escape sequence to abort.
Sending 1, 100-byte ICMP Echos to 192.168.23.255, timeout is 2 seconds:
!
Success rate is 100 percent (1/1), round-trip min/avg/max = 8/8/8 ms

Here’s the packet again that is sent by R1:

R1#
IP: s=192.168.12.1 (local), d=192.168.23.255 (FastEthernet0/0), len 100, sending

Here’s what R2 will do once it receives the packet:

R2#
IP: tableid=0, s=192.168.12.1 (FastEthernet0/0), d=192.168.23.255 (FastEthernet0/1), routed via RIB
IP: s=192.168.12.1 (FastEthernet0/0), d=192.168.23.255 (FastEthernet0/1), g=255.255.255.255, len 100, forward directed broadcast
IP: s=192.168.12.1 (FastEthernet0/0), d=255.255.255.255 (FastEthernet0/1), len 100, sending full packet

Once R2 receives the IP packet from R1, it forwards it as a broadcast on its FastEthernet0/1 interface. The destination address is changed to 255.255.255.255.

Here’s what happens when R3 receives it:

R3#
IP: s=192.168.12.1 (FastEthernet0/0), d=255.255.255.255, len 100, rcvd 2
IP: s=192.168.23.3 (local), d=192.168.12.1 (FastEthernet0/0), len 100, sending

R3 receives the packet and decides to reply to it. R1 now receives two replies:

R1#
IP: s=192.168.12.2 (FastEthernet0/0), d=192.168.12.1 (FastEthernet0/0), len 100, rcvd 3
IP: s=192.168.23.3 (FastEthernet0/0), d=192.168.12.1 (FastEthernet0/0), len 100, rcvd 3

Excellent, our broadcast IP packet is now forwarded. If we want, we could change the broadcast address however. Right now R2 is changing the destination to 255.255.255.255 but we can also use the subnet broadcast address. Let’s try it:

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You’ve Ever Spent on Your Cisco Career!
  • Full Access to our 707 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

468 Sign Ups in the last 30 days

satisfaction-guaranteed
100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Tags: ,


Forum Replies

  1. Great video! in which scenario would you ever use this feature?

  2. Hi Tae Wo K,

    Perhaps for some old legacy application that only uses broadcast traffic. It’s unlikely that you would need this nowadays.

    Rene

Ask a question or join the discussion by visiting our Community Forum