In below example we will take three emulated juniper router and configure following setting on them.
- Hostname
- Root user Password
- Physical Interface
- Logical Interfaces
Just to remind that these routers just booted and they have no configuration. so first is to get access to Junos CLI.
When you will enter username and password it will present you with shell level access in order to get in to command line of JUNOS you need execute following command.
root@% cli
root@test>
In Junos we have two modes one is called Operational mode which is show with > sign and where we can run mostly show commands, other is configuration mode which is shown as # sign and here we can do our most of configuration. Simply typing ?and pressing at each mode will show which commands are available.
JUNOS1
root@JR1#set system host-name JR1
root@JR1#set system root-authentication encrypted-password j@unos1
root@JR1#set interfaces em0 unit 0 family inet address 192.168.12.1/24
root@JR1#set interfaces lo0 unit 0 family inet address 1.1.1.1/32
root@JR1#set interfaces lo0 unit 0 family inet address 1.1.1.1/32
root@JR1# commit
Verification
root@JR1# show interfaces
em0 {
unit 0 {
family inet {
address 192.168.12.1/24;
}
}
}
lo0 {
unit 0 {
family inet {
address 1.1.1.1/32;
}
}
}
em0 {
unit 0 {
family inet {
address 192.168.12.1/24;
}
}
}
lo0 {
unit 0 {
family inet {
address 1.1.1.1/32;
}
}
}
root@JR1> ping 192.168.12.2 count 4
PING 192.168.12.2 (192.168.12.2): 56 data bytes
64 bytes from 192.168.12.2: icmp_seq=0 ttl=64 time=0.945 ms
64 bytes from 192.168.12.2: icmp_seq=1 ttl=64 time=0.948 ms
64 bytes from 192.168.12.2: icmp_seq=2 ttl=64 time=0.841 ms
64 bytes from 192.168.12.2: icmp_seq=3 ttl=64 time=0.942 ms
--- 192.168.12.2 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.841/0.919/0.948/0.045 ms
PING 192.168.12.2 (192.168.12.2): 56 data bytes
64 bytes from 192.168.12.2: icmp_seq=0 ttl=64 time=0.945 ms
64 bytes from 192.168.12.2: icmp_seq=1 ttl=64 time=0.948 ms
64 bytes from 192.168.12.2: icmp_seq=2 ttl=64 time=0.841 ms
64 bytes from 192.168.12.2: icmp_seq=3 ttl=64 time=0.942 ms
--- 192.168.12.2 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.841/0.919/0.948/0.045 ms
In
Jonus ping is continuous and to stop you have to use break key. Thats
why we used count keyword to specify explicitly. And also pay intention
where we have executed ping command at operational mode. There is also
way of executing operational level commands from configuration mode
which we will see in next router verification.
root@JR2#set system host-name JR2
root@JR2#set system root-authentication encrypted-password j@unos2
root@JR2#set interfaces em0 unit 0 family inet address 192.168.12.2/24
root@JR2#set interfaces em1 unit 0 family inet address 192.168.23.2/24
root@JR2#set interfaces em1 unit 0 family inet address 192.168.23.2/24
root@JR2# commit
root@JR2# show interfaces
em0 {
unit 0 {
family inet {
address 192.168.12.2/24;
}
}
}
em1 {
unit 0 {
family inet {
address 192.168.23.2/24;
}
}
}
em0 {
unit 0 {
family inet {
address 192.168.12.2/24;
}
}
}
em1 {
unit 0 {
family inet {
address 192.168.23.2/24;
}
}
}
PING 192.168.12.1 (192.168.12.1): 56 data bytes
64 bytes from 192.168.12.1: icmp_seq=0 ttl=64 time=0.834 ms
64 bytes from 192.168.12.1: icmp_seq=1 ttl=64 time=0.980 ms
64 bytes from 192.168.12.1: icmp_seq=2 ttl=64 time=0.941 ms
64 bytes from 192.168.12.1: icmp_seq=3 ttl=64 time=1.452 ms
--- 192.168.12.1 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.834/1.052/1.452/0.237 ms
root@JR2# run ping 192.168.23.3 count 4
PING 192.168.23.3 (192.168.23.3): 56 data bytes
64 bytes from 192.168.23.3: icmp_seq=0 ttl=64 time=1.622 ms
64 bytes from 192.168.23.3: icmp_seq=1 ttl=64 time=0.844 ms
64 bytes from 192.168.23.3: icmp_seq=2 ttl=64 time=0.877 ms
64 bytes from 192.168.23.3: icmp_seq=3 ttl=64 time=1.025 ms
--- 192.168.23.3 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.844/1.092/1.622/0.313 ms
PING 192.168.23.3 (192.168.23.3): 56 data bytes
64 bytes from 192.168.23.3: icmp_seq=0 ttl=64 time=1.622 ms
64 bytes from 192.168.23.3: icmp_seq=1 ttl=64 time=0.844 ms
64 bytes from 192.168.23.3: icmp_seq=2 ttl=64 time=0.877 ms
64 bytes from 192.168.23.3: icmp_seq=3 ttl=64 time=1.025 ms
--- 192.168.23.3 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.844/1.092/1.622/0.313 ms
JUNOS3
root@JR3set system host-name JR3root@JR3#set system root-authentication encrypted-password j@unos3
root@JR3#set interfaces em1 unit 0 family inet address 192.168.23.3/24
root@JR3#set interfaces lo0 unit 0 family inet address 2.2.2.2/32
root@JR3# commit
root@JR3# show interfaces
em1 {
unit 0 {
family inet {
address 192.168.23.3/24;
}
}
}
lo0 {
unit 0 {
family inet {
address 2.2.2.2/32;
}
}
}
em1 {
unit 0 {
family inet {
address 192.168.23.3/24;
}
}
}
lo0 {
unit 0 {
family inet {
address 2.2.2.2/32;
}
}
}
root@JR3# run ping 192.168.23.2
PING 192.168.23.2 (192.168.23.2): 56 data bytes
64 bytes from 192.168.23.2: icmp_seq=0 ttl=64 time=0.660 ms
64 bytes from 192.168.23.2: icmp_seq=1 ttl=64 time=0.794 ms
^C
--- 192.168.23.2 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.660/0.727/0.794/0.067 ms
PING 192.168.23.2 (192.168.23.2): 56 data bytes
64 bytes from 192.168.23.2: icmp_seq=0 ttl=64 time=0.660 ms
64 bytes from 192.168.23.2: icmp_seq=1 ttl=64 time=0.794 ms
^C
--- 192.168.23.2 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.660/0.727/0.794/0.067 ms
No comments:
Post a Comment