Home > Configure Static Route – GNS3 Lab

Configure Static Route – GNS3 Lab

December 3rd, 2010 Go to comments

In this tutorial we will connect two routers via static route with GNS3.

Static route and Dynamic route

Static route tells the device exactly where to send traffic, no matter what. Static route is often used when your network has only a few routers or there is only one route from a source to a destination. Dynamic routes, on the other hand, use a routing protocol to determine the best path and the routes can be changed depending on specific parameters (like bandwidth, delay, cost…). With dynamic routes, routers can communicate with each other to exchange routing information. In ROUTE 642-902 you will learn about dynamic routing protocols such as OSPF, EIGRP and BGP (RIP is also a dynamic routing protocol but it is not mentioned in ROUTE).

The simple syntax of static route:

ip route destination-network-address subnet-mask {next-hop-IP-address | exit-interface}
+ destination-network-address: destination network address of the remote network
+ subnet mask: subnet mask of the destination network
+ next-hop-IP-address: the IP address of the receiving interface on the next-hop router
+ exit-interface: the local interface of this router where the packets will go out

Now we consider a real-world example of static routing. Suppose that your company has 2 branches located in New York and Chicago. As the administrator of the network, you are tasked to connect them so that employees in the two LANs can communicate with each other. After careful consideration you decided to connect them via static route.

Configure_Static_Route_topology.jpg

In GNS3, place 2 routers and connect them as the image below, I used IOS c2600-bin-mz.123-6f.bin to save some RAM (only require 64MB/router). We will use two loopback interfaces to simulate two Ethernet LANs.

Configure_Static_Route_topology_gns3.jpg

Configuring interfaces on R0

R0(config)#interface s0/0
R0(config-if)#ip address 12.12.12.1 255.255.255.0
R0(config-if)#no shutdown
R0(config-if)#interface lo0
R0(config-if)#ip address 10.0.0.1 255.0.0.0
R0(config-if)#exit

Configuring interfaces on R1

R0(config)#interface s0/0
R0(config-if)#ip address 12.12.12.2 255.255.255.0
R0(config-if)#no shutdown
R0(config-if)#interface lo0
R0(config-if)#ip address 172.16.0.1 255.255.0.0
R0(config-if)#exit

Now if we check the routing table of R0 & R1 by the command show ip route on both R0 and R1

On R0:
R0# show ip route

Configure_Static_Route_show_ip_routeR0.jpg

The letter “C” means “connected” or “directly connected”. So there are 2 networks that are directly connected to R0: 10.0.0.0/8 and 12.12.12.0

On R1

R1# show ip route

Configure_Static_Route_show_ip_routeR1.jpg

Configuring static route on R0

R0(config)#ip route 172.16.0.0 255.255.0.0 12.12.12.2

Configuring static route on R1

R1(config)#ip route 10.0.0.0 255.0.0.0 12.12.12.1

Notice that static route works one-way. It means we have to add static route to both R0 and R1 so that R0 and R1 can communicate.

Configure_Static_Route_show_ip_routeR0_static.jpg


Configure_Static_Route_show_ip_routeR1_static.jpg

Now try to ping each far end network

Configure_Static_Route_ping.jpg

(Note: In fact, R0 can successfully ping R1 right after adding the static route to R0)

Administrative distance of a static route.

After adding two static routes in R0 & R1 routers, the routing tables of two routers contain these lines:

S 10.0.0.0/8 [1/0] via 12.12.12.1 (on R1)
S 172.16.0.0/16 [1/0] via 12.12.12.2 (on R0)

The “S” letter tells us this is a static route. The networks 10.0.0.0/8 and 172.16.0.0/16 are the destinations of this static route and if the routers want to reach them they must send packets to 12.12.12.1 (on R1) and 12.12.12.2 (on R2). These parameters are straightforward and easy to understand. But what is [1/0]? Well, 1 is the administrative distance (AD) and 0 is the metric of that static route.

The administrative distance is a measure of trustworthiness where lower numbers are considered to be more trustworthy than higher numbers. The route with the lowest administrative distance value is the preferred route that the router selects. Administrative distance is the value from 0 to 255.

