Previous Topic

Next Topic

Book Contents

IP Routing Commands

This section describes the commands you use to enable and configure IP routing on the switch.

routing

This command enables IPv4 and IPv6 routing for an interface. You can view the current value for this function with the show ip brief command. The value is labeled as “Routing Mode.”

no routing

This command disables routing for an interface. You can view the current value for this function with the show ip brief command. The value is labeled as “Routing Mode.”

ip routing

This command enables the IP Router Admin Mode for the master switch.

no ip routing

This command disables the IP Router Admin Mode for the master switch.

ip address

This command configures an IP address on an interface. You can also use this command to configure one or more secondary IP addresses on the interface.The value for <ipaddr> is the IP address of the interface. The value for <subnetmask> is a 4-digit dotted-decimal number which represents the subnet mask of the interface. The subnet mask must have contiguous ones and be no longer than 30 bits, for example 255.255.255.0. This command adds the label IP address in show ip interface.

no ip address

This command deletes an IP address from an interface. The value for <ipaddr> is the IP address of the interface. The value for <subnetmask> is a 4-digit dotted-decimal number which represents the Subnet Mask of the interface.

ip address dhcp

This command enables the DHCPv4 client on an in-band interface so that it can acquire network information, such as the IP address, subnet mask, and default gateway, from a network DHCP server. When DHCP is enabled on the interface, the system automatically deletes all manually configured IPv4 addresses on the interface.

no ip address dhcp

This command releases a leased address and disables DHCPv4 on an interface.

ip default-gateway

This command manually configures a default gateway for the switch. Only one default gateway can be configured. If you invoke this command multiple times, each command replaces the previous value.

no ip default-gateway

This command removes the default gateway address from the configuration.

release dhcp

Use this command to force the DHCPv4 client to release the leased address from the specified interface.

renew dhcp

Use this command to force the DHCPv4 client to immediately renew an IPv4 address lease on the specified interface.

NOTE: This command can be used on in-band ports as well as the service or network (out-of-band) port.

renew dhcp network-port

Use this command to renew an IP address on a network port.

renew dhcp service-port

Use this command to renew an IP address on a service port.

ip route

This command configures a static route. The <ipaddr> parameter is a valid network address, and <subnetmask> is a valid subnet mask. The <nexthopip> parameter is a valid IP address of the next hop router. The optional <preference> parameter is an integer (value from 1 to 255) that allows you to specify the preference value (sometimes called “administrative distance”) of an individual static route. Among routes to the same destination, the route with the lowest preference value is the route entered into the forwarding database. By specifying the preference of a static route, you control whether a static route is more or less preferred than routes from dynamic routing protocols. The preference also controls whether a static route is more or less preferred than other static routes to the same destination. A route with a preference of 255 cannot be used to forward traffic. For the static routes to be visible, you must perform the following steps:

  1. Enable ip routing globally.
  2. Enable ip routing for the interface.
  3. Confirm that the associated link is also up.

no ip route

This command deletes a single next hop to a destination static route. If you use the <nexthopip> parameter, the next hop is deleted. If you use the <preference> value, the preference value of the static route is reset to its default.

ip route default

This command configures the default route. The value for <nexthopip> is a valid IP address of the next hop router. The <preference> is an integer value from 1 to 255. A route with a preference of 255 cannot be used to forward traffic.

no ip route default

This command deletes all configured default routes. If the optional <nexthopip> parameter is designated, the specific next hop is deleted from the configured default route and if the optional preference value is designated, the preference of the configured default route is reset to its default.

ip route distance

This command sets the default distance (preference) for static routes. Lower route distance values are preferred when determining the best route. The ip route and ip route default commands allow you to optionally set the distance (preference) of an individual static route. The default distance is used when no distance is specified in these commands. Changing the default distance does not update the distance of existing static routes, even if they were assigned the original default distance. The new default distance will only be applied to static routes created after invoking the ip route distance command.

no ip route distance

This command sets the default static route preference value in the router. Lower route preference values are preferred when determining the best route.

ip netdirbcast

This command enables the forwarding of network-directed broadcasts. When enabled, network directed broadcasts are forwarded. When disabled they are dropped.

no ip netdirbcast

This command disables the forwarding of network-directed broadcasts. When disabled, network directed broadcasts are dropped.

ip mtu

This command sets the IP Maximum Transmission Unit (MTU) on a routing interface. The IP MTU is the size of the largest IP packet that can be transmitted on the interface without fragmentation.

Packets originated on the router, such as OSPF packets, may be fragmented by the IP stack. The IP stack uses its default IP MTU and ignores the value set using the ip mtu command. OSPF advertises the IP MTU in the Database Description packets it sends to its neighbors during database exchange. If two OSPF neighbors advertise different IP MTUs, they will not form an adjacency. (unless OSPF has been instructed to ignore differences in IP MTU with the ip ospf mtu-ignore command.)

NOTE: The IP MTU size refers to the maximum size of the IP packet (IP Header + IP payload). It does not include any extra bytes that may be required for Layer-2 headers. To receive and process packets, the Ethernet MTU (See “mtu” ) must take into account the size of the Ethernet header.

no ip mtu

This command resets the ip mtu to the default value.

encapsulation

This command configures the link layer encapsulation type for the packet. The encapsulation type can be ethernet or snap.

NOTE: Routed frames are always ethernet encapsulated when a frame is routed to a VLAN.

show dhcp lease

This command displays a list of IPv4 addresses currently leased from a DHCP server on a specific in-band interface or all in-band interfaces. This command does not apply to service or network ports.

show ip brief

This command displays all the summary information of the IP.

show ip interface

This command displays all pertinent information about the IP interface.

show ip interface brief

This command displays summary information about IP configuration settings for all ports in the router.

show ip route

This command displays the routing table. The <ip-address> specifies the network for which the route is to be displayed and displays the best matching best-route for the address. The <mask> specifies the subnet mask for the given <ip-address>. When you use the longerprefixes keyword, the <ip-address> and <mask> pair becomes the prefix, and the command displays the routes to the addresses that match that prefix. Use the <protocol> parameter to specify the protocol that installed the routes. The value for <protocol> can be connected, ospf, rip, static, or bgp. Use the all parameter to display all routes including best and nonbest routes. If you do not use the all parameter, the command only displays the best route.

NOTE: If you use the connected keyword for <protocol>, the all option is not available because there are no best or non-best connected routes.

The show ip route command displays the routing tables in the following format:

Code IP-Address/Mask [Preference/Metric] via Next-Hop, Interface

The columns for the routing table display the following information:

show ip route summary

Use this command to display the routing table summary. Use the optional all parameter to show the number of all routes, including best and non-best routes. To include only the number of best routes, do not use the optional parameter.

show ip route preferences

This command displays detailed information about the route preferences. Route preferences are used in determining the best route. Lower router preference values are preferred over higher router preference values. A route with a preference of 255 cannot be used to forward traffic.

show ip stats

This command displays IP statistical information.

See also

Routing Commands

Address Resolution Protocol (ARP) Commands

Router Discovery Protocol Commands

Virtual LAN Routing Commands

Virtual Router Redundancy Protocol Commands

DHCP and BOOTP Relay Commands

IP Helper Commands

Open Shortest Path First (OSPF) Commands

Routing Information Protocol (RIP) Commands

ICMP Throttling Commands