> For the complete documentation index, see [llms.txt](https://jncia-workbook.gitbook.io/workbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jncia-workbook.gitbook.io/workbook/junos-routing-policy/3-static-redistribution-control-part-1.md).

# 3) Static Redistribution Control (Part 1)

### Pre-Work

Load the config called **static.redist.challenge.cfg** using the **load\_config\_on\_nodes.py** script.

```
python3 load_config_on_nodes.py --lab_dir three-routers --config_filename static.redist.challenge.cfg
```

### Lab

<figure><img src="/files/c0CYd0NvRUNudU0KS6dR" alt=""><figcaption></figcaption></figure>

Currently, R1 is redistributing all static routes into OSPF.

Without editing the existing policy, ensure that `10.0.0.0/16` is not redistributed.

### Answer

<details>

<summary>Expand to reveal</summary>

```
set routing-options static route 10.0.0.0/16 discard no-readvertise
```

</details>

### Explanation

<details>

<summary>Expand to reveal</summary>

Currently, the policy on R1 is to redistribute all static routes into OSPF.

```
admin@R1> show configuration policy-options 
policy-statement STATIC_TO_OSPF {
    from protocol static;
    then {
        metric 10;
        external {
            type 1;
        }
        accept;
    }
}

```

\
We want to omit the 10.0.0.0/16 route from redistribution, yet we cannot edit the existing policy. This lab is testing your knowledge of the `no-readvertise` feature. This keyword can be added to a static route to prevent it from being redistributed into a routing protocol. This is a nice way to ensure that a static route is never leaked into your IGP or BGP.

```
set routing-options static route 10.0.0.0/16 discard no-readvertise
```

\
We should see that 10.0.0.0/16 is no longer an OSPF external route:

```
admin@R2> show ospf database external detail    
    OSPF AS SCOPE link state database
 Type       ID               Adv Rtr           Seq      Age  Opt  Cksum  Len 
Extern   10.0.1.0         10.0.0.1         0x80000001   378  0x22 0xf31f  36
  mask 255.255.255.0
  Topology default (ID 0)
    Type: 1, Metric: 10, Fwd addr: 0.0.0.0, Tag: 0.0.0.0
Extern   10.2.0.0         10.0.0.1         0x80000001   378  0x22 0xe62b  36
  mask 255.255.0.0
  Topology default (ID 0)
    Type: 1, Metric: 10, Fwd addr: 0.0.0.0, Tag: 0.0.0.0

```

</details>

### Further Reading

<https://community.juniper.net/discussion/keep-static-route-from-being-redistributed-into-dynamic-routing-protocols>