Directly connected routes have an administrative distance of 0. Static routes have an administrative distance
of 1 so in the outputs above you will see the administrative distance of both static routes are 1.

The router treats a static route pointing to an interface the same as a connected interface so the its AD is 0. If you configure a static route pointing to an exiting interface (for example: “ip route 172.16.0.0 255.255.0.0 s0/0” on R0) then the AD will not be shown.

(For your information, EIGRP has an administrative distance of 90. IGRP has an administrative distance of 100. OSPF has an administrative distance of 110. And RIP has an administrative distance of 120)

Comments (47) Comments
  1. rasha
    December 7th, 2010

    can apply this lab in packet tracer……please :)

  2. 9tut
    December 8th, 2010

    In fact, there is no difference when applying this lab in packet tracer.

  3. jobin
    January 19th, 2011

    Good Article it helped me!!

  4. m1k3
    January 20th, 2011

    @rasha: maybe u forgot to set the clock rate to the DCE side..

  5. Silvester Rajpaul
    February 19th, 2011

    ya easy to get the resulssssssssssss!!!!!!!!!

  6. Veeresh
    March 15th, 2011

    Can I have Latest CCNA Dumps.

    My Mail-id is – bv.veeru@hotmail.com

  7. shashi
    March 17th, 2011

    very helpful for me.
    Can you please add complete voice based training ?

  8. Manoj
    March 19th, 2011

    i comleted CCNA just 15 days ego anybody helps me for pass the exam?

  9. ADEKUNLE
    March 27th, 2011

    please can i have latest CCNA DUMP?

  10. sunex
    March 30th, 2011

    cant GNS3 work on window 7 and vista? pls if it can, can you let me know how to go about it. i will be grateful if i can get latest dumps. Thank

  11. sunex
    March 30th, 2011

    dumps for CCNA plssssssss

  12. sunex
    March 30th, 2011

    my email is sunexy049@yahoo.com Thanks. will be expecting

  13. NanaKoma
    April 11th, 2011

    This site has been very helpful to me. I have six weeks to write my CCNA and any suggestions and current dump will be helpful. email: nanaluv32@yahoo.com. Thank you very much.

  14. Ashwin patel
    April 19th, 2011

    can i have latest ccnp (Routing dumps
    )

  15. Neon
    April 26th, 2011

    Please respond if anyone has the latest dumps as of April lastweek

  16. sfurtila
    May 24th, 2011

    some one send me latest ccna and ccna security dump please….

    sfurtila@yahoo.com

  17. Savun
    May 25th, 2011

    Hi, every one.I am savun I need to do CCNA exam, but not sure to pass.
    so please comment to me. How I can to do for CCNA certificate. thanks for all………..

  18. Sidheek Mohammed
    June 11th, 2011

    Why we implemented LOOPBACK here ???we were trying only static routing ?? Is it necessary to do loopback when we do static routing ???

  19. 9tut
    June 12th, 2011

    @Sidheek Mohammed: We don’t need to use loopback when doing static routing. The two loopback interfaces here are just used to illustrate 2 far-away networks. If we don’t use these 2 loopback interfaces we have to add 2 more routers to test the static route commands.

  20. Heath
    June 21st, 2011

    Hi,

    Perhaps a really silly question, I have this set up in GSN3 – Im hooking up 2 vmware devices (ubuntu boxes), I can ping router one and router two using the external ips.

    router a cisco 7200
    interface fe 0/0 10.0.0.2
    interface fe 1/0 192.168.3.1

    router b cisco 7200
    interface fe 0/0 10.0.0.1
    interface fe 1/0 192.168.2.1

    I did the static routing of this:
    Router A(config)#ip route 192.168.2.0 255.255.255.0 10.0.0.1

    Router B(config)#ip route 192.168.3.0 255.255.255.0 10.0.0.2

    I can ping A from B using:
    router a#ping 192.168.2.1
    and
    router b#ping 192.168.3.1

    I can also ping the VMARE boxes
    from their respective routers (and I can ping the respective routers from computers)
    (comp_a router_a router_b comp_b)
    but comp_a cannot ping comp_b and vica versa.

    Any ideas?

  21. Sascha
    July 19th, 2011

    Hi heath,

    static routes are only “point to point” routes. you cant ping from a host on router a to a host on router b. to get this working you have to enable any routing protocol f.e. ripv2.

    greets

  22. Jeff2
    September 25th, 2011

    I am trying GNS3 now after using PT extensively. Does the loopback address kind of “simulate” a host on the LAN behind those routers? For PT, we can add a PC on both ends of those routers and then try to ping each other. For GNS3, the alternative would be a loopback address or another router?

  23. xallax
    September 25th, 2011

    @jeff
    you could try adding a vmware machine as test computer
    you could add several vmware machines as test computers!
    you could add as many vmware machines as you like :)

  24. Jeff2
    September 26th, 2011

    Hey xallax, you should create a video tutorial or something about gns3 along with your package (if it doesn’t have one yet).

  25. xallax
    November 20th, 2011
  26. Rahul
    December 7th, 2011

    add default gateway (router ip to which pc connected) in your pc .

  27. Rahul
    December 7th, 2011

    @Health:- add default gateway (router ip to which pc connected) in your pc .

  28. RAJEN
    January 25th, 2012

    hi!!!!!! 9tut

    which type tutorials will come in CCNA exam?

    &
    Plz send me latest dums plz

    rajenpatel30189@gmail.com

  29. Deva
    March 4th, 2012

    Can anyone send ccnp materials to my id devendrangr at yahoo.in inorder to take the exam.

  30. Jervy
    July 3rd, 2012

    @Rahul nice observation
    @Health, really you didn’t specify what ip configuration you put to your host A and B

  31. Hi
    July 27th, 2012

    dear all i am need ccna latest dumps if any one have then please send me on my email id

    jamilshah_2005@yahoo.com

    thanks

    regards
    Jamil shah Afridi

  32. monty
    October 8th, 2012

    I do it with both GNS 3 and packet trace but it does not work good I dont know what is the problem?

  33. willkoolz
    October 30th, 2012

    Check out GNS3 workbench…it has training and a fully loaded ubuntu 10.10 vmware image preloaded w/ ccna labs, GNS3 and documentation.

    http://rednectar.net/gns3-workbench/

    This is what I use plus when you add this to 9tut, you are set. Peace

  34. jaser
    March 19th, 2013

    thanks 9tut

  35. MICKAL
    March 26th, 2013

    THANKS 9TUT

  36. Ahsan
    April 2nd, 2013

    Good Examples with Picture :) Thanku

  37. friendlywind
    May 10th, 2013

    Hi All I have got my ccna icnd1 exam coming up on thr 25th of may, can you please send the latest brain dump to me my email is

    friendlywind@gmail.com

    Thank you in advance.

  38. ANONNYOS
    June 5th, 2013

    j’ai deux routeurs et deux virtuel box guest et j’arrive pas a les router avec un routage statique pouvez vous m’aidé et merci d’avance ^^

  39. ANONNYOS
    June 5th, 2013

    voila mon e-mail hassanefes@hotmail.com

  40. Stoan k
    June 25th, 2013

    This site is helpful indeed,i’ve been out f class 4 a while due 2 work commitments bt nw i cn catch up coz f dis mouth watering tutoria. Thanx CCNA family

  41. Anonymous
    September 19th, 2013

    hiiiii,
    this is tumendra bisen. i am preparing the ccna certification exam. if you have latest dumps and sumulator so plz send me on my email
    tumendra24bisen@gmail.com.so that i can prepare 100%.

  42. irfan
    April 10th, 2014

    this is very good topic it he;lp me alot for understanding static routing thanx alot

  43. Anonymous
    September 18th, 2014

    its very good and informative website

  44. aznkoolguy
    November 10th, 2014

    Someone please sent me the lastest ccna dump. My email aznkoolguy69@hotmail.com

  45. Anonymous
    February 17th, 2015

    Hi,
    Why R0#ping 172.16.0.2 not succeed ?

  46. jenny
    March 9th, 2015

    what is the commands for configuring the ipv6 in gns3
    also how to assign the ipv6 address in sysyem and process ping

  47. Ilkin
    April 20th, 2015

    my email is ilkin.zeynalovich@gmail.com . please send me dump for excamen CCNA

Add a Comment