Tuesday, March 24, 2015

Junos System Configuration Walkthrough


Let us walktrhough the Initial Junos System Configuration


First try the factory default...

1# load factory-default 
warning: activating factory configuration

check the config... can you do the commit ???


# commit check 
[edit]
  'system'
    Missing mandatory statement: 'root-authentication'
error: configuration check-out failed: (missing statements)


You must set the root password :))


set system root-authentication plain-text-password    
New password:


Enter your new root password and commit


now you should see the results

# commit 
commit complete

now try login as root

% cli
root@> 

root@> show system users 
 6:51AM  up 3:43, 1 user, load averages: 0.15, 0.17, 0.16
USER     TTY      FROM                              LOGIN@  IDLE WHAT
root     p0       10.210.14.216                    6:51AM      - cli           

Now you can login as root :))


root@labs# set system host-name labs 

[edit]
root@labs# set system time-zone Asia/Jakarta 

root@labs#set interfaces ge-0/0/0 unit 0 family inet address 192.168.1.1/24

root@labs# set routing-options static route 0/0 next-hop 192.168.1.100




system {
    host-name labs;
    time-zone Asia/Jakarta;
}
interfaces {
    ge-0/0/0 {
        unit 0 {                        
            family inet {
                address 192.168.1.1/24;
            }
        }
    }
}
routing-options {
    static {
        route 0.0.0.0/0 next-hop 192.168.1.100;
    }
}


Now check the process in the box

root@labs> show system processes extensive 
last pid: 12495;  load averages:  0.51,  0.28,  0.20  up 0+03:54:25    07:02:53
128 processes: 17 running, 97 sleeping, 2 zombie, 12 waiting

Mem: 149M Active, 96M Inact, 1030M Wired, 174M Cache, 112M Buf, 523M Free
Swap:


  PID USERNAME  THR PRI NICE   SIZE    RES STATE  C   TIME   WCPU COMMAND
 1460 root        7  76    0   997M 64872K select 0 726:58 288.57% flowd_octeon_hm
   22 root        1 171   52     0K    16K RUN    0 183:19 75.15% idle: cpu0
   19 root        1 171   52     0K    16K RUN    3   3:02  0.00% idle: cpu3
   20 root        1 171   52     0K    16K RUN    2   3:02  0.00% idle: cpu2
 1444 root        1  76    0   115M 18284K select 0   2:49  0.00% chassisd
   21 root        1 171   52     0K    16K RUN    1   2:22  0.00% idle: cpu1
 1482 root        1  76    0 17664K  8896K select 0   1:46  0.00% utmd
   24 root        1 -20 -139     0K    16K WAIT   0   1:29  0.00% swi7: clock
 1486 root        1  76    0 12532K  6284K select 0   0:58  0.00% license-check
 1449 root        1  76    0 28068K 10592K select 0   0:23  0.00% mib2d
    5 root        1 -16    0     0K    16K rtfifo 0   0:23  0.00% rtfifo_kern_recv
 1451 root        1  76    0 20300K  8752K select 0   0:20  0.00% l2ald
 1471 root        1  76    0 15984K  3544K select 0   0:17  0.00% shm-rtsdbd
   80 root        1  -8    0     0K    16K mdwait 0   0:17  0.00% md1
 1445 root        1  76    0 12760K  5856K select 0   0:14  0.00% alarmd
 1448 root        1  76    0 20304K 12404K select 0   0:13  0.00% snmpd
   23 root        1 -40 -159     0K    16K WAIT   0   0:12  0.00% swi2: netisr 0
 1453 root        2  76    0 25500K  9116K select 0   0:10  0.00% pfed
 1450 root        1   4    0 52280K 22864K kqread 0   0:07  0.00% rpd
   48 root        1 -16    0     0K    16K psleep 0   0:06  0.00% vmkmemdaemon
 1441 root        1  76    0  3304K  1384K select 0   0:06  0.00% bslockd
 1455 root        1  76    0 26896K 10460K select 0   0:05  0.00% kmd
 1456 root        1  76    0 10028K  4304K select 0   0:05  0.00% ppmd
    3 root        1  -8    0     0K    16K -      0   0:04  0.00% g_up
 1484 root        3  76    0 13816K  5452K select 0   0:04  0.00% wland
