Usually you need to configure a default IP gateway on your router. The default gateway is not set in the interface, but for the entire router. The default gateway will appear in the configuration as the Gateway of last resort, which means if no specific route is specified, the router uses this gateway. When you look at the routing table with the show ip route command, the gateway will appear as the gateway of last resort:

Router2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is to network
C is directly connected, FastEthernet0/1
C is directly connected, FastEthernet0/0 is variably subnetted, 2 subnets, 2 masks
S [1/0] via
S [1/0] via
S* [1/0] via

To set the gateway of last resort, enter Global Configuration mode and use the ip route command to set a route to a universal system. Numerically, it is the opposite of a broadcast address, which is You can specify that you want to route to all systems with the network ID of and mask of or in Classless InterDomain Routing (CIDR) notation.

So in this case, your network ID is defined as all binary zeros, and your mask says that all bits are host bits, which effectively defines all networks and all hosts. The only other thing that the route command needs is the actual gateway or router to use to get your data one step closer to its destination; this router needs to be on a network segment to which your router is connected.

The complete command looks like this:

Router2(config)#ip route