Configure a default route on a Cisco router

The default route is the IP address of the next hop when no other routes are known.


To configure the default route to be 192.168.1.1:

config t
ip route 0.0.0.0 0.0.0.0 192.168.1.1

An interface can be used as an alternative to and IP address. To use serial0/0 for destinations not in the routing table, use:

ip route 0.0.0.0 0.0.0.0 serial 0/0

 

About Quinn McHenry

Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
View more articles by Quinn McHenry

The Conversation

Follow the reactions below and share your own thoughts.

  • Sridhar V

    Sir I have two serial ports with 2 MB internet connectivity with static IP given by the ISP.
    At the local LAN the router has one ethernet port which i am using for local lan. How can i configure default route on both the serial ports

    • Anonymous

      Dear Sridhar V

      Router#config t
      Router(config)#interface FastEthernet0/0
      Router(config-if)# ip address local ip 255.255.255.0
      Router(config-if)# ip nat inside
      Router(config-if)# exit
      Router(config)#interface FastEthernet0/1
      Router(config-if)# ip address public ip 255.255.255.0
      Router(config-if)# ip nat outside
      Router(config-if)# exit
      Router(config)#ip route 0.0.0.0 0.0.0.0 public IP
      Router(config)#access-list 101 permit ip local ip 0.0.0.255 any
      Router(config)#ip nat inside source list 101 interface FastEthernet0/1 overload

  • Will

    If you were running OSPF would you add the fa outside interface IP network to your routing networks, or program that IP for the default route?

    Do you have to configure the default route back to this IP on every router with the ip route command?

  • http://www.buyatnectar.com Tushar

    A router gateway is a node on a TCP/IP network that serves as an access point to another network. which provides the actual path for the packet in and out of the gateway.The default gateway commonly connects the internal networks and the outside network (Internet).

    Configure Ethernet Port Command -
    Router(config)# inte f0/0
    Router(config-if)# ip add 192.168.0.1 255.255.255.0
    Router(config-if)# no shut

    Configure Serial Port Command -
    Router(config-if)# inte s 0/0/0
    Router(config-if)# ip add 192.168.20.1 255.255.255.0
    Router(config-if)# no shut

    Thanks,
    Tushar

  • GebRiel

    How to configure default route using the outbound interface to the internet???
    can some one help me????

    • Will

      To use the INTERFACE, Instead of placing the next hop ip on your ip route 0.0.0.0 0.0.0.0 x.x.x.x

      Do ip route 0.0.0.0 0.0.0.0 s0/1

      So all traffic will be default routed out local serial int 0/1

  • Seanchief2008

    i have one public ip 41.76.89… 255.255.255….. 41.76.89….. my router has 2 ports 1 for link from the isp and the other 1 for lan how can configure that please..

  • Love_ciggar

    Hi,

  • Love_ciggar

    Hi,

  • NMS-VS

    I also Need a Help Dears, I am connected from the Via Sat Satellite Internet with the iDirect 3000 Series Modem,  the provider provided me Public IP addresss block of /29,  xx.xx.151.121 is the Modem Gateway and 5 more IPs I have free to use Locally. The  xx.xx.151.122 is configured in Wireless router and work as DHCP, Now I want do a practice in Cisco Router 2801 Series. I want to configure the F0/0 port as WAN and assign Public IP xx.xx.151.123 ( if i am wrong then please suggest) and configure the f0/1 port as LAN   to provide internet for the LAN IPs. I need Your help to provide me step by step help, I believe You u have the Public Address Rnage with u.

    waiting for response.

    the reason I am doing this, Bcz I dont have WIC card in my Cisco router.

  • tony

    i have an uplink and im connected to an IXP, but all my traffic wants to go through the uplink only, how do i let traffic from my customers ( i am an ISP) to access resources from the IXP and the Uplink as well? thanks

  • Chamal

    Please help me on following matter,
    i have a cisco router which is connected to the home broadband D-Link wireless router. the D-link router using 192.168.0.0/24 range and cisco fe0/0 ip is 192.168.0.160. i have configured fe0/1 to 192.168.10.1/24 and that network has a pc with ip 192.168.10.2. that pc can’t ping to D-link router or that network. i just wondering i need to give a static route or default gateway or something. i tried ospf but still didn’t work. please help me on this. thanks

  • singh

    I am Having 1841 Router with 1T card and Cable ISP Has Given Ip Address

    LAN POOL

  • siason

    how?

  • COCXEL

    default routing is use if you don’t know destination address

  • Hammad Bilal

    I need Help on this please…

    Default route tells the router where to go when there is no specified route available in their routing table.
    I want to know that in the same situation, what will happen if no default route is configured. I mean if there is no specified route available in the routing table and also default route is not configured, then what a router will do?

  • Kumaran

    Hi All,

    Need your advise i have a wan router going to a AMG(Gateway) thru X2 port, i need the routing where any connection come to the router must go thru the Gateway and re-direct accordingly if it want to go LAN or Internet accordingly. Please advise, thanks in advance?

  • norm

    Start with router 1

    enable
    configure terminal
    hostname R1
    enable secret 111111

    line con 0
    password 111111
    login
    exit

    line vty 0 15
    password 111111
    login
    exit

    banner motd # This is my MOTD#
    no ip domain-lookup
    no logging console

    Fast Ethernet

    interface fa 0/0
    desc Fast internet 0/0 for network ??.??.??.??
    ip address 172.16.0.1 255.255.0.0
    description R1 gateway
    ip nat inside
    no shutdown
    exit

    ip route 0.0.0.0 0.0.0.0 172.17.0.2
    ip dhcp excluded-address 172.16.0.1 172.16.0.5
    ip dhcp pool pool1
    network 172.16.0.0 255.255.0.0
    default-router 172.16.0.1
    end
    copy run start

    Repeat for router 2

    Serial on R1

    interface serial 0/0/0
    Desc Serial 0/0/0 for network ??.??.??.??
    ip address 172.17.0.1 255.255.0.0
    no shutdown
    ip nat outside
    clockrate xxxxx (where xxxxx equals the baud rate you wish to set)

  • norm

    enable
    configure terminal
    hostname R1
    enable secret 111111

    line con 0
    password 111111
    login
    exit

    line vty 0 15
    password 111111
    login
    exit

    banner motd # This is my MOTD#
    no ip domain-lookup
    no logging console

    Fast Ethernet

    interface fa 0/0
    desc Fast internet 0/0 for network ??.??.??.??
    ip address 172.16.0.1 255.255.0.0
    description R1 gateway
    ip nat inside
    no shutdown
    exit

    ip route 0.0.0.0 0.0.0.0 172.17.0.2
    ip dhcp excluded-address 172.16.0.1 172.16.0.5
    ip dhcp pool pool1
    network 172.16.0.0 255.255.0.0
    default-router 172.16.0.1
    end
    copy run start

    Repeat for router 2

    Serial on R1

    interface serial 0/0/0
    Desc Serial 0/0/0 for network ??.??.??.??
    ip address 172.17.0.1 255.255.0.0
    no shutdown
    ip nat outside
    clockrate xxxxx (where xxxxx equals the baud rate you wish to set)

  • mwesiigwa peter

    good ideas but how can I know all the router configurations on my hand tips

  • Celal Dikici

    Hi,

    my Cisco 2811 with private IP 192.168.100.5 is behind a ADSL-Router with a fixed public IP 85.182.223.158 and the private address 192.168.100.2. It resides in a DMZ.

    The aim is too establish a VPN Connection to a company. They send me a config template which I think is
    not valid for me:

    interface fastethernet0/0
    ip address 85.182.223.158 255.255.255.0

    They assume the cisco is the first device. Therefore in the following sections for creating a tunnel, they
    uses my public IP address

    interface tunnel
    description To DeutscheCompany
    tunnel source 85.182.223.158
    tunnel destination 193.29.78.6

    IMHO taking (April 30, 2010 at 6:28 am, Anonymous said:) and above mentioned DMZ into account, how to configure the cisco router to establish a VPN connection to a external partner.

    thanks in advance,
    Celal