Monday, March 23, 2015

Junos CLI Walkthrough

Lets Walkthrough the Junos CLI


Login to Junos

using username and password

show who is login now :))

================================================
> show system users 
 1:37PM  up 3:26, 1 user, load averages: 0.21, 0.17, 0.15
USER     TTY      FROM                              LOGIN@  IDLE WHAT
lab      p0       10.210.14.216                    1:36PM      - -cli (cli)    

=================================================

You can explore the available commands using ? "question marks"

> ?            
Possible completions:
  clear                Clear information in the system
  configure            Manipulate software configuration information
  file                 Perform file operations
  help                 Provide help information
  load                 Load information from file
  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
  save                 Save information to file
  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


You can use help topic or reference for search inside docs in the box

> help topic system login-alarms        
Configuring System Alarms to Appear Automatically on J Series Routers, EX Series
                     Ethernet Switches, and the QFX Series

   You can configure J Series routers, EX Series switches, and the QFX Series
   to execute a show system alarms command whenever a user with the login
   class admin logs in to the router or switch. To do so, include the
   login-alarms statement at the [edit system login class admin] hierarchy
   level.
     [edit system login class admin]
         login-alarms;
   For more information on the show system alarms command, see the Junos OS
   System Basics and Services Command Reference.

  Related-Topics

        * System Alarms on J Series Routers
        * show system alarms


> help reference system login      
                                     login

    Syntax

   login {
           announcement text;

                class class-name {
                        allow-commands "regular-expression";
                        allow-configuration "regular-expression";
                        deny-commands "regular-expression";
                        deny-configuration "regular-expression";
                        idle-timeout minutes;
                        login-tip;
                        permissions [ permissions ];

                }

           message text;

                password {
                        change-type (set-transitions | character-set);
                        format (md5 | sha1 | des);
                        maximum-length length;
                        minimum-changes number;
                        minimum-length length;

                }

                retry-options {
                        backoff-threshold number;
                        backoff-factor seconds;
                        minimum-time seconds;
                        tries-before-disconnect number;

                }

                user username {
                        full-name complete-name;
                        uid uid-value;
                        class class-name;
                        authentication authentication;
                        (encrypted-password "password" |
                        plain-text-password);
                        ssh-rsa "public-key";
                        ssh-dsa "public-key";
                                        
                }

   }

    Hierarchy Level

   [edit system]

    Release Information

   Statement introduced before JUNOS Release 7.4.

   Statement introduced in JUNOS Release 9.0 for EX Series switches.

    Description

   Configure user access to the router or switch.

   The remaining statements are explained separately.

    Required Privilege Level

   admin--To view this statement in the configuration.

   admin-control--To add this statement to the configuration.

    Related Topics

     * Configuring User Access


Cheers.....



Friday, March 20, 2015

vMX Layer 2 Bridging

Hi all,

Today lets play layer 2 bridging with vMX from Juniper Network










==================================================================

interfaces {
    ge-0/0/0 {
        description "MANAGEMENT PORT PLEASE DO NOT DELETE";
        mac 00:0c:29:44:95:2d;
        unit 0 {
            family inet {
                address 10.210.14.31/24;
            }
        }
    }
    ge-0/0/1 {
        mac 00:0c:29:44:95:37;
        unit 0 {
            family bridge {
                interface-mode trunk;
                vlan-id-list 100;
            }
        }
    }
    ge-0/0/2 {
        mac 00:0c:29:44:95:41;
        unit 0 {
            family bridge {
                interface-mode trunk;
                vlan-id-list 100;
            }
        }
    }
  irb {
        unit 100 {
            family inet {
                address 90.1.1.1/24;
            }
        }
        unit 200 {
            family inet {
                address 90.1.1.2/24;
            }
        }
    }
}
routing-instances {
    sw1 {
        instance-type virtual-switch;
        interface ge-0/0/1.0;
        bridge-domains {
            bd100 {
                vlan-id 100;
                routing-interface irb.100;
            }
        }
    }
    sw2 {
        instance-type virtual-switch;
        interface ge-0/0/2.0;
        bridge-domains {
            bd100 {
                vlan-id 100;
                routing-interface irb.200;
            }
        }
    }
}



==========================================================================


lab@vMX-1> show bridge domain extensive 

