14 2009

Juniper学习杂记(七)配置Juniper路由器

Posted by admin in juniper

 

1.使用J-web来配置出厂化配置的设备
    i.用RJ45连接到fe-0/0/0 or ge-0/0/0 。使用支持128bit位的浏览器。
    ii.配置客户端IP地址,(可以使用Dhcp Client或者是static ip address form of 192.168.1.x/24.where x is any value from 2 to 254 .
    iii.PING 192.168.1.1 看能否PING通。然后用浏览器打开http://192.168.1.1
    iiii.系统将自动以root身份登录进J-web的configuration>quick configuration> setup wizard

 

快速配置页面功能总汇:
    1.访问安全:(Secure Access)
    2.端口(interfaces)
    3.用户(Users)
    4.SNMP(SNMP)
    5.Routing and Protocols 
    6.class of service:
    7.Firewall
    8.DHCP
    9.IPSec Tunnels:
    10.RPM
    11.Firewall Filters:

 

 

在Junos的show 中有一个非常方便的使用方法
   

[edit]
root@Junos# show interfaces em0
link-mode full-duplex;
unit 0 {
    family inet {
        address 192.168.1.254/24;
        address 10.0.0.5/24;
        address 1.1.1.2/24;
    }
}

[edit]
root@Junos# show interfaces em0 | display set
set interfaces em0 link-mode full-duplex
set interfaces em0 unit 0 family inet address 192.168.1.254/24
set interfaces em0 unit 0 family inet address 10.0.0.5/24
set interfaces em0 unit 0 family inet address 1.1.1.2/24

在配置模式下,通过show查看某个节点的配置,可以在后面加上PIPE选项(display set)即显示为配置命令。

 

image

 

 

 

image

 

物理接口逻辑单元:
    t1-4/0/0.43
逻辑接口在Junos中是必须的。
多播协议地址支持一个逻辑单元。

 

 

 

 

 

 

 

 

 

 

 

 

 

系统监控:

    Monitor > System    (CLI: show system …)
    System identiffication:
    System Time:显示系统启动时间,上次修改时间,上次路由协议高动时间等
    Users:显示用户登录相关信息。
    Memory Usage:
    CPU Usage:
    System Storage:

 

Monitoring the Chassis   (系统底层监控)
    J-web:Monitor > Chassis
    CLI:show chassis

image

 

 

 

 

 

 

 

 

 

 

 

 

Monitoring Interfaces:
image

 

 

 

 

 

 

 

 

 

 

    J-web: Monitor > Interfaces
    CLI: show interfaces terse

    MOnltoring an interface:
    CLI:root@Junos> monitor interface em0

image

收藏与分享
14 2009

Juniper学习杂记(五)<配置模式>

Posted by admin in juniper

使用edit ….进入配置模式
使用edit system …等路径进入需要配置的地方。
使用set 配置参数
可使用top、up、up n 、等命令Moveing

完全配置后使用commit保存配置。

Juniper最多可以保存50次以往配置。
ID为0的为当前活动配置
0-3存储在/config/目录下
4-49的存储在/var/db/config目录下面

可以使用configure exclusive进入排它配置模式,可以使用configure private进入只显示自己数据的模式.

root@Junos% cli
root@Junos> configure ?
Possible completions:
  <[Enter]>            Execute this command
  exclusive            Obtain exclusive lock (other users cannot make changes)
  private              Work in private database (other’s changes do not show)

 

 

配置文件差异对比:

可使用show | compare来对比当前修改过的配置与活动配置的差异。
可样可以使用show | compare rollback n 来对比活动配置与n号配置的差异。

root@Junos# show | compare rollback 5 
[edit system]
+  time-zone asia/chongqing;
[edit system login user yangybcy authentication]
-     encrypted-password "$1$BbQKmMvk$4fNVVgGYHUog3Sn/c8rb9."; ## SECRET-DATA
+     encrypted-password "$1$/lVD51tY$81XjgiyJTvaY.W04hQ.uP1"; ## SECRET-DATA
[edit system services]
-    ssh {
-        root-login allow;
-        protocol-version v2;
-    }
[edit interfaces em0 unit 0 family inet]
        address 10.0.0.5/24 { … }
+       address 1.1.1.2/24;

[edit]
在这儿可以看到-表示的是被修改过的配置。+号表示新增的配置。

还可以在Montor状态下使用file compare来对比文件。

 

移除某条配置:
可使用delete来删除某条配置。

[edit system services ssh]
root@Junos# set root-login allow   

[edit system services ssh]
root@Junos#

[edit system services ssh]
root@Junos# show
root-login allow;

[edit system services ssh]
root@Junos# delete root-login allow

[edit system services ssh]
root@Junos# show

[edit system services ssh]
root@Junos#

 

 

配置保存:
    对配置操作后,一定要使用commit保存配置,
    可使用commit check来检查当前配置的正确性、
    可使用commit confirmed 来验证修改后的配置是否可以正常运行。执行此命令后系统会自动在10分钟后返回当前活动配置。

root@Junos# commit confirmed   
commit confirmed will be automatically rolled back in 10 minutes unless confirmed
commit complete

# commit confirmed will be rolled back in 10 minutes
[edit system services ssh]
root@Junos#

    可使用commit at time  (21:00:00)来指定配置在什么时间保存
    可使用commit comment “TEXT”  来为此次保存的配置添加说明 
    可使用commit and-quit来执行保存后退出。

 

 

配置回退:
    可使用Rollback来回退配置,最多可以回退50个配置。
    rollback n

 

 

 

SAVE命令。
    可以把配置到其它地方。可以是LOCAL、FTP、TFTP等地方。

root@Junos# save ?
Possible completions:
  <filename>           Filename (URL, local, remote, or floppy)
  terminal             Use login terminal
[edit system services ssh]
root@Junos# save   

 

 

Load命令:

root@Junos# load ?  
Possible completions:
  factory-default      Override existing configuration with factory default
  merge                Merge contents with existing configuration
  patch                Load patch file into configuration
  replace              Replace configuration data
  set                  Execute set of commands on existing configuration
  update               Update existing configuration
[edit system services ssh]

 

 

RUN命令:

收藏与分享