实验一:路由器基本配置(1)–IP设置,用户名修改,远程登录。
工具:IOU一体化模拟器,secure CRT终端
一:IP设置
开启虚拟机–>打开IOU一体化模拟器–>输入用户名密码–>
之后步骤如下:
root@IOL:~# ls //显示
CiscoIOU MPLS_Option QYT_CCNA2.0 RS_MPLS_Test1 TEST
Mcast_Troubleshooting Multicasting QYT-CCNP-Test RS_Test2_BGP V5-CCNP
MPLS_eigrp Q2 QYT-RS SP_TE V5-Switch
MPLS_intergate Q2_Update RS360 SP_Y1_TS1
root@IOL:~# cd QYT_CCNA2.0/ //cd命令打开QYT_CCNA2.0
root@IOL:~/QYT_CCNA2.0# ./start.sh //./start.sh启动程序
The telnet port is taken by other process //表示程序被其它进程占用
: Address already in use
^Croot@IOL:~/QYT_CCNA2.0# cd .. //cd ..命令退出
root@IOL:~# cd MPLS_intergate/
root@IOL:~/MPLS_intergate# ./stop.sh //进入MPLS_intergate并关闭
Warning: bad ps syntax, perhaps a bogus ‘-‘? See http://procps.sf.net/faq.html
root@IOL:~/MPLS_intergate# cd ..
root@IOL:~# cd QYT_CCNA2.0/
root@IOL:~/QYT_CCNA2.0# ./start.sh
Waiting on port 2001 …
Process Id for child is 1471, parent is 1469
Waiting on port 2002 …
Process Id for child is 1474, parent is 1472
Waiting on port 3001 …
Process Id for child is 1477, parent is 1475
Waiting on port 3002 …
Process Id for child is 1480, parent is 1478
Waiting on port 2005 …
Process Id for child is 1483, parent is 1481
Waiting on port 2006 …
Process Id for child is 1486, parent is 1484
UNIX ERR:tcgetattr:Invalid argument
Waiting on port 2007 …
Process Id for child is 1489, parent is 1487
UNIX ERR:tcgetattr:Invalid argument
./start.sh: line 15: start done! : command not found
root@IOL:~/QYT_CCNA2.0# UNIX ERR:tcgetattr:Invalid argument
UNIX ERR:tcgetattr:Invalid argument
↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
模拟器部分完成,接下来打开CRT终端
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
连接主机192.168.1.114,快速连接2001、2002路由器。
如图,注意使用telnet协议,2001端口,主机名为192.168.1.114 2002路由器配置类似
注:本例中2001路由器hostname为Branch,2002路由器hostname为HQ
HQ>enable //进入特权模式
HQ#conf t //进入配置模式来操控网络
Enter configuration commands, one per line. End with CNTL/Z.
HQ(config)#in
HQ(config)#interface e0/1 //配置这个接口
HQ(config-if)#no shu
HQ(config-if)#no shutdown //开启这个接口
HQ(config-if)#ip address 192.168.1.2 255.255.255.0 //配置ip地址
HQ(config-if)#
*Sep 12 03:45:53.735: %SYS-5-CONFIG_I: Configured from console by console
HQ#ping 192.168.1.1 //ping 命令 测试与2001是否联通
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!! //!说明通了
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
HQ#
二:改名
HQ(config)#hostname ZH //HQ改名为ZH
三:远程管理
在2002路由进行如下配置:
HQ(config)#line ? //显示线路信息
<0-6> First Line number //6个接口
aux Auxiliary line //物理接口
console Primary terminal line //物理接口
vty Virtual terminal //虚拟接口
HQ(config)#line 0 4 //配置虚拟线路
HQ(config-line)#password qyt //设置密码
HQ(config-line)#transport input all //允许任何协议接入该设备
^
% Invalid input detected at ‘^’ marker. //报错
HQ#show run | sec vty //查看正在运行的虚拟线路信息
line vty 0 2
password qyt
login
transport input none
line vty 3 4
login
transport input none //说明对线路密码的配置并没有保存
HQ(config)#line 0 ? //查看共几个线路
<1-6> Last Line number
<cr
HQ(config)#line 0
HQ(config-line)#password qyt
HQ(config-line)#transport input all
^
% Invalid input detected at ‘^’ marker. //对线路0进行配置失败
HQ(config-line)#exi
HQ(config)#line 1
HQ(config-line)#pas
HQ(config-line)#password qyt
HQ(config-line)#tra in all //对线路1配置成功
HQ(config-line)#exi
HQ(config)#line 2
HQ(config-line)#password qyt
HQ(config-line)#tra in all
HQ(config-line)#exi
HQ(config)#line 3
HQ(config-line)#password qyt
HQ(config-line)#tra in all
HQ(config-line)#exi
HQ(config)#line 4
HQ(config-line)#password qyt
HQ(config-line)#tra in all
HQ(config-line)#exi
HQ(config)#line 5
HQ(config-line)#password qyt
HQ(config-line)#tra in all
HQ(config-line)#exi
HQ(config)#line 6
HQ(config-line)#password qyt
HQ(config-line)#tra in all //依次对线路进行单独配置,成功
注:正常情况下应该一次完成
HQ(config-line)#exi
HQ(config)#do show run | sec
HQ(config)#do show run | section vty
line vty 0 4
password qyt
login
transport input all //确认 成功
HQ(config)#enable password cisco //设置特权模式密码为cisco
在Branch路由远程登录HQ:
Branch>
Branch>enable
Password: //密码为CISCO
Branch#telnet 192.168.1.2 //telnet测试
Trying 192.168.1.2 … Open //通
User Access Verification
Password: //输入线路接口密码:qyt
HQ>enable //成功进入HQ(2002)路由器,进入enable模式
Password: //输入enable密码:cisco
HQ#conf t //进入HQ的配置模式
Enter configuration commands, one per line. End with CNTL/Z.
HQ(config)#end //退出配置模式
注意:配置完成后 wr保存配置