IP Helper Commands
Use these commands to configure and monitor the IP Helper agent.
This section describes the commands to configure and monitor the IP Helper agent. IP Helper relays DHCP and other broadcast UDP packets from a local client to one or more servers which are not on the same network as the client.
The IP Helper feature provides a mechanism that allows a router to forward certain configured UDP broadcast packets to a particular IP address. This allows various applications to reach servers on nonlocal subnets, even if the application was designed to assume a server is always on a local subnet and uses broadcast packets (with either the limited broadcast address 255.255.255.255, or a network directed broadcast address) to reach the server.
The network administrator can configure relay entries both globally and on routing interfaces. Each relay entry maps an ingress interface and destination UDP port number to a single IPv4 address (the helper address). The network administrator may configure multiple relay entries for the same interface and UDP port, in which case the relay agent relays matching packets to each server address. Interface configuration takes priority over global configuration. That is, if a packet’s destination UDP port matches any entry on the ingress interface, the packet is handled according to the interface configuration. If the packet does not match any entry on the ingress interface, the packet is handled according to the global IP helper configuration.
The network administrator can configure discard relay entries, which direct the system to discard matching packets. Discard entries are used to discard packets received on a specific interface when those packets would otherwise be relayed according to a global relay entry. Discard relay entries may be configured on interfaces, but are not configured globally.
In addition to configuring the server addresses, the network administrator also configures which UDP ports are forwarded. Certain UDP port numbers can be specified by name in the UI as a convenience, but the network administrator can configure a relay entry with any UDP port number. The network administrator may configure relay entries that do not specify a destination UDP port. The relay agent assumes these entries match packets with the UDP destination ports listed in the following table. This is the list of default ports.
| Protocol | UDP Port Number |
|---|---|
| IEN-116 Name Service | 42 |
| DNS | 53 |
| NetBIOS Name Server | 137 |
| NetBIOS Datagram Server | 138 |
| TACACS Server | 49 |
| Time Service | 37 |
| DHCP | 67 |
| Trivial File Transfer Protocol (TFTP) | 69 |
The system limits the number of relay entries to four times the maximum number of routing interfaces. The network administrator can allocate the relay entries as he likes. There is no limit to the number of relay entries on an individual interface, and no limit to the number of servers for an interface and UDP port pair.
The relay agent relays DHCP packets in both directions. It relays broadcast packets from the client to one or more DHCP servers, and relays to the client packets that the DHCP server unicasts back to the relay agent. For other protocols, the relay agent only relays broadcast packets from the client to the server. Packets from the server back to the client are assumed to be unicast directly to the client. Because there is no relay in the return direction for protocols other than DHCP, the relay agent retains the source IP address from the original client packet. The relay agent uses a local IP address as the source IP address of relayed DHCP client packets.
When a switch receives a broadcast UDP packet on a routing interface, the relay agent checks if the interface is configured to relay the destination UDP port. If so, the relay agent unicasts the packet to the configured server IP addresses. Otherwise, the relay agent checks if there is a global configuration for the destination UDP port. If so, the relay agent unicasts the packet to the configured server IP addresses. Otherwise the packet is not relayed. Note that if the packet matches a discard relay entry on the ingress interface, then the packet is not forwarded, regardless of the global configuration.
The relay agent only relays packets that meet the following conditions:
- The destination MAC address must be the all-ones broadcast address (FF:FF:FF:FF:FF:FF).
- The destination IP address must be the limited broadcast address (255.255.255.255) or a directed broadcast address for the receive interface.
- The IP time-to-live (TTL) must be greater than 1.
- The protocol field in the IP header must be UDP (17).
- The destination UDP port must match a configured relay entry.
ip helper-address (Global Config)
M4250
M4350
Use this command to configure the relay of certain UDP broadcast packets received on any interface. This command can be invoked multiple times, either to specify multiple server addresses for a specified UDP port number or to specify multiple UDP port numbers handled by a specific server.
| Default | No helper addresses are configured. |
| Format | ip helper-address server-address [dest-udp-port | dhcp | domain | isakmp | mobile-ip | nameserver | netbios-dgm | netbios-ns | ntp | pim-auto-rp | rip | tacacs | tftp | time] |
| Mode | Global Config |
| Parameter | Description |
|---|---|
| server-address | The IPv4 unicast or directed broadcast address to which relayed UDP broadcast packets are sent. The server address cannot be an IP address configured on any interface of the local router. |
| dest-udp-port | A destination UDP port number from 0 to 65535. |
| port-name |
As an option, you can specify the destination UDP port by its name. Whether you specify a port by its number or its name does not matter for the configuration. The names recognized are as follows:
Other ports must be specified by number. |
Command example:
The following example relays DHCP packets that are received on any interface to two DHCP servers, 10.1.1.1 and 10.1.2.1:
(NETGEAR Switch)#config
(NETGEAR Switch)(config)#ip helper-address 10.1.1.1 dhcp
(NETGEAR Switch)(config)#ip helper-address 10.1.2.1 dhcp
Command example:
The following example relays UDP packets that are received on any interface for all default ports to the server at 20.1.1.1:
(NETGEAR Switch)#config
(NETGEAR Switch)(config)#ip helper-address 20.1.1.1
no ip helper-address (Global Config)
Use the no ip helper-address command to delete an IP helper entry. Use the command without any arguments to clear all global IP helper addresses.
| Format | no ip helper-address [server-address] [dest-udp-port | dhcp | domain | isakmp | mobile-ip | nameserver | netbios-dgm | netbios-ns | ntp | pim-auto-rp | rip | tacacs | tftp | time] |
| Mode | Global Config |
ip helper-address (Interface Config)
M4250
M4350
Use this command to configure the relay of certain UDP broadcast packets received on a specific interface or range of interfaces. This command can be invoked multiple times on a routing interface, either to specify multiple server addresses for a specified port number or to specify multiple port numbers handled by a specific server.
| Default | No helper addresses are configured. |
| Format | ip helper-address {server-address | discard} [dest-udp-port | dhcp | domain | isakmp | mobile-ip | nameserver | netbios-dgm | netbios-ns | ntp | pim-auto-rp | rip | tacacs | tftp | time] |
| Mode | Interface Config |
| Parameter | Description |
|---|---|
| server-address | The IPv4 unicast or directed broadcast address to which relayed UDP broadcast packets are sent. The server address cannot be in a subnet on the interface where the relay entry is configured, and cannot be an IP address configured on any interface of the local router. |
| discard | Matching packets should be discarded rather than relayed, even if a global ip helper-address configuration matches the packet. |
| dest-udp-port | A destination UDP port number from 0 to 65535. |
| port-name |
As an option, you can specify the destination UDP port by its name. Whether you specify a port by its number or its name does not matter for the configuration. The names recognized are as follows:
Other ports must be specified by number. |
Command example:
The following example relays DHCP packets that are received on interface 1/0/2 to two DHCP servers, 192.168.10.1 and 192.168.20.1:
(NETGEAR Switch)#config
(NETGEAR Switch)(config)#interface 1/0/2
(NETGEAR Switch)(interface 1/0/2)#ip helper-address 192.168.10.1 dhcp
(NETGEAR Switch)(interface 1/0/2)#ip helper-address 192.168.20.1 dhcp
Command example:
The following example relays DHCP and DNS packets to 192.168.30.1:
(NETGEAR Switch)#config
(NETGEAR Switch)(config)#interface 1/0/2
(NETGEAR Switch)(interface 1/0/2)#ip helper-address 192.168.30.1 dhcp
(NETGEAR Switch)(interface 1/0/2)#ip helper-address 192.168.30.1 dns
Command example:
The following example takes precedence over the ip helper-address command that you enter in global configuration mode. With the following configuration, the relay agent relays DHCP packets that are received on any interface other than 1/0/2 and 1/0/17 to 192.168.40.1, relays DHCP and DNS packets that are received on 1/0/2 to 192.168.40.2, relays SNMP traps (port 162) that are received on interface 1/0/17 to 192.168.23.1, and drops DHCP packets that are received on 1/0/17:
(NETGEAR Switch)#config
(NETGEAR Switch)(config)#ip helper-address 192.168.40.1 dhcp
(NETGEAR Switch)(config)#interface 1/0/2
(NETGEAR Switch)(interface 1/0/2)#ip helper-address 192.168.40.2 dhcp
(NETGEAR Switch)(interface 1/0/2)#ip helper-address 192.168.40.2 domain
(NETGEAR Switch)(interface 1/0/2)#exit
(NETGEAR Switch)(config)#interface 1/0/17
(NETGEAR Switch)(interface 1/0/17)#ip helper-address 192.168.23.1 162
(NETGEAR Switch)(interface 1/0/17)#ip helper-address discard dhcp
no ip helper-address (Interface Config)
Use this command to delete a relay entry on an interface. The command without any arguments clears all helper addresses on the interface.
| Format | no ip helper-address [server-address | discard] [dest-udp-port | dhcp | domain | isakmp | mobile-ip | nameserver | netbios-dgm | netbios-ns | ntp | pim-auto-rp | rip | tacacs | tftp | time] |
| Mode | Interface Config |
ip helper enable
M4250
M4350
Use this command to enable relay of UDP packets. This command can be used to temporarily disable IP helper without deleting all IP helper addresses. This command replaces the bootpdhcprelay enable command, but affects not only relay of DHCP packets, but also relay of any other protocols for which an IP helper address has been configured.
| Default | disabled |
| Format | ip helper enable |
| Mode | Global Config |
Command example:
(NETGEAR Switch)(config)#ip helper enable
no ip helper enable
Use the no form of this command to disable relay of all UDP packets.
| Format | no ip helper enable |
| Mode | Global Config |
show ip helper-address
M4250
M4350
Use this command to display the IP helper address configuration.
To specify an actual interface or port, do the following:
- For an M4250 series switch, use the argument slot/port.
- For an M4350 series switch, use the argument unit/slot/port, as shown in the command description and format.
The argument unit/slot/port corresponds to a physical routing interface or VLAN routing interface. The vlan keyword and vlan-id parameter are used to specify the VLAN ID of the routing VLAN. The vlan-id can be a number from 1–4093.
| Format | show ip helper-address [unit/slot/port | vlan vlan-id] |
| Mode | Privileged EXEC |
| Parameter | Description |
|---|---|
| interface | The relay configuration is applied to packets that arrive on this interface. This field is set to any for global IP helper entries. |
| UDP Port | The relay configuration is applied to packets whose destination UDP port is this port. Entries whose UDP port is identified as any are applied to packets with the destination UDP ports listed in Table 4. |
| Discard | If Yes, packets arriving on the interface with the specified destination UDP port are discarded rather than relayed. Discard entries are used to override global IP helper address entries which otherwise might apply to a packet. |
| Hit Count | The number of times the IP helper entry has been used to relay or discard a packet. |
| Server Address | The IPv4 address of the server to which packets are relayed. |
Command example:
(NETGEAR Switch) #show ip helper-address
IP helper is enabled
Interface UDP Port Discard Hit Count Server Address
--------------- ----------- -------- ---------- ---------------
1/0/1 dhcp No 10 10.100.1.254
1/0/17 any Yes 2 10.100.2.254
show ip helper statistics
M4250
M4350
Use this command to display the number of DHCP and other UDP packets processed and relayed by the UDP relay agent.
| Format | show ip helper statistics |
| Mode | Privileged EXEC |
| Parameter | Description |
|---|---|
| DHCP client messages received | The number of valid messages received from a DHCP client. The count is only incremented if IP helper is enabled globally, the ingress routing interface is up, and the packet passes a number of validity checks, such as having a TTL>1 and having valid source and destination IP addresses. |
| DHCP client messages relayed | The number of DHCP client messages relayed to a server. If a message is relayed to multiple servers, the count is incremented once for each server. |
| DHCP server messages received | The number of DHCP responses received from the DHCP server. This count only includes messages that the DHCP server unicasts to the relay agent for relay to the client. |
| DHCP server messages relayed | The number of DHCP server messages relayed to a client. |
| UDP clients messages received | The number of valid UDP packets received. This count includes DHCP messages and all other protocols relayed. Conditions are similar to those for the first statistic in this table. |
| UDP clients messages relayed | The number of UDP packets relayed. This count includes DHCP messages relayed as well as all other protocols. The count is incremented for each server to which a packet is sent. |
| DHCP message hop count exceeded max | The number of DHCP client messages received whose hop count is larger than the maximum allowed. The maximum hop count is a configurable value listed in show bootpdhcprelay. A log message is written for each such failure. The DHCP relay agent does not relay these packets. |
| DHCP message with secs field below min | The number of DHCP client messages received whose secs field is less than the minimum value. The minimum secs value is a configurable value and is displayed in show bootpdhcprelay. A log message is written for each such failure. The DHCP relay agent does not relay these packets. |
| DHCP message with giaddr set to local address | The number of DHCP client messages received whose gateway address, giaddr, is already set to an IP address configured on one of the relay agent’s own IP addresses. In this case, another device is attempting to spoof the relay agent’s address. The relay agent does not relay such packets. A log message gives details for each occurrence. |
| Packets with expired TTL | The number of packets received with TTL of 0 or 1 that might otherwise have been relayed. |
| Packets that matched a discard entry | The number of packets ignored by the relay agent because they match a discard relay entry. |
Command example:
(NETGEAR Switch)#show ip helper statistics
DHCP client messages received.................. 8
DHCP client messages relayed................... 2
DHCP server messages received.................. 2
DHCP server messages relayed................... 2
UDP client messages received................... 8
UDP client messages relayed.................... 2
DHCP message hop count exceeded max............ 0
DHCP message with secs field below min......... 0
DHCP message with giaddr set to local address.. 0
Packets with expired TTL....................... 0
Packets that matched a discard entry........... 0
clear ip helper statistics
M4250
M4350
Use this command to reset to zero the statistics displayed in the output of the show ip helper statistics command.
| Format | clear ip helper statistics |
| Mode | Privileged EXEC |
Command example:
(NETGEAR Switch) #clear ip helper statistics