Select Page

Static ROUTES

Static Routes

Routes that are permanent fixtures in the routing and forwarding tables are often configured as static routes. These routes generally do not change, and often include only one or very few paths to the destination. To create a static route in the routing table, you must, at minimum, define the route as static and associate a next-hop address with it. The static route in the routing table is inserted into the forwarding table when the next-hop address is reachable. All traffic destined for the static route is transmitted to the next-hop address for transit. You can specify options that define additional information about static routes that is included with the route when it is installed in the routing table. All static options are optional.

In this lab, no special configuration beyond device initialization is required.

LAB:

** R1 & R4 are used for this lab with loopbacks (as shown in topology).

[email protected]> show configuration |display set
set version 14.1R4.8
set system host-name R1
set system root-authentication encrypted-password “$1$rTWehPx5$nPL42fpA35Hbj0OeUeVoX0”
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces ge-0/0/0 unit 0 family inet address 10.10.4.1/24
set interfaces ge-0/0/1 unit 0 family inet address 10.10.5.1/24
set interfaces ge-0/0/2 unit 0 family inet address 10.10.6.1/24
set interfaces ge-0/0/5 unit 0 family inet address 172.16.1.1/24
set interfaces lo0 unit 57 family inet address 10.0.0.1/32
set interfaces lo0 unit 57 family inet address 10.0.0.2/32
set routing-options static route 192.168.47.0/24 next-hop 10.10.6.2
set routing-options autonomous-system 100
set protocols bgp group external type external
set protocols bgp group external neighbor 172.16.1.2 peer-as 200
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0

[email protected]> show configuration |display set
set version 14.1R4.8
set system host-name R2
set system root-authentication encrypted-password “$1$rTWehPx5$nPL42fpA35Hbj0OeUeVoX0”
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces ge-0/0/0 unit 0 family inet address 10.10.4.2/24
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0

[email protected]> show configuration |display set
set version 14.1R4.8
set system host-name R3
set system root-authentication encrypted-password “$1$rTWehPx5$nPL42fpA35Hbj0OeUeVoX0”
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces ge-0/0/1 unit 0 family inet address 10.10.5.2/24
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0

[email protected]> show configuration |display set
set version 14.1R4.8
set system host-name R4
set system root-authentication encrypted-password “$1$rTWehPx5$nPL42fpA35Hbj0OeUeVoX0”
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces ge-0/0/2 unit 0 family inet address 10.10.6.2/24
set interfaces lo0 unit 47 family inet address 192.168.47.5/32
set interfaces lo0 unit 47 family inet address 192.168.47.6/32
set routing-options static route 0.0.0.0/0 next-hop 10.10.6.1
set protocols ospf area 0.0.0.0 interface ge-0/0/2.0

[email protected]> show configuration |display set
set version 14.1R4.8
set system host-name ISP
set system root-authentication encrypted-password “$1$rTWehPx5$nPL42fpA35Hbj0OeUeVoX0”
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces ge-0/0/0 unit 0 family inet address 192.168.10.1/24
set interfaces ge-0/0/5 unit 0 family inet address 172.16.1.2/24
deactivate interfaces ge-0/0/5
set routing-options generate route 0.0.0.0/0 policy gen-route-policy
set routing-options autonomous-system 200
set protocols bgp group external type external
set protocols bgp group external neighbor 172.16.1.1 peer-as 100
set protocols ospf export default-route
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0
set policy-options policy-statement default-route term 1 from protocol aggregate
set policy-options policy-statement default-route term 1 from route-filter 0.0.0.0/0 exact
set policy-options policy-statement default-route term 1 then accept
set policy-options policy-statement gen-route-policy term 1 from protocol bgp
set policy-options policy-statement gen-route-policy term 1 then accept
set policy-options policy-statement gen-route-policy term 2 then reject

[email protected]> show configuration |display set
set version 14.1R4.8
set system host-name Customer-Z
set system root-authentication encrypted-password “$1$GYvI4s4D$S32QQVMM3wzoISHYsJydZ0”
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces ge-0/0/0 unit 0 family inet address 192.168.10.2/24
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0

— R1:

set interfaces lo0 unit 57 family inet address 10.0.0.1/32
set interfaces lo0 unit 57 family inet address 10.0.0.2/32
set routing-options static route 192.168.47.0/24 next-hop 10.10.6.2

— R4:

set interfaces lo0 unit 47 family inet address 192.168.47.5/32
set interfaces lo0 unit 47 family inet address 192.168.47.6/32
set routing-options static route 0.0.0.0/0 next-hop 10.10.6.1

[email protected]> show routing-options 
static {
    route 192.168.47.0/24 next-hop 10.10.6.2;
}

> show route 
192.168.47.0/24    *[Static/5] 00:13:36
                    > to 10.10.6.2 via ge-0/0/2.0 

[email protected]> ping 192.168.47.5
PING 192.168.47.5 (192.168.47.5): 56 data bytes
64 bytes from 192.168.47.5: icmp_seq=0 ttl=64 time=4.157 ms
64 bytes from 192.168.47.5: icmp_seq=1 ttl=64 time=1.795 ms

[email protected]> show routing-options 
static {
    route 0.0.0.0/0 next-hop 10.10.6.1;
}

show route 
 0.0.0.0/0          *[Static/5] 00:12:51
                    > to 10.10.6.1 via ge-0/0/2.0

[email protected]> ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1): 56 data bytes
64 bytes from 10.0.0.1: icmp_seq=0 ttl=64 time=3.586 ms
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=2.503 ms

Share on print
Print
Share on google
Google+
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

The Juniper All-Access | Reading List

Leave a reply

Your email address will not be published. Required fields are marked *

ADENTECH guides

We love to help.

Get our newsletter, join the community: