[文档] Juniper入门实验文档 junos SRX设备实验学习手册 |
Juniper入门实验文档 junos SRX设备实验学习手册 ![]() Juniper入门实验文档 junos SRX设备实验学习手册 ![]() Juniper入门实验文档 junos SRX设备实验学习手册 ![]() 说明: 本文旨在介绍juniper SRX系列,通过相应的实验,了解junos的基本原理以及使用方法。 本文会通过搭建虚拟环境,详细描述基于junos的一些基本配置。 本文档建议有一定防火墙配置基础的人士使用。 本文不对硬件设备的基本信息做详细描述(如型号、licnese等)。 本文不对底层桥接做过多讲解,如有疑问请参考 <http://pan.baidu.com/share/link? ... amp;uk=20104252> 密码:8ixp 本文档所有试验本人手敲次数不下30次,还望大家在理解的基础上多加练习。 本文档建议全屏观看(工程师出身不懂得排版) 本文所使用以下软件进行模拟(以下虚拟机请在网上自行查找),如有能力,支持正版。 vSRX GNS3 ASA-虚拟机 WIN7 JUNOS入门: 第一部分:模式介绍: 基于junos的硬件设备,加点开机之后,新设备使用用户名root密码为空,会直接进入root@% 模式。 该模式属于底层系统模式(unix底层)我们使用root@% cli 命令,进入junos系统(类似cisco的特权模式)root> root> ? //在该模式下可以使用一下命令 Possible completions: clear Clear information in the system //清除系统信息,如接口信息,arp,dhcp,路由信息等 configure Manipulate software configuration information //进入全局配置模式 file Perform file operations //文件查看 help Provide help information //类似unix/linux下的man 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 //用于切换回unix底层,可以基于shell或者用户切换 telnet Telnet to another host test Perform diagnostic debugging traceroute Trace route to remote host root> configure //进入全局配置模式 Entering configuration mode [edit] root# //全局配置模式 在进入局配置模式时,有三种模式: shared mode:允许多个人同时登陆,并修改配置 exclusive mode:排除模式,只有当前用户才能登陆系统,并对设备进行配置 private configuration:私有模式,允许多个用户登陆,相互之间的配置互不影响(在不提交配置之前) 在全局配置模式下,对junos进行配置时使用层次化配置如图: 即当我们想对ospf配置的时候,要先进入protocol然后在配置ospf如: [edit] //该提示付表示我们当前的位置即在configuration root root# set protocols ospf area 0.0.0.0 interface g0/0/0 //将G0/0/0接口放入ospf area 0,我们也可以使用以下方法 root# edit protocols //进入protocols编辑 [edit protocols] //标识当前的位置在protocols编辑层面 root# set ospf area 0.0.0.0 interface g0/0/0 //将接口放置在area 0 通过上面这个例子,我们可以简单的理解junos层次化设计的思想,在接下来的讲解中,我们会再深入这个问题 我们举一个接口配置的例子: [edit] root# set interfaces ge-0/0/0.0 family inet address 202.102.224.1/24 //这里的Ge-0/0/0.0作用通下一个命令 root# set interfaces ge-0/0/0 unit 0 family inet address 202.102.224.1/24 //在JUNOS中,物理接口是不允许配置IP地址的,必须使用子接口 [edit] root# edit interfaces ge-0/0/0 unit 0 //我们进入ge-0/0/0的子接口0的编辑目录 [edit interfaces ge-0/0/0 unit 0] //标识我们进入该目录 root# set family inet address 1.1.1.1/24 //对ge-0/0/0.0进行ip地址设置 [edit interfaces ge-0/0/0 unit 0] root# show family inet //在子接口目录进行show address 1.1.1.1/24; 我们使用edit进入不同层次的目录,可以使用up逐层推出,也可以使用exit直接退出到configuration root目录 使用edit进入不同目录时,都可以使用show delete等命令查看该目录的配置信息 通配符的使用: [edit] root# wildcard delete interfaces ge-0/* //我们可以使用wildcard命令,删除包含某些字符的所有配置 matched: ge-0/0/0 Delete 1 objects? [yes,no] (no) rename命令: [edit] root# rename security zones security-zone trust to security-zone new-trust //我们将trust这个zone重命名为new-trust replace命令: [edit] root# set interfaces ge-0/0/0 unit 0 family inet address 1.1.1.1/24 //配置ge-0/0/0.0接口地址为1.1.1.1/24 root# replace pattern ge-0/0/0 with ge-0/0/1 //此时我们将配置中的ge-0/0/0替换为ge-0/0/1 [edit] root# show interfaces //查看配置信息 ge-0/0/1 { unit 0 { family inet { address 1.1.1.1/24; } } } copy命令: [edit] root# copy interfaces ge-0/0/1 to ge-0/0/0 //将0/1接口下的配置复制到0/0接口 [edit] root# show interfaces ge-0/0/0 { unit 0 { family inet { address 1.1.1.1/24; } } } ge-0/0/1 { unit 0 { family inet { address 1.1.1.1/24; } } } commit命令: 相比于cisco,junos会更严谨,我们在配置完成之后,只有使用commit命令,配置才会生效,这样方便管理员在配置之后,先查看自己的配置是否有问题,然后再确认配置(commit) root# run show configuration | display set //run,类似cisco的do,这里出现的命令,可以直接刷到配置上 root> show interfaces //查看物理接口信息,注意这里的提示符> Physical interface: ge-0/0/0, Enabled, Physical link is Up Interface index: 133, SNMP ifIndex: 506 Link-level type: Ethernet, MTU: 1514, Speed: 1000mbps, BPDU Error: None, MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled, Flow control: Enabled, Auto-negotiation: Enabled, Remote fault: Online Device flags : Present Running Interface flags: SNMP-Traps Internal: 0x4000 Link flags : None CoS queues : 8 supported, 8 maximum usable queues Current address: 00:0c:29:b8:b4:c9, Hardware address: 00:0c:29:b8:b4:c9 Last flapped : 2014-03-11 16:34:51 UTC (00:51:53 ago) Input rate : 0 bps (0 pps) Output rate : 0 bps (0 pps) Active alarms : None Active defects : None Interface transmit statistics: Disabled [edit] root# show interfaces //查看接口配置,注意提示符#,这里使用run,命令会同等于上一个。 ge-0/0/0 { unit 0 { family inet { address 1.1.1.1/24; } } } ge-0/0/1 { unit 0 { family inet { address 1.1.1.1/24; } } } root# delete system/security/protocols/interface //删除某个子目录下的所有配置 root# show | compare //在提交之前使用该命令,表示本次提交与上次提交的命令作对比,显示新增的命令 root# rollback ? //配置回滚命令,即回滚到之前提交的配置,默认保存前50次配置 Possible completions: <[Enter]> Execute this command 0 2013-09-05 11:56:54 UTC by root via cli 1 2013-09-05 11:11:05 UTC by root via cli 2 2013-09-05 11:10:28 UTC by root via cli root# commit at "2014-09-09 23:00" //指定提交时间 root# commit comment "zhe shi yi ge zhu shi" //给本次提交做个标记,便于回滚 [edit] root# commit confirmed //延迟提交,10分钟之后,需要再次输入commit,然后才能保存配置,便于管理员被设备踢出 commit confirmed will be automatically rolled back in 10 minutes unless confirmed commit complete # commit confirmed will be rolled back in 10 minutes 基本系统配置: [edit] root# set system host-name test //配置主机名称 [edit] root# edit system //我们也可以进入system目录,在这里配置主机名称 [edit system] root# set host-name SRX-test //以后该文章再出现切换目录配置时,将不再做详细说明,请读者注意目录位置 [edit system] root# up root# commit root@SRX-test# [edit] root@SRX# set system name-server 202.102.224.68 //配置DNS root@SRX> show system uptime //查看时间 Current time: 2014-03-11 17:50:33 UTC System booted: 2014-03-11 16:34:08 UTC (01:16:25 ago) Protocols started: 2014-03-11 16:34:26 UTC (01:16:07 ago) Last configured: 2014-03-11 17:49:43 UTC (00:00:50 ago) by root 5:50PM up 1:16, 1 user, load averages: 0.00, 0.00, 0.00 [edit] root@SRX# set system time-zone Asia/Chongqing //设置时区 root@SRX> set date 201403112000.00 //设定时间 Tue Mar 11 20:00:00 CST 2014 [edit] root@SRX# set system ntp server 202.102.224.1 //设置NTP server root@SRX> show ntp associations //查看NTP是否同步 root@SRX> show ntp status 设备重启 root@SRX> request system reboot root@SRX> request system power-off //带电情况下关机,关机之后按电源键开机(cisco设备做不到这一点) root@SRX> start shell //切换到底层unix,一般用于拷贝文件 root@SRX% reboot 恢复出厂化设置: [edit] root@SRX# load factory-default //恢复出厂之后是不能commit的,这是因为没有root的密码 [edit] root@SRX# set system root-authentication plain-text-password //一定要给root设置密码 New password: Retype new password: 设置管理账户: [edit] root@SRX# edit system login user three_zhang3 //创建用户名three_zhang3 [edit system login user three_zhang3] root@SRX# set class super-user authentication plain-text-password //设置three_zhang3的用户类型为super-user New password: Retype new password: [edit system login user three_zhang3] root@SRX# 通过该图我们可以看到,普通用户跟root登陆系统是不一样的,普通用户无法进入底层unix 建议用户使用普通用户登陆设备,不建议使用root(类Unix都有这个提示) 用户类型: operator: read-only: super-user: unauthorized: SRX网管配置: [edit] three_zhang3@SRX# edit system services [edit system services] three_zhang3@SRX# set ssh //开启SSH [edit system services] three_zhang3@SRX# set ssh root-login deny //拒绝root远程登录,建议这样做 [edit system services] three_zhang3@SRX# set telnet [edit system services] three_zhang3@SRX# set web-management http interface vlan.0 [edit system services] three_zhang3@SRX# set web-management https interface vlan.0 [edit system services] three_zhang3@SRX# set web-management https system-generated-certificate //设置自签名证书 three_zhang3@SRX> show version Hostname: SRX Model: junosv-firefly JUNOS Software Release [12.1X44-D10.4] //junos版本 three_zhang3@SRX> show system license //查看系统licnese three_zhang3@SRX> request system license add terminal //回车之后,粘贴所获取的文本授权,即可打上相应授权 three_zhang3@SRX> show system processes extensive //查看系统当前进程,你可以针对进程ID可以重启或者kill three_zhang3@SRX> restart chassis-control gracefully //重启某个进程 链接:https://pan.baidu.com/s/1g21uxvhbnuMpX42pUVT54Q
购买主题
已有 36 人购买
本主题需向作者支付 30 金币 才能浏览
|
相关帖子
|
| |
| |
| |
| |
| |
| |
| |