# RIP Configuration

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2Fi8qzv5sV7A0b6lLDH8Og%2FScreenshot%20from%202023-07-01%2011-32-54.png?alt=media&#x26;token=7625fcb4-486c-4b28-9af6-b66b508ffb0e" alt=""><figcaption></figcaption></figure>

```
R1(config)# router rip
R1(config-router)# version 2
R1(config-router)# no auto-summary
R1(config-router)# network 10.0.0.0
R1(config-router)# network 172.16.0.0
```

The RIP 'network' command is classful, it will automatically convert to classful networks.

For example, even if you enter the command.

* _**network 10.0.12.0**_, it will be converted to _**network 10.0.0.0**_ (a class A network).

There is no need to enter the network mask.

## The _network_ command

The _**network**_ command tells the router to:

* look for interfaces with an IP address that is in the specific range.
* active RIP on the interfaces that fall in the range.
* form adjacencies with connected RIP neighbors.
* advertise **the network prefix of the interface** (NOT the prefix in the _**network**_ command).

The OSPF and EIGRP _**network**_ commands operate in the same way.

### Example

```
R1(config-router)# network 10.0.0.0
```

* Because the _**network**_ command is classful, 10.0.0.0 is assumed to be 10.0.0.0/8.
* R1 will look for any interfaces with an IP address that matches 10.0.0.0/8 (because it is /8 it only needs to match the first 8 bits).
* 10.0.12.1 and 10.0.13.1 both match, so RIP is activated on G0/0 and G1/0.
* R1 forms adjacencies with its neighbors R2 and R3.
* R1 advertises 10.0.12.0/30 and 10.0.13.0/30 (NOT 10.0.0.0/8) to its RIP neighbors.

{% hint style="info" %}
The _**network**_ command doesn't tell the router which networks to advertise. It tells the route which interfaces to activate RIP on, and then the router will advertise the network prefix of those interfaces.
{% endhint %}

```
R1(config-router)# network 172.16.0.0
```

* Because the _**network**_ command is classful, 172.16.0.0 is assumed to be 172.16.0.0/16.
* R1 will look for any interfaces with an IP address that matches 172.16.0.0/16.
* 172.16.1.14 matches, so R1 will activate RIP on G2/0.
* There are no RIP neighbors connected to G2/0, so no new adjacencies are formed.
* R1 advertises 172.16.1.0/28 (NOT 172.16.0.0/16) to its RIP neighbors.

{% hint style="info" %}
Although there are no RIP neighbors connected to G2/0, R1 will continuously send RIP advertisements out of G2/0. This is unnecessary traffic, so G2/0 should be configured as a **passive interface**.
{% endhint %}

```
R1(config-router)# passive-interface g2/0
```

The **passive-interface** command tells the router to stop sending RIP advertisements out of the specified interface (G2/0).

However, the router will continue to advertise the network prefix of the interface (172.16.1.0/28) to its RIP neighbors (R2, R3).

You should always use this command on interfaces which don't have any RIP neighbors.

EIGRP and OSPF both have the same passive interface functionality, using the same command.

## Advertise a default routo into RIP

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FIXmxG2NYWIiAFOKv3XL7%2FScreenshot%20from%202023-07-01%2014-14-46.png?alt=media&#x26;token=e70f2557-3723-4f86-9e7e-83c3ca781913" alt=""><figcaption></figcaption></figure>

```
R1(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.2
```

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FWnZDFmtiNTvFajNBekEo%2FScreenshot%20from%202023-07-01%2014-16-49.png?alt=media&#x26;token=26376482-fcb5-4bb1-952a-7090112aa7ec" alt=""><figcaption></figcaption></figure>

To propagate the default gateway we use:

```
R1(config-router)# default-information originate
```

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FzBwFsJHOcfr33u6om8Ey%2FScreenshot%20from%202023-07-01%2014-17-14.png?alt=media&#x26;token=ccdbbdb4-bfd6-4151-928c-4c8c3b1c0feb" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FLuJiNG4kMFC16wnF3ajf%2FScreenshot%20from%202023-07-01%2014-18-27.png?alt=media&#x26;token=32dcfadc-8335-400d-8967-f1f703fac740" alt=""><figcaption></figcaption></figure>

## _Show ip protocols_

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2Fo7Yz09USboIImGLZ6PE5%2FScreenshot%20from%202023-07-01%2014-19-37.png?alt=media&#x26;token=02fb8ecd-6843-4e81-816f-7bfb92b81fb2" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FPxgEBSjs600THdsVtf1u%2FScreenshot%20from%202023-07-01%2014-20-20.png?alt=media&#x26;token=9b0db636-6c54-4658-89d4-e08d9bcbf68b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FmKdjf6SGPqjTGGGikder%2FScreenshot%20from%202023-07-01%2014-20-55.png?alt=media&#x26;token=1e12e535-683f-47d5-a49f-b3ae2744069c" alt=""><figcaption></figcaption></figure>
