實驗一:路由器基本配置(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保存配置