ip default gateway
When you have routing enabled then you need default route (also calleddefault network or Gateway of Last Resort). You do not need default routeif you don't use routing. For example if you just have one router in your network there is no need for default route. When you have more than one router in a network you need default route.Note: If you connect to WAN (Internet) you need default route. The default route allows connection with Internet. If you are not using WAN and have one router than there is not need for default route but in these days everyone connects to the Internet so most likely your router has default route. When using router to connect to the Internet using DHCP this happens automatically so there will no need to configure default route manually. If you need to manually set default route then use the commands IP default-network or IP route 0.0.0.0 0.0.0.0 .More info can be found at Cisco's site - see the related link below.
default-information originate
To change the gateway address in UNIX, you can use the route command. For example, you can set the default gateway with the command route add default gw <new_gateway_ip>. Alternatively, you can use the ip command with ip route add default via <new_gateway_ip>. Make sure to replace <new_gateway_ip> with the actual IP address of the new gateway.
ip classless
--> If the destination network is directly connected, the router forwards the packet to the destination host. --> If no route exists for the destination network and a default route is present, the packet is forwarded to the next-hop router. --> If the originating host has a default gateway configured, the packet for a remote network can be forwarded using that route.
Router> enableRouter# config tRouter(config)# ip default route [IP address]
router(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.1
To find the gateway address in a router-based network, you can check the network settings on your device. On Windows, open Command Prompt and type ipconfig, then look for the "Default Gateway" under your active network connection. On macOS or Linux, open a terminal and type ip route or netstat -rn, and the gateway will be listed as the default route. Alternatively, you can log into the router's web interface using its IP address, typically 192.168.1.1 or 192.168.0.1, and find the gateway information there.
Default Route
the default gateway is the most common static route used in a host computer. netstat -r is the command line command to obtain the routing table.
A host uses a default route to transfer data to a host outside the local network when no other route to the destination exists. You may configure the gateway of last resort to achieve this functionality especially if there is a need to route packets outside the LAN. The way to configure a default route to a Cisco Layer 3 device is as follows: Router(config)# ip route <network-address> <subnet-mask> <next-hop-address> Example: Router(config)# ip route 0.0.0.0 0.0.0.0 172.18.3.1