Routing instance: sw1
Bridge domain: bd100                          State: Active
Bridge VLAN ID: 100                         
Interfaces:
    ge-0/0/1.0
Total MAC count: 0 

Routing instance: sw2
Bridge domain: bd100                          State: Active
Bridge VLAN ID: 100                         
Interfaces:
    ge-0/0/2.0
Total MAC count: 0 


===========================================================

lab@vMX-1> show route 

inet.0: 5 destinations, 6 routes (5 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.210.14.0/24     *[Direct/0] 4d 03:04:47
                    > via ge-0/0/0.0
10.210.14.31/32    *[Local/0] 4d 03:04:47
                      Local via ge-0/0/0.0
90.1.1.0/24        *[Direct/0] 3d 06:41:08
                    > via irb.100
                    [Direct/0] 3d 06:37:29
                    > via irb.200
90.1.1.1/32        *[Local/0] 3d 06:43:11
                      Local via irb.100
90.1.1.2/32        *[Local/0] 3d 06:39:13
                      Local via irb.200

lab@vMX-1> ping 90.1.1.1 
PING 90.1.1.1 (90.1.1.1): 56 data bytes
64 bytes from 90.1.1.1: icmp_seq=0 ttl=64 time=3.044 ms
^C
--- 90.1.1.1 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 3.044/3.044/3.044/0.000 ms

lab@vMX-1> ping 90.1.1.2    
PING 90.1.1.2 (90.1.1.2): 56 data bytes
64 bytes from 90.1.1.2: icmp_seq=0 ttl=64 time=0.324 ms
64 bytes from 90.1.1.2: icmp_seq=1 ttl=64 time=0.728 ms
64 bytes from 90.1.1.2: icmp_seq=2 ttl=64 time=0.158 ms
^C
--- 90.1.1.2 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.158/0.403/0.728/0.239 ms


======================================================================

Interface routing and bridging can communicate with each other to one vMX

you can expand to add more tenant connect to the instances..... and more vlans also

it was just and examples... :))


 

Sunday, December 21, 2014

PEB Tunnel All C-VLAN  "New Style"

Hi all today we are going to simulate Layer 2 Service Provider using "New Style" Command Line Interface with Junos 12.3R1.7 remember that OK

Here is the sample Topology that we are going to simulate:





========================================================================

Here is the configuration in each router :

