Saturday, April 30, 2011

JUNOS Switching Basics

Juniper CLI

Connecting through console,
When you login to a juniper box, (username: root, without password), BSD prompt appears:
root@%
you have several unix command to control the box, for those who know BSD, that's enough:
root@% pwd
/root
root@% cli
root>

CLI command (above) brings you to JUNOS shell:

root>

root> ?
Possible completions:

clear Clear information in the system
configure Manipulate software configuration information
file Perform file operations
help Provide help information
monitor Show real-time debugging information
mtrace Trace multicast path from source to receiver
op Invoke an operation script
ping Ping remote target
quit Exit the management session
request Make system-level requests
restart Restart software process
set Set CLI properties, date/time, craft interface message
show Show system information
ssh Start secure shell on another host
start Start shell
telnet Telnet to another host
test Perform diagnostic debugging
traceroute Trace route to remote host

This is simple clean configuration of Juniper EX4200:

root> show configuration
## Last commit: 2008-07-27 14:13:35 UTC by root
version 9.0R2.10;
system {
root-authentication {
encrypted-password "$1$UyFEalx8$EvbHYVOcKL/vaVwdQfvMN/"; ## SECRET-DATA
}
syslog {
user * {
any emergency;
}
file messages {
any notice;
authorization info;
}
file interactive-commands {
interactive-commands any;
}
}
}
interfaces {
ge-0/0/0 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/1 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/2 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/3 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/4 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/5 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/6 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/7 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/8 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/9 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/10 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/11 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/12 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/13 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/14 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/15 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/16 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/17 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/18 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/19 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/20 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/21 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/22 {
unit 0 {
family ethernet-switching;
}
}
ge-0/0/23 {
unit 0 {
family ethernet-switching;
}
}
ge-0/1/0 {
unit 0 {
family ethernet-switching;
}
}
xe-0/1/0 {
unit 0 {
family ethernet-switching;
}
}
ge-0/1/1 {
unit 0 {
family ethernet-switching;
}
}
xe-0/1/1 {
unit 0 {
family ethernet-switching;
}
}
ge-0/1/2 {
unit 0 {
family ethernet-switching;
}
}
ge-0/1/3 {
unit 0 {
family ethernet-switching;
}
}
vme {
unit 0 {
family inet {
address 192.168.1.253/24;
}
}
}
}
protocols {
lldp {
interface all;
}
rstp;
}
virtual-chassis {
member 0 {
mastership-priority 255;
}
}
poe {
interface all;
}

root>
Yes, This is a new EX4200 Switch

root> show version
Model: ex4200-24t
JUNOS Base OS boot [9.0R2.10]
JUNOS Base OS Software Suite [9.0R2.10]
JUNOS Kernel Software Suite [9.0R2.10]
JUNOS Crypto Software Suite [9.0R2.10]
JUNOS Online Documentation [9.0R2.10]
JUNOS Enterprise Software Suite [9.0R2.10]
JUNOS Packet Forwarding Engine Enterprise Software Suite [9.0R2.10]
JUNOS Routing Software Suite [9.0R2.10]
JUNOS Web Management [9.0R2.10]

Let's look at default VLAN

root> show vlans
Name Tag Interfaces
default
ge-0/0/0.0, ge-0/0/1.0*, ge-0/0/2.0*, ge-0/0/3.0, ge-0/0/22.0, ge-0/0/23.0,
xe-0/1/0.0, xe-0/1/1.0
mgmt
me0.0*

root>

It runs RSTP by default (Cisco runs PVST+)

root> show spanning-tree bridge brief
STP bridge parameters
Context ID : 0
Enabled protocol : RSTP
Root ID : 32768.00:1f:12:31:b8:40
Hello time : 2 seconds
Maximum age : 20 seconds
Forward delay : 15 seconds
Message age : 0
Number of topology changes : 0
Local parameters
Bridge ID : 32768.00:1f:12:31:b8:40
Extended system ID : 0
Internal instance ID : 0
root> show spanning-tree interface
Spanning tree interface parameters for instance 0

Interface Port ID Designated port ID Designated bridge ID Port Cost State Role

ge-0/0/0.0 128:513 128:513 32768.001f1231b840 20000 BLK DIS
ge-0/0/1.0 128:514 128:514 32768.001f1231b780 20000 FWD ROOT
ge-0/0/2.0 128:515 128:515 32768.001f1231b780 20000 BLK ALT

How to configure it?


root>

root> edit
Entering configuration mode
Users currently editing the configuration:
root terminal p0 (pid 698) on since 2008-07-27 14:08:30 UTC, idle 00:07:02
[edit]

[edit]
root#
root#
after making required change:

root# commit
commit complete

[edit]

No comments:

Post a Comment