ip route command?!?!!?!?! HELP.

ralbertos21ralbertos21 Member Posts: 27 ■□□□□□□□□□
Configuring and adding static ip routes on routers.

Someone please help me, the ip route [destination network] [mask] [next hop ip address] is what I am understanding... The only addresses different routers know are the ones that are directly connected to each other. So if we don't configure a dynamic protocol, we have to statically add in the next-hop address...
Can someone please give me some more tips on understanding this better and the different ip route combinations? What if we needed all packets to go to the default gateway, etc....

If i said something incorrectly, please correct me!icon_wink.gif
Thank you

Comments

  • bulkosbulkos Member Posts: 11 ■□□□□□□□□□
    Hi,

    1.) static route configured by ip route has administratice distance 1 so it takes priority over dynamicaly learned routes (EIGRP -> 90,...)
    2.) can be used in a small network where is not too many networks,thus you need to manualy configure this routes each time network has changed.
    3.) as you wrote you can set a default way out of the network for all packets doesn't match any record in the routing table

    out of interface -> ip route 0.0.0.0 0.0.0.0 fa0/0 or next hop-> ip route 0.0.0.0 0.0.0.0 192.168.0.1



    hope it helps
  • leonlimsgleonlimsg Member Posts: 10 ■□□□□□□□□□
    There are two commands that can be used to configure a static route.

    ip route [destination network] [mask] [next hop ip address]

    ip route [destination network] [mask] [your router's outgoing interface such as s0/0 etc]

    Add on to what bulkos has mentioned, we use static route for security purpose too. When you configure dynamic routing protocols such as RIP, RIPv2 EIGRP and OSPF on a router, the router will broadcast all its networks to all its neighbours (assuming no passive interfaces are configured).

    As for static route, unless it is configured, it will not sent routing updates to other neighbours.
  • DoubleNNsDoubleNNs Member Posts: 2,015 ■■■■■□□□□□
    leonlimsg wrote: »
    ip route [destination network] [mask] [your router's outgoing interface such as s0/0 etc]

    I didn't know you could config static routes using the 2nd syntax. What are the benefits of using that way over the 1st?
    Goals for 2018:
    Certs: RHCSA, LFCS: Ubuntu, CNCF CKA, CNCF CKAD | AWS Certified DevOps Engineer, AWS Solutions Architect Pro, AWS Certified Security Specialist, GCP Professional Cloud Architect
    Learn: Terraform, Kubernetes, Prometheus & Golang | Improve: Docker, Python Programming
    To-do | In Progress | Completed
  • effektedeffekted Member Posts: 166
    I am still studying for CCENT, but you would add the ip route 0.0.0.0 0.0.0.0 (outgoing serial interface) so that it would send traffic out to the internet since generally (all depending how your router is configured) all internal routes should be setup dynamically with a routing protocol.
  • NetworkVeteranNetworkVeteran Member Posts: 2,338 ■■■■■■■■□□
    DoubleNNs wrote: »
    I didn't know you could config static routes using the 2nd syntax. What are the benefits of using that way over the 1st?
    You should strongly prefer the first approach. If you say, "ip route 1.0.0.0 255.0.0.0 fa0/0".. then the router will use proxy-arp to determine the correct next-hop to route the traffic destined for 1.0.0.0. This results in more ARP entries than would be otherwise necessary, and increased latency for the first packet destined for any particular destination.

    On the plus side, using an interface as a next hop is easier, and it appeals to the lazy side in all of us. I may have preferred this approach when I was starting out and did not realize the full cost of this choice. ;)
  • DoubleNNsDoubleNNs Member Posts: 2,015 ■■■■■□□□□□
    So I guess using the interface as opposed to the next hop address is easier because you don't need to determine what the next hop address actually is, all you do is configure the local router you're working on? However, using that method has inferior performance?
    Goals for 2018:
    Certs: RHCSA, LFCS: Ubuntu, CNCF CKA, CNCF CKAD | AWS Certified DevOps Engineer, AWS Solutions Architect Pro, AWS Certified Security Specialist, GCP Professional Cloud Architect
    Learn: Terraform, Kubernetes, Prometheus & Golang | Improve: Docker, Python Programming
    To-do | In Progress | Completed
Sign In or Register to comment.