lab@mxA-2> show configuration | no-more     
## Last commit: 2014-12-22 02:34:53 UTC by lab
version 12.3R1.7;
system {
    host-name mxA-2;
    root-authentication {
        encrypted-password "$1$KI99zGk6$MbYFuBbpLffu9tn2.sI7l1"; ## SECRET-DATA
    }
    login {
        user lab {
            uid 2000;
            class super-user;
            authentication {
                encrypted-password "$1$84J5Maes$cni5Hrazbd/IEHr/50oY30"; ## SECRET-DATA
            }
        }
    }
    services {
        ftp;
        ssh;
        telnet;
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
}
interfaces {
    ge-1/1/0 {
        vlan-tagging;
        unit 0 {
            vlan-id 100;
            family inet {
                address 1.1.1.1/24;
            }
        }
        unit 1 {
            vlan-id 222;
            family inet {
                address 2.2.2.1/24;
            }
        }
    }
    fxp0 {
        description "MGMT INTERFACE - DO NOT DELETE";
        unit 0 {
            family inet {
                address 10.210.14.2/24;
            }
        }
    }
}

==============================================================

lab@mxA-1> show configuration 
## Last commit: 2014-12-22 02:34:42 UTC by lab
version 12.3R1.7;
system {
    host-name mxA-1;
    root-authentication {
        encrypted-password "$1$KI99zGk6$MbYFuBbpLffu9tn2.sI7l1"; ## SECRET-DATA
    }
    login {
        user lab {
            uid 2000;
            class super-user;
            authentication {
                encrypted-password "$1$84J5Maes$cni5Hrazbd/IEHr/50oY30"; ## SECRET-DATA
            }
        }
    }
    services {
        ftp;
        ssh;
        telnet;
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
}
interfaces {
    ge-1/1/0 {
        unit 0 {
            family bridge {
                interface-mode access;
                vlan-id 200;
            }
        }
    }
    ge-1/1/1 {
        unit 0 {
            family bridge {
                interface-mode trunk;
                vlan-id-list 200;       
            }
        }
    }
    fxp0 {
        description "MGMT INTERFACE - DO NOT DELETE";
        unit 0 {
            family inet {
                address 10.210.14.1/24;
            }
        }
    }
}
bridge-domains {
    test {
        vlan-id 200;
    }
}

====================================================================

lab@mxB-2> show configuration 
## Last commit: 2014-12-22 02:35:48 UTC by lab
version 12.3R1.7;
system {
    host-name mxB-2;
    root-authentication {
        encrypted-password "$1$KI99zGk6$MbYFuBbpLffu9tn2.sI7l1"; ## SECRET-DATA
    }
    login {
        user lab {
            uid 2000;
            class super-user;
            authentication {
                encrypted-password "$1$84J5Maes$cni5Hrazbd/IEHr/50oY30"; ## SECRET-DATA
            }
        }
    }
    services {
        ftp;
        ssh;
        telnet;
    }
    syslog {
        user * {
            any emergency;              
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
}
interfaces {
    ge-1/1/0 {
        flexible-vlan-tagging;
        encapsulation flexible-ethernet-services;
        unit 0 {
            family bridge {
                interface-mode trunk;
                vlan-id-list 200;
            }
        }
    }
    ge-1/1/1 {
        flexible-vlan-tagging;
        encapsulation flexible-ethernet-services;
        unit 0 {
            family bridge {
                interface-mode trunk;
                vlan-id-list 200;
            }
        }
    }
    fxp0 {
        description "MGMT INTERFACE - DO NOT DELETE";
        unit 0 {
            family inet {
                address 10.210.14.4/24;
            }
        }
    }
}
bridge-domains {
    test {
        vlan-id 200;
    }

}

================================================================================


[edit]
lab@mxC-1# show 
## Last changed: 2014-12-22 04:42:12 UTC
version 12.3R1.7;
system {
    host-name mxC-1;
    root-authentication {
        encrypted-password "$1$KI99zGk6$MbYFuBbpLffu9tn2.sI7l1"; ## SECRET-DATA
    }
    login {
        user lab {
            uid 2000;
            class super-user;
            authentication {
                encrypted-password "$1$84J5Maes$cni5Hrazbd/IEHr/50oY30"; ## SECRET-DATA
            }
        }
    }
    services {
        ftp;
        ssh;
        telnet;
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
}
interfaces {
    ge-1/1/0 {
        flexible-vlan-tagging;
        encapsulation flexible-ethernet-services;
        unit 0 {
            family bridge {
                interface-mode trunk;
                vlan-id-list 200;
            }
        }
    }
    ge-1/1/3 {
        unit 0 {
            family bridge {             
                interface-mode access;
                vlan-id 200;
            }
        }
    }
    fxp0 {
        description "MGMT INTERFACE - DO NOT DELETE";
        unit 0 {
            family inet {
                address 10.210.14.5/24;
            }
        }
    }
}
bridge-domains {
    test {
        vlan-id 200;
    }

} 

===========================================================================

lab@mxC-2> show configuration 
## Last commit: 2014-12-22 02:36:54 UTC by lab
version 12.3R1.7;
system {
    host-name mxC-2;
    root-authentication {
        encrypted-password "$1$KI99zGk6$MbYFuBbpLffu9tn2.sI7l1"; ## SECRET-DATA
    }
    login {
        user lab {
            uid 2000;
            class super-user;
            authentication {
                encrypted-password "$1$84J5Maes$cni5Hrazbd/IEHr/50oY30"; ## SECRET-DATA
            }
        }
    }
    services {
        ftp;
        ssh;
        telnet;
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
}
interfaces {
    ge-1/1/3 {
        vlan-tagging;
        unit 0 {
            vlan-id 100;
            family inet {
                address 1.1.1.2/24;
            }
        }
        unit 1 {
            vlan-id 222;
            family inet {
                address 2.2.2.2/24;
            }                           
        }
    }
    fxp0 {
        description "MGMT INTERFACE - DO NOT DELETE";
        unit 0 {
            family inet {
                address 10.210.14.6/24;
            }
        }
    }

}


================================================================

Test Connections

interfaces {
    ge-1/1/0 {
        vlan-tagging;
        unit 0 {
            vlan-id 100;
            family inet {
                address 1.1.1.1/24;
            }
        }
        unit 1 {
            vlan-id 222;
            family inet {
                address 2.2.2.1/24;
            }                           
        }
    }
    fxp0 {
        description "MGMT INTERFACE - DO NOT DELETE";
        unit 0 {
            family inet {
                address 10.210.14.2/24;
            }
        }
    }
}

lab@mxA-2> ping 1.1.1.2 rapid count 100 
PING 1.1.1.2 (1.1.1.2): 56 data bytes
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--- 1.1.1.2 ping statistics ---
100 packets transmitted, 100 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.523/0.603/4.442/0.432 ms

lab@mxA-2> ping 2.2.2.2 rapid count 100    
PING 2.2.2.2 (2.2.2.2): 56 data bytes
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--- 2.2.2.2 ping statistics ---
100 packets transmitted, 100 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.521/0.544/0.846/0.042 ms


lab@mxA-1> show bridge mac-table 

MAC flags (S -static MAC, D -dynamic MAC, L -locally learned, C -Control MAC
           SE -Statistics enabled, NM -Non configured MAC, R -Remote PE MAC)

Routing instance : default-switch
 Bridging domain : test, VLAN : 200
   MAC                 MAC      Logical          NH     RTR
   address             flags    interface        Index  ID
   cc:e1:7f:7c:b2:78   D        ge-1/1/0.0      
   cc:e1:7f:7c:d1:7b   D        ge-1/1/1.0      


lab@mxB-2> show bridge mac-table 

MAC flags (S -static MAC, D -dynamic MAC, L -locally learned, C -Control MAC
           SE -Statistics enabled, NM -Non configured MAC, R -Remote PE MAC)

Routing instance : default-switch
 Bridging domain : test, VLAN : 200
   MAC                 MAC      Logical          NH     RTR
   address             flags    interface        Index  ID
   cc:e1:7f:7c:b2:78   D        ge-1/1/1.0      
   cc:e1:7f:7c:d1:7b   D        ge-1/1/0.0      


lab@mxC-1> show bridge mac-table 

MAC flags (S -static MAC, D -dynamic MAC, L -locally learned, C -Control MAC
           SE -Statistics enabled, NM -Non configured MAC, R -Remote PE MAC)

Routing instance : default-switch
 Bridging domain : test, VLAN : 200
   MAC                 MAC      Logical          NH     RTR
   address             flags    interface        Index  ID
   cc:e1:7f:7c:b2:78   D        ge-1/1/0.0      
   cc:e1:7f:7c:d1:7b   D        ge-1/1/3.0      


interfaces {
    ge-1/1/3 {
        vlan-tagging;
        unit 0 {
            vlan-id 100;
            family inet {
                address 1.1.1.2/24;
            }
        }
        unit 1 {
            vlan-id 222;
            family inet {
                address 2.2.2.2/24;
            }                           
        }
    }
    fxp0 {
        description "MGMT INTERFACE - DO NOT DELETE";
        unit 0 {
            family inet {
                address 10.210.14.6/24;
            }
        }
    }
}


lab@mxC-2> traceroute 2.2.2.1 
traceroute to 2.2.2.1 (2.2.2.1), 30 hops max, 40 byte packets
 1  2.2.2.1 (2.2.2.1)  0.852 ms  0.623 ms  0.552 ms

lab@mxC-2> traceroute 1.1.1.1    
traceroute to 1.1.1.1 (1.1.1.1), 30 hops max, 40 byte packets
 1  1.1.1.1 (1.1.1.1)  0.948 ms  0.584 ms  0.536 ms

lab@mxC-2> ping 1.1.1.1 rapid count 100  
PING 1.1.1.1 (1.1.1.1): 56 data bytes
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--- 1.1.1.1 ping statistics ---
100 packets transmitted, 100 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.525/0.573/1.529/0.130 ms

lab@mxC-2> ping 2.2.2.1 rapid count 100    
PING 2.2.2.1 (2.2.2.1): 56 data bytes
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--- 2.2.2.1 ping statistics ---
100 packets transmitted, 100 packets received, 0% packet loss

round-trip min/avg/max/stddev = 0.522/0.556/0.947/0.060 ms




Please see the "interface mode: to customer facing using "access", so the provider tunnel all Customer Vlans