Creating Static Routes

Problem

You want to be able to connect your router to the Internet.

Solution

Create a default static route:

	[edit routing-options]
	aviva@router1# set static route 0.0.0.0/0 next-hop 10.0.21.2

 

Discussion

Static routes are routes that you explicitly add to your routing table. Static routes are always available and do not change as a result of dynamic routing updates. For an enterprise network, a static route can be simply a default route that points to the ISP, as shown in this recipe. Here, you create a default route, 0.0.0.0/0. The next hop is the address of the interface to which you connect on the ISP's router. This route then forwards all Internet-bound traffic through the ISP and out to the Internet.

Check the routing table to see the route:

	aviva@router1> show route table inet.0
	inet.0: 20 destinations, 20 routes (19 active, 0 holddown, 1 hidden)
	+ = Active Route, - = Last Active, * = Both
	0.0.0.0/0 *[Static/5] 00:06:50
	 > to 10.0.21.2 via se-0/0/3

Another reason to use static routes is when your network connects to a router or other system outside the network and either that system can't run a routing protocol or you don't want to run a routing protocol on it. In this situation, create a static route from your edge router to the outside system and then, on the edge router, redistribute static routes into your IGP. Here's what the static route configuration might look like on the edge router:

	[edit routing-options]
	aviva@router1# set static route 172.168.17.6 next-hop 10.1.16.4

Here, 172.168.17.6 is the address of the system outside your network, and 10.1.16.4 is the address of the other router to which the interface on your router connects.

See Also

Recipes 11.8 and 12.10


Router Configuration and File Management

Basic Router Security and Access Control

IPSec

SNMP

Logging

NTP

Router Interfaces

IP Routing

Routing Policy and Firewall Filters

RIP

IS-IS

OSPF

BGP

MPLS

VPNs

IP Multicast



JUNOS Cookbook
Junos Cookbook (Cookbooks (OReilly))
ISBN: 0596100140
EAN: 2147483647
Year: 2007
Pages: 290
Authors: Aviva Garrett

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net