Juniper路由器常用命令表 | |||
Cisco command | Juniper command | Definition | |
配置模式 | root% cli (提示符由%变为>) | 第一次加电,由shell模式 转入用户命令行 | |
start shell | 进入shell模式 | ||
router>enable | root>configure root# | Entering configuration mode | |
router#config t | root#edit system {master}[edit system] root# | System parameters 进入system配置菜单 执行此命令后, set后可不加System | |
基本信息设置 | hostname | root#set system host-name X root# commit root@X# | 设置主机名 |
ip domain-name | #set domain-name zj.cn.net | 配置域名 | |
clock timezone | #set time-zone Asia/Shanghai | 配置时区 | |
#set date 200707170947.00 | 设置时间 | ||
设置用户和密码 | enable secret | #set root-authentication plain-text-password new password: Retype new password: | |
Username privilege password | #set login class high idle-timeout 30 permissions all | “high” 是class名; ”all” 用户将拥有该 router的全部权限 | |
# set login user | Uid: user id | ||
# set login user | |||
#set login user admin full-name network-admin uid 2001 class high plain-text-password | Username 为admin; user id 为2001; class为high | ||
设置telnet和ftp服务 | Line vty 0 4 | #set services telnet | 设置telnet服务 |
ip ftp | # set services ftp | 设置ftp服务 | |
#set system services telnet connection-limit 5 | telnet的最大连接数5 | ||
syslog 服务配置 | # set syslog user * any emergency | ||
#set system syslog host 202.96.103.73 any any | 所有syslog信息都写到远程主机 | ||
#set system syslog file messages any notice | 所有notice信息写在本地 | ||
#set system syslog file messages authorization info | authorization信息写在本地 | ||
Cisco command | Juniper command | Definition | |
NTP设置 | #set ntp server 202.96.103.37 | client的配置 | |
# set ntp boot-server 202.96.103.37 | ntp server 配置 此处只能写ip不能为主机名 | ||
SNMP配置 | #set snmp community keepalive authorization read-only | SNMP配置 | |
端口数据设置 | Interface | #edit interfaces | 配置端口 |
Ip address Description | # set so-1/0/0 unit 0 description "HZ to NB 2.5Gb SDH" family inet address 202.96.117.1/30 | ||
duplex | # set interfaces ge-0/0/1 link-mode full-duplex | ||
speed | # set interfaces ge-0/0/1 speed 100m | ||
路由设置 | Ip route | #edit routing-options | 静态路由配置 |
#set static route 61.130.49.0/24 next-hop 202.96.113.52 | 静态路由配置 | ||
其他命令 | wri | #commit | 配置生效 |
#commit confirmed | 配置生效测试,5分钟后系统自动会滚,恢复原来配置。 | ||
? | ? | 帮助提示 | |
#top | 返回顶级菜单,象unix 的“cd /” | ||
up | 返回上一层配置层次,有点象UNIX的 cd ..命令 | ||
exit /quit | exit /quit | 如果在最上层,则退回到用户模式,如果在配置层,则退回到上一次edit进入之前层次 | |
#rollback n | 命令来恢复commit以前的配置 n表法前n次commit的备份,最大49 | ||
# rollback ? | 可以显示每次commit的时间,确定恢复那份配置 | ||
>request support information | 收集设备支持的信息 | ||
loopback | #set route-id 202.96.101.12 | 设本机的loopback | |
terminal monitor | monitor start messages | ||
terminal no monitor | monitor stop | ||
Cisco command | Juniper command | Definition | |
查看设备信息命令 | show version | >show version | 查看版本 |
Show clock | >show system uptime | 显示当前时间,以及路由器运行时间,路由进程运行时间等信息 | |
show inventory | >show chassis hardware | 查看序列号 | |
show processes cpu | >show chassis routing-engine | 查看CPU | |
>show chassis alarms | 查看设备告警信息 | ||
sh environment all | >show chassis environment | 查看详细的硬件温度及状态信息 | |
# run show chassis fpc pic-status | 查看办卡信息 | ||
show controller intfc | show interfaces intfc extensive | displays information about a physical port device | |
show logging | show log messages | ||
查看端口信息 | show interfaces | >show interfaces | |
#run show interfaces ge-0/2/8 brief | |||
Show ip int bri | > show interfaces terse | displays the status of interfaces configured for IP | |
查看配置信息 | >show config | 在用户模式下显示配置 | |
show ip route | show route | 查看路由表 | |
show ip bgp summary | show bgp summary | ||
show ip bgp neighbors neigh received-routes | show route receive-protocol bgp neigh | ||
show ip ospf interface | show ospf neighbor | ||
Cisco command | Juniper command | Definition | |
show ip prefix-list name | show policy name | ||
# show | compare | 配置的差异更新 | ||
诊断工具 | ping 192.168.0.1 | ||
ping 192.168.1.254 rapid | Ping 5个 | ||
ping 202.99.1.27 count 100 size 6000 | |||
Traceroute 192.168.1.254 source |