Creating Static Routes


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


Create a default static route:

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



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, 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 *[Static/5] 00:06:50
	 > to 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 next-hop

Here, is the address of the system outside your network, and 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





Router Interfaces

IP Routing

Routing Policy and Firewall Filters







IP Multicast

JUNOS Cookbook
Junos Cookbook (Cookbooks (OReilly))
ISBN: 0596100140
EAN: 2147483647
Year: 2007
Pages: 290
Authors: Aviva Garrett © 2008-2020.
If you may any questions please contact us: