The IP Helper address forwards a broadcast to a single specified IP. Before using the IP Helper command, you must first change the interface to prepare the router to relay broadcasts.
The command is as follows:
Switch# conf t Switch(config)#interface Fa0/1 Switch(config-if)#ip helper-address 192.168.1.254 Switch(config-if)#end Switch#wr mem
This will configure the router to forward several UDP protocols, like DNS and BOOTP.
You can prevent the router from forwarding traffic by using the ip forward-protocol to block any or all UDP ports:
Switch(config)#conf t Switch(config)#ip forward-protocol udp 517 Switch(config)#no ip forward-protocol udp 37 Switch(config)#no ip forward-protocol udp 49 Switch(config)#no ip forward-protocol udp 137 Switch(config)#no ip forward-protocol udp 138 Switch(config)#end Switch' wr mem
All these commands need to be typed in Global Configuration interface. You can block all services to block forwarding completely, or you can block a few and keep a few open, according to your needs.
Supported UDP services
By default, the IP Helper address command forwards 8 UDP services:
What if you need a service that isn’t included in these default 8 UDP services? You can use the ip forward-protcol command, along with the port number, to create a new UDP service. For example, if your UDP service was located on port 139, you can use the following command:
Switch#conf t Switch(config)#ip forward-protocol udp 139