11386 root        1  76    0 48692K 23792K select 0   0:03  0.00% mgd
   26 root        1 -16    0     0K    16K -      0   0:03  0.00% yarrow
    4 root        1  -8    0     0K    16K -      0   0:03  0.00% g_down
 1485 root        1   4    0  9632K  4128K kqread 0   0:03  0.00% mcsnoopd
 1481 root        1  76    0 13644K  6088K select 0   0:03  0.00% rtlogd
    9 root        1 171   52     0K    16K pgzero 0   0:03  0.00% pagezero
 1443 root        1  76    0 35144K  8000K select 0   0:03  0.00% dcd
 1478 root        1  76    0 30644K  9212K select 0   0:03  0.00% idpd
 1469 root        1  76    0 19008K  6888K select 0   0:03  0.00% smid
 1447 root        1  76    0 39232K 22832K select 0   0:03  0.00% mgd
 1109 root        1  76    0 12804K  4580K select 0   0:02  0.00% eventd
 1458 root        1  76    0  7960K  2996K RUN    0   0:02  0.00% irsd
 1473 root        1  76    0 25736K 12220K select 0   0:02  0.00% nsd
 1474 root        1  76    0 14436K  5976K select 0   0:02  0.00% pkid
    2 root        1  -8    0     0K    16K -      0   0:02  0.00% g_event
   43 root        1  20    0     0K    16K vnlrum 0   0:02  0.00% vnlru_mem
   41 root        1  20    0     0K    16K syncer 0   0:01  0.00% syncer
 1454 root        1  76    0 19276K  8260K select 0   0:01  0.00% cosd
11825 nobody      1 120    0  8900K  3652K select 0   0:01  0.00% httpd
    1 root        1   8    0  1696K   904K wait   0   0:01  0.00% init
11385 root        1  76    0 50220K 16868K select 0   0:01  0.00% cli
 1472 root        1  76    0 13844K  6392K select 0   0:01  0.00% jsrpd
 1459 root        1  76    0 13160K  5916K select 0   0:01  0.00% bfdd
 1440 root        1  76    0  2276K   884K select 0   0:01  0.00% watchdog
 1475 root        1  76    0 13360K  5588K select 0   0:01  0.00% httpd-gk
11346 root        1  76    0  9320K  3132K select 0   0:01  0.00% sshd
 1476 root        1  76    0 18592K  5712K select 0   0:01  0.00% appidd
 1446 root        1  76    0 13328K  5012K select 0   0:01  0.00% craftd
 1457 root        1  76    0 22980K  8116K select 0   0:01  0.00% dfwd
   32 root        1   8    0     0K    16K dwcint 0   0:01  0.00% dwc0
 1477 root        1  76    0 19692K  5952K select 0   0:01  0.00% appsecured
 1468 root        1  94    0 14856K  5360K select 0   0:01  0.00% wwand
   27 root        1 -28 -147     0K    16K WAIT   0   0:00  0.00% swi5: cambio
 1480 root        1 139    0 10548K  3424K select 0   0:00  0.00% nstraced
 1464 root        1 139    0 19104K  4916K select 0   0:00  0.00% bdbrepd
 1466 root        1  93    0 10604K  2996K select 0   0:00  0.00% sendd
 1487 root        1 139    0  9816K  2980K select 0   0:00  0.00% sdxd
 1711 root        1  76    0     0K    16K select 0   0:00  0.00% peerproxy00000001
 1461 root        1  76    0  8804K  3100K select 0   0:00  0.00% pppd
 1483 root        1  76    0  8120K  2532K select 0   0:00  0.00% smtpd
   44 root        1 -16    0     0K    16K sdflus 0   0:00  0.00% softdepflush
   42 root        1  -4    0     0K    16K vlruwt 0   0:00  0.00% vnlru
   40 root        1 -16    0     0K    16K psleep 0   0:00  0.00% bufdaemon
 1463 root        1  91    0 10528K  2784K select 0   0:00  0.00% mplsoamd
 1470 root        1  95    0  8080K  2620K select 0   0:00  0.00% relayd
  322 root        1  -8    0     0K    16K mdwait 0   0:00  0.00% md2
 1185 root        1   8    0  2672K   876K nanslp 0   0:00  0.00% cron
11369 root        1  20    0  5024K  3032K pause  0   0:00  0.00% csh
   47 root        1 -16    0     0K    16K psleep 0   0:00  0.00% vmuncachedaemon
 1452 root        1  76    0  6084K  1984K select 0   0:00  0.00% inetd
   57 root        1  -8    0     0K    16K mdwait 0   0:00  0.00% md0
12455 root        1 139    0  3184K  2136K select 0   0:00  0.00% ntpd
    6 root        1   8    0     0K    16K -      0   0:00  0.00% kqueue taskq
 1442 root        1  83    0  2712K  1264K select 0   0:00  0.00% tnetd
 1082 root        1  76    0  2392K  1208K select 0   0:00  0.00% usbd
 1488 root        1   5    0  2832K  1308K ttyin  0   0:00  0.00% getty
    8 root        1 -16    0     0K    16K psleep 0   0:00  0.00% pagedaemon
