Configuring your Router's IP Settings

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 192.168.5.10 to network 0.0.0.0
C    192.168.5.0/24 is directly connected, FastEthernet0/1
C    192.168.1.0/24 is directly connected, FastEthernet0/0
     192.168.100.0/24 is variably subnetted, 2 subnets, 2 masks
S       192.168.100.0/24 [1/0] via 192.168.5.2
S       192.168.100.75/32 [1/0] via 192.168.5.5
S*   0.0.0.0/0 [1/0] via 192.168.5.10

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 255.255.255.255. You can specify that you want to route to all systems with the network ID of 0.0.0.0 and mask of 0.0.0.0 or 0.0.0.0/0 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 0.0.0.0 0.0.0.0 192.168.10.1
blog comments powered by Disqus
Advertisement

Inside Dummies.com