Add, delete, rename an IP address on a Juniper interface

I am going to do a LAB to show you how you can add, delete and rename and IP address on a Juniper interface.

Let’s configure an IP address of 10.10.10.1/24 on the Ge-0/0/0 interface:

root@Juniper# edit interfaces ge-0/0/0 unit 0 family inet

[edit interfaces ge-0/0/0 unit 0 family inet]

root@Juniper# set address 10.10.10.1/24

[edit interfaces ge-0/0/0 unit 0 family inet]

root@Juniper# show

address 10.10.10.1/24;

[edit interfaces ge-0/0/0 unit 0 family inet]

root@Juniper#

We already know, we have to go to the logical interface and to the family inet because we want to put an IPv4 address. Now the IP address has been set on the ge-0/0/0 interface.

Say that I have decided to add 10.10.10.2/24 instead of 10.10.10.1/24 on that interface, do you think by adding the new IP it will replace the current one? Let’s try:

root@Juniper# set address 10.10.10.2/24

[edit interfaces ge-0/0/0 unit 0 family inet]

root@Juniper# show

address 10.10.10.1/24;

address 10.10.10.2/24;

[edit interfaces ge-0/0/0 unit 0 family inet]

root@Juniper#

Hmmmmmm.

Both IPs have been added now on the ge-0/0/0, so just adding another IP will not replace the old one on Juniper.

In this way, I can delete the IP address 10.10.10.1/24 in case I want to use the IP address 10.10.10.2/24. Let me show you how you can delete it:

[edit interfaces ge-0/0/0 unit 0 family inet]

root@Juniper# delete address 10.10.10.1/24

[edit interfaces ge-0/0/0 unit 0 family inet]

root@Juniper# show

address 10.10.10.2/24;

[edit interfaces ge-0/0/0 unit 0 family inet]

root@Juniper#

The IP address 10.10.10.1/24 has been deleted and the one which remain is 10.10.10.2/24 – excellent.

There is a way that you can rename the IP address in case you want to change it. For example, let’s say that I want to put the IP address 10.10.10.4/24 instead of 10.10.10.2/24. Let me show you how you can do that using the rename command:

[edit interfaces ge-0/0/0 unit 0 family inet]

root@Juniper# rename address 10.10.10.2/24 to address 10.10.10.4/24

[edit interfaces ge-0/0/0 unit 0 family inet]

root@Juniper# show

address 10.10.10.4/24;

[edit interfaces ge-0/0/0 unit 0 family inet]

root@Juniper#

Excellent, the IP address has been renamed to 10.10.10.4/24 😊

The last thing I want to show you in this lesson is how you can do one tasks for many interfaces. For example, I want to disable all FastEthernet interfaces, or I want to give them a description. This can be done using the interface range.

Let’s say that I want to give a description to the interfaces from fe-0/0/2 to fe-0/0/7. Let’s do it with the interface range:

root@Juniper# edit interfaces

[edit interfaces]

root@Juniper# set interface-range RANGE member-range fe-0/0/2 to fe-0/0/7

I have created an interface range and named it “RANGE” having members from fe-0/0/2 to fe-0/0/7.

Now I can go to the interface-range hierarchy level that I have created and set a description:

[edit interfaces]

root@Juniper# edit interface-range RANGE

[edit interfaces interface-range RANGE]

root@Juniper# set description “FastEthernet interfaces”

[edit interfaces interface-range RANGE]

root@Juniper# show

member-range fe-0/0/2 to fe-0/0/7;

description “FastEthernet interfaces”;

[edit interfaces interface-range RANGE]

root@Juniper#

Very good. I will commit and see if those interfaces have received the description:

[edit]

root@Juniper# commit

commit complete

[edit]

root@Juniper# run show interfaces descriptions

Interface       Admin Link Description

fe-0/0/2        up    down FastEthernet interfaces

fe-0/0/3        up    down FastEthernet interfaces

fe-0/0/4        up    down FastEthernet interfaces

fe-0/0/5        up    down FastEthernet interfaces

fe-0/0/6        up    down FastEthernet interfaces

fe-0/0/7        up    down FastEthernet interfaces

[edit]

root@Juniper#

Here we go! All selected interfaces from fe-0/0/2 to fe-0/0/7 have received a description of “FastEthernet interfaces” 😊

This is all what I wanted to show you in this lesson, I hope you enjoyed it and see you in the upcoming one.

Course Content

0 Comments

Submit a Comment

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


The reCAPTCHA verification period has expired. Please reload the page.

About