12495 root        1  78    0 24272K  1840K CPU0   0   0:00  0.00% top
   46 root        1   4    0     0K    16K pfeacc 0   0:00  0.00% if_pfe_listen
   49 root        1   4    0     0K    16K pfeacc 0   0:00  0.00% if_pic_listen0
 1279 root        1  -8    0     0K    16K mdwait 0   0:00  0.00% md3
 1294 root        1  -8    0     0K    16K mdwait 0   0:00  0.00% md4
    0 root        1  -8    0     0K     0K WAIT   0   0:00  0.00% swapper
   36 root        1   8    0     0K    16K usbevt 0   0:00  0.00% usb1
   33 root        1   8    0     0K    16K usbevt 0   0:00  0.00% usb0
   31 root        1 -48 -167     0K    16K WAIT   0   0:00  0.00% swi0: uart
    7 root        1   8    0     0K    16K -      0   0:00  0.00% thread taskq
   37 root        1 -36 -155     0K    16K WAIT   0   0:00  0.00% swi3: ip6opt ipopt
   45 root        1  76    0     0K    16K sleep  0   0:00  0.00% netdaemon
   51 root        1   4    0     0K    16K dump_r 0   0:00  0.00% kern_dump_proc
   54 root        1   8    0     0K    16K -      0   0:00  0.00% nfsiod 2
   50 root        1   4    0     0K    16K purge_ 0   0:00  0.00% kern_pir_proc
   52 root        1   8    0     0K    16K -      0   0:00  0.00% nfsiod 0
   53 root        1   8    0     0K    16K -      0   0:00  0.00% nfsiod 1
   55 root        1   8    0     0K    16K -      0   0:00  0.00% nfsiod 3
   35 root        1   8    0     0K    16K dwcint 0   0:00  0.00% dwc1
   34 root        1   8    0     0K    16K usbtsk 0   0:00  0.00% usbtask
   10 root        1 -16    0     0K    16K ktrace 0   0:00  0.00% ktrace
   29 root        1 -12 -131     0K    16K WAIT   0   0:00  0.00% swi9: +
   28 root        1 -12 -131     0K    16K WAIT   0   0:00  0.00% swi9: task queue
   30 root        1 -16 -135     0K    16K WAIT   0   0:00  0.00% swi8: +
   25 root        1 -24 -143     0K    16K WAIT   0   0:00  0.00% swi6: vm
   38 root        1 -32 -151     0K    16K WAIT   0   0:00  0.00% swi4: ip6mismatch+
   39 root        1 -44 -163     0K    16K WAIT   0   0:00  0.00% swi1: ipfwd
   15 root        1 171   52     0K    16K CPU0   0   0:00  0.00% idle: cpu7
   14 root        1 171   52     0K    16K CPU0   0   0:00  0.00% idle: cpu8
   18 root        1 171   52     0K    16K CPU0   0   0:00  0.00% idle: cpu4
   12 root        1 171   52     0K    16K CPU0   0   0:00  0.00% idle: cpu10
   11 root        1 171   52     0K    16K CPU0   0   0:00  0.00% idle: cpu11
   13 root        1 171   52     0K    16K CPU0   0   0:00  0.00% idle: cpu9
   17 root        1 171   52     0K    16K CPU0   0   0:00  0.00% idle: cpu5
   16 root        1 171   52     0K    16K CPU0   0   0:00  0.00% idle: cpu6



For specific purpose you can try 

root@labs> show system processes extensive | match ntp            
12455 root        1 139    0  3184K  2136K select 0   0:00  0.00% ntpd


root@labs> show system storage 
Filesystem              Size       Used      Avail  Capacity   Mounted on
/dev/da0s1a             610M       157M       404M       28%  /
devfs                   1.0K       1.0K         0B      100%  /dev
/dev/md0                 20M       6.4M        12M       36%  /junos
/cf/packages            610M       157M       404M       28%  /junos/cf/packages
devfs                   1.0K       1.0K         0B      100%  /junos/cf/dev
/dev/md1                415M       415M         0B      100%  /junos
/cf                      20M       6.4M        12M       36%  /junos/cf
devfs                   1.0K       1.0K         0B      100%  /junos/dev/
/cf/packages            610M       157M       404M       28%  /junos/cf/packages1
procfs                  4.0K       4.0K         0B      100%  /proc
/dev/bo0s3e              46M        32K        42M        0%  /config
/dev/bo0s3f             618M       308M       260M       54%  /cf/var
/dev/md2                336M        18M       291M        6%  /mfs
/cf/var/jail            618M       308M       260M       54%  /jail/var
/cf/var/log             618M       308M       260M       54%  /jail/var/log
devfs                   1.0K       1.0K         0B      100%  /jail/dev
/dev/md3                 63M       4.0K        58M        0%  /mfs/var/run/utm
/dev/md4                1.8M       4.0K       1.7M        0%  /jail/mfs

root@labs> show interfaces terse | match ge 
ge-0/0/0                up    up  
ge-0/0/0.0              up    up   inet     192.168.1.1/24
ge-0/0/1                up    up  
ge-0/0/2                up    up  
ge-0/0/3                up    up  
ge-0/0/4                up    up  
ge-0/0/5                up    up  
ge-0/0/6                up    up  
ge-0/0/7                up    up  
ge-0/0/8                up    up  
ge-0/0/9                up    up  








No comments:

Post a Comment