IP route

RedlabelRedlabel Member Posts: 13 ■□□□□□□□□□
Howdi gents,

Need your help to clarify few things about IP route command.

there is static route, default route, and dynamic route from what I have come to understand.
As far as I know, a static route uses the DESTINATION netwwork, with the next-hop IP address. Is this correct?

default route is something like 0.0.0.0 0.0.0.0 next-hop IP address
is this correct?

TIA

Comments

  • Paul BozPaul Boz Member Posts: 2,620 ■■■■■■■■□□
    static routes are manually configured and never change unless you reload the router and didn't use the permanent command or you manually change them.

    dynamic routes are learned via routing protocols, like RIP, OSPF, or EIGRP.

    default routes are static routes that accept packets that don't have a destination in the routing table.
    CCNP | CCIP | CCDP | CCNA, CCDA
    CCNA Security | GSEC |GCFW | GCIH | GCIA
    pbosworth@gmail.com
    http://twitter.com/paul_bosworth
    Blog: http://www.infosiege.net/
  • RedlabelRedlabel Member Posts: 13 ■□□□□□□□□□
    thx Paul, I was refering to the command syntax itself. Is it correct to use
    0.0.0.0 0.0.0.0 next-hop IP adress (is this what they term Default Route?)

    thx
  • Paul BozPaul Boz Member Posts: 2,620 ■■■■■■■■□□
    Yes, that's a statically assigned default route. If you're using a routing protocol you should use the default-network command though.

    http://www.cisco.com/warp/public/105/default.html
    CCNP | CCIP | CCDP | CCNA, CCDA
    CCNA Security | GSEC |GCFW | GCIH | GCIA
    pbosworth@gmail.com
    http://twitter.com/paul_bosworth
    Blog: http://www.infosiege.net/
  • mgeorgemgeorge Member Posts: 774 ■■■□□□□□□□
    ip route 0.0.0.0 0.0.0.0 (int or interface)

    example
    ip route 0.0.0.0 0.0.0.0 72.147.25.14
    or
    ip route 0.0.0.0 0.0.0.0 fa0

    You'd use the latter example when you use an isp that provides dhcp ip addresses
    it will route the packets out the interface no matter what the ip is, this is used on pppoe
    dialer programs, isdn, cable modems, dsl etc...

    hope this helps :)
    There is no place like 127.0.0.1
  • Paul BozPaul Boz Member Posts: 2,620 ■■■■■■■■□□
    Oh, also, if you use an exit interface the AD will be zero and if you use an exit IP address it will be 1 :)
    CCNP | CCIP | CCDP | CCNA, CCDA
    CCNA Security | GSEC |GCFW | GCIH | GCIA
    pbosworth@gmail.com
    http://twitter.com/paul_bosworth
    Blog: http://www.infosiege.net/
  • mgeorgemgeorge Member Posts: 774 ■■■□□□□□□□
    icon_lol.gif Paul, I would have said that but I didnt think it was necessary.
    There is no place like 127.0.0.1
  • Paul BozPaul Boz Member Posts: 2,620 ■■■■■■■■□□
    mgeorge27 wrote:
    icon_lol.gif Paul, I would have said that but I didnt think it was necessary.

    You'd be surprised. A friend of mine had two static routes built and one used the interface for the exit route, and he couldn't for the life of him figure out why traffic was going out that interface instead of the one built with an exit IP.
    CCNP | CCIP | CCDP | CCNA, CCDA
    CCNA Security | GSEC |GCFW | GCIH | GCIA
    pbosworth@gmail.com
    http://twitter.com/paul_bosworth
    Blog: http://www.infosiege.net/
  • DW [banned]DW [banned] Inactive Imported Users Posts: 240
  • RedlabelRedlabel Member Posts: 13 ■□□□□□□□□□
    Please bear with me, trying to understand exactly what's going on.

    Say I have got R1 and R2 connected via serial0 on R1 to s1 on R2.
    Lan1 is connected to R1 fa0/0 interface, and LAN2 in connected to R2 via fa0/0 interface.

    Now on R1 I write down the following:

    ip route 0.0.0.0 0.0.0.0 s0 (is this correct?)..I understand that I can the IP of S1 of R2 (correct me if I am wrong).

    then 0.0.0.0 refers to which LAN? LAN1 or LAN2? or even for ALL LANs?

    TIA
  • iprouteiproute Member Posts: 269
    Redlabel wrote:
    Please bear with me, trying to understand exactly what's going on.

    Say I have got R1 and R2 connected via serial0 on R1 to s1 on R2.
    Lan1 is connected to R1 fa0/0 interface, and LAN2 in connected to R2 via fa0/0 interface.

    Now on R1 I write down the following:

    ip route 0.0.0.0 0.0.0.0 s0 (is this correct?)..I understand that I can the IP of S1 of R2 (correct me if I am wrong).

    then 0.0.0.0 refers to which LAN? LAN1 or LAN2? or even for ALL LANs?

    TIA

    ip route 0.0.0.0 0.0.0.0 s0 sets the default route (or gateway of last resort). That basically means that any packets that the router doesn't otherwise know what to do with will be sent out the default route (in the example above, s0).

    Essentially, what you're trying to do with static routes is tell your router how to get data to various networks (such as those attached to R2). For the example below, let's consider networks 172.28.28.32 and 172.28.28.48 on R2. You could do the following.

    ip route <NETWORK_NUM> <MASK> <R1-INTERFACE-OR-R2-IP>
    examples:
    ip route 172.28.28.32 255.255.255.240 172.28.28.2 (configured on R1: allows R1 to route packets to network 172.28.28.32 255.255.255.240 via 172.28.28.2 - which is the interface on R2 which is directly connected to R1)

    ip route 172.28.28.48 255.255.255.240 172.28.28.2 (configured on R1: allows R1 to route packets to network 172.28.28.48 255.255.255.240 via 172.28.28.2 - which is the interface on R2 which is directly connected to R1)

    You would have to add similar entries on R2 in order for it to get data to R1's networks.
    CCNP Progress
    ROUTE [X] :: SWITCH [X] :: TSHOOT [X]
  • RedlabelRedlabel Member Posts: 13 ■□□□□□□□□□
    it says that when using a static route, we should use the destination-network and its mask with the next-hop IP address. But in most cases it is not possible to know the networks on the other router. What to do then?

    I need to know, maybe i am stupid but i did not grab the idea yet, what the hell is 0.0.0.0 0.0.0.0

    To which network and mask does this refer? The LANs connected to my router or LANs connected to the next router?
  • iprouteiproute Member Posts: 269
    Redlabel wrote:
    it says that when using a static route, we should use the destination-network and its mask with the next-hop IP address. But in most cases it is not possible to know the networks on the other router. What to do then?
    In this case, (more experienced people correct me if I'm wrong) you would use the interface on your router that you'd like to send that data out of.

    Example: ip route 172.28.28.32 (I'm trying to get to this network) 255.255.255.240 (with this subnet mask) s0/0 (since I don't know the IP of the router I'm connected to, I'll just send the traffic out this interface)
    Redlabel wrote:
    I need to know, maybe i am stupid but i did not grab the idea yet, what the hell is 0.0.0.0 0.0.0.0

    To which network and mask does this refer? The LANs connected to my router or LANs connected to the next router?
    I don't think it refers to any network or any mask. It's simply a way of telling the router that you want to send all traffic that it doesn't know what to do with out whatever IP or interface is attached to that 0.0.0.0 0.0.0.0 designation.

    If a router gets a packet that's destined for a network that it doesn't know about (via static routes or dynamic routes), it'll just throw the packet away, unless there's a default route (the 0.0.0.0 0.0.0.0 command) specified, at which point it'll just send the packet out that route.
    CCNP Progress
    ROUTE [X] :: SWITCH [X] :: TSHOOT [X]
Sign In or Register to comment.