IP Routing Commands

Any device on an IP Network need some information about the network, including any information needed to communicate with someone who is not on the network. This information takes the form ofrouting information.

The route command is used to add or delete routing information from the memory of the NAT. significant information to a remote server for processing. In the NetNAT, this allows the collection of useful information without the need for masses of local storage or local processing. Computers that have more time on their hands are better at distilling and graphing statistical information.

NAT Notation For IP Address and Netmask

We have standardized on the shorthand notation used by many other manufacturers for the combination of a network address and its associated netmask. This notation can be explained through a number of examples:

   Network Address     Netmask           NSC Notation
  ----------------- ---------------- ---------------------        123.234/16      123.234.222/24      123.234.222/23

The final number (after the slash) is the number of bits in the netmask. Because of this specification of netmask, the NAT is not compatible with networks that use “comb” style netmasks, where all one-bits are not contiguous. The following table gives the number of bits for each permitted netmask.

     Netmask          # of Bits          Netmask        # of Bits
  -----------------  -----------    -----------------  -----------             1              9             2             10             3             11             4             12             5             13             6             14             7             15             8             16

     Netmask          # of Bits          Netmask        # of Bits
  -----------------  -----------    -----------------  -----------        17         25        18         26        19         27        20         28        21         29        22         30        23         31        24         32

Checking Routing Information

The route command by itself will display the current “knowledge” of IP routes. Information displayed includes the IP Address of the destination host or network, the number of bits of netmask associated with that destination, the NAT logical interface to use in accessing that destination and the address of a gateway to be used, if the destination isn’t on the NAT’s network.

Command Syntax


Setting a Default Route

A default is used in the absence of other routing information. For a LAN segment connected to the global Internet by way of a router (like one of our NATs), that router is the default route, or default gateway for that entire LAN. Any message that is addressed into the Internet will be handed to that router for subsequent delivery. That router, in turn, will have a default route, to get the message closer to its destination.

The NetNAT is usually the default gateway for every computer on the private network. This command specifies the default gateway for the NetNAT to use.

Command Syntax

  route add default [int name] [gateway]


  • “Int name” is the name of a NAT logical interface on the default network.
  • “Gateway” is the IP Address of the default gateway on that network.

Setting a Static Route

A static route specifies a knowledge of the proper route to a given network. This is used instead of a default route, when there is a better way to reach the destination than by using the default. For example, a network with an Internet connection and a dedicated link to an associated organization’s network would have a default pointing to the Internet, and a static route (for the other network) pointing to the dedicated link.

  route add default en0          # default to Internet
  route add 140.63.33/24 en0     # static to associates

Here we see a default to a router at, which we trust to get our messages out into the Internet, and a static route to any of 250-some hosts on the 140.63.33 network. The notation “/24” says that our associates’ network uses a 24-bit netmask, or Whether they actually do (at their site) is of no concern to us. We will send any message starting with 140.63.33 to them for delivery. The router at will know how to get the messages to our associates.

Static routes are a valuable tool for the Enterprise Network Designer.

Command Syntax

  route add [dest net] [int name] [gateway]


  • “Dest net” is the network IP Address/Netmask for a desired destination. This is in network/#bits notation.
  • “Int name” is the name of a NAT logical interface to use to reach the destination.
  • “Gateway” is the IP Address of the gateway that can get us closer to the destination.

Adding Routes to Connected Networks

Though it may seem obvious that the NAT can talk on its connected networks, it is nevertheless necessary to add routes for those. This is a very simple process but is occasionally forgotten. For an example, for an interface with an IP Address on en0 of and a netmask of (24-bits), we need a route command like this:

  route addprivate 192.168.32/24 en0

Note that the route subcommand is addprivate instead of add. This keeps the NAT from advertising the route if a routing protocol is started on it. Due to the complexity of configuration of most routing protocols, we don’t recommend that you start one on the NAT. Feel free to run them on your other routers, though.

Command Syntax

  route addprivate [local net] [int name]


  • “Local net” is the network IP Address/Netmask for the directly-connected network. This is in network/#bits notation.
  • “Int name” is the name of a NAT logical interface that is connected to this network.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s