日
22
5月
2011
JUNIPER路由器的基本配置命令
文章出处:www.net1980.com 整理
本文为大家介绍JUNIPER路由器的一些基本配置命令。包括用户名密码设置、telnet和ftp服务设置、SYSLOG设置、端口设置、路由设置等。
一、初始化配置
路由器在第一次加电,通过console进入系统,输入root用户,在密码提示的时候直接回车进入系统(root的初始化密码为空):
J6350 (ttyd0)
login: root
Password:
第一次进入路由器,是进入shell模式,提示符是%,输入cli进入CLI用户模式:
root%
root% cli
root>
输入config进入配置模式:
root> configure
Entering configuration mode
[edit]
root#
利用set命令进行配置,每次set之后使用commit命令进行提交。
二、设置root密码
root@J6350# set system root-authentication plain-text-password
New password:
Retype new password:
[edit]
root@J6350#
root@J6350# commit
commit complete
[edit]
root@J6350#
三、设置主机名
root@J6350# set system host-name J6350
[edit]
root@J6350# commit
commit complete
[edit]
root@J6350#
四、设置用户和密码
root@J6350# set system login user net1980 uid 2001
[edit]
root@J6350# set system login user net1980 class super-user
[edit]
root@J6350# set system login user net1980 authentication plain-text-password
New password:
Retype new password:
[edit]
root@J6350# commit
commit complete
五、设置telnet和ftp服务
root@J6350# set system services telnet
[edit]
root@J6350# set system services ftp
[edit]
root@J6350# commit
commit complete
六、设置syslog服务器
root@J6350# set system syslog host 192.168.1.100 any warning /*设置syslog服务器IP地址,并且将所有warning级别信息送给syslog服务器*/
root@J6350# set system syslog file message any notice /*lk设置notice级别信息记录到系统messages文件*/
root@J6350# set system syslog file message authorization info /*设置info级别信息记录到系统messages文件*/
root@J6350# set system syslog file interactive-commands interactive-commands any /*将操作历史命令记录到interactive-commands文件*/
root@J6350# commit
commit complete
七、端口数据设置
root@J6350# set interfaces ge-0/0/1 description "TO-LAN" /*设置端口端口描述
root@J6350# set interfaces ge-0/0/1 link-mode full-duplex /*设置端口为全双工模式,还可以设置成half-duplex */
root@J6350-01# set interfaces ge-0/0/1 speed 100m /*设置端口100M */
root@J6350-01#set interfaces ge-0/0/1 unit 0 family inet address 192.168.1.1/29 /*设置端口IP地址*/
八、路由设置
root@J6350# set routing-options static route 0/0 next-hop 10.10.1.1 /*设置缺省路由*/
root@J6350# commit
commit complete
root@J6350# show routing-options /*检查路由设置*/
static
{
route 0.0.0.0/0 next-hop 10.147.67.36;
}

