非法網(wǎng)站開發(fā)者刑事責(zé)任網(wǎng)絡(luò)平臺推廣方式
知識改變命運,技術(shù)就是要分享,有問題隨時聯(lián)系,免費答疑,歡迎聯(lián)系!
微思成立于2002年,是一個誠信敬業(yè)、積極向上、充滿活力、專注技術(shù)服務(wù)的企業(yè)。
微思獲得了八大廠商的培訓(xùn)授權(quán),成長為福建地區(qū)廣受認(rèn)可的IT認(rèn)證培訓(xùn)機構(gòu),同時也是知名的IT服務(wù)提供商及系統(tǒng)集成商,業(yè)務(wù)主要包含國際IT認(rèn)證培訓(xùn)及考試、IT維護服務(wù)、系統(tǒng)集成。微思從成立開始,就把技術(shù)服務(wù)作為開展業(yè)務(wù)的主要根基,視技術(shù)服務(wù)為企業(yè)發(fā)展的生存命脈。微思擁有一批由工程師和講師組成的出色技術(shù)團隊,擁有8名CCIE、8名HCIE、5名OCP、8名MCITP、6名RHCE、5名VMware VCP、6名EMC/IBM存儲/小型機工程師。到目前為止,微思已經(jīng)投資超過2000萬元建立備件庫和體驗中心,為本地客戶提供優(yōu)質(zhì)的IT維護服務(wù)和完整的系統(tǒng)集成解決方案。
微思自成立以來,培養(yǎng)了一萬多名IT專業(yè)人才!廈門85%大中型企業(yè)的IT技術(shù)人員都參加過微思的培訓(xùn),同時,微思積累了豐富的就業(yè)渠道,為學(xué)員的就業(yè)提供有力的保障。
憑借良好技術(shù)和服務(wù)能力,微思完成了眾多的IT建設(shè)項目,如建發(fā)集團、國貿(mào)集團、廈門航空、廈門銀行、廈門郵儲銀行、乾照光電、三安集團、嵩嶼碼頭、海潤碼頭、海通碼頭、聯(lián)想移動、安踏、七匹狼、九牧王、柒牌、特步、361度、廈門邊檢、廈門海關(guān)、廈門國檢、廈門國土局、廈門地震局、廈門國家會計學(xué)院、廈門大學(xué)、華僑大學(xué)等,這些客戶對微思的技術(shù)和服務(wù)給予了充分的肯定和良好的評價。
微思網(wǎng)絡(luò)肩負(fù)“智造財富”的企業(yè)使命,憑借出色的技術(shù)實力、齊全的實驗環(huán)境、高效的服務(wù)體系,為社會創(chuàng)造價值、為企業(yè)實現(xiàn)價值、為員工提升價值!
微思22年國際IT認(rèn)證培訓(xùn)經(jīng)驗
紅帽RHCE
OracleOCP
VMware VCP
信息安全CISP
項目管理PMP
華為 HCIA/HCIP/HCIE
思科CCNA/CCNP/CCIE
網(wǎng)絡(luò)實戰(zhàn)、云計算實戰(zhàn)企業(yè)IT技術(shù)定制培訓(xùn)
數(shù)據(jù)中心解決方案
網(wǎng)絡(luò)架構(gòu)解決方案
網(wǎng)絡(luò)安全解決方案
視頻會議解決方案
集成業(yè)務(wù)咨詢?nèi)轂?zāi)備份解決方案服務(wù)器代理:華為/H3C/聯(lián)想/DELL網(wǎng)絡(luò)產(chǎn)品代理:華為/H3C/思科/銳捷存儲產(chǎn)品代理:華為/H3C/聯(lián)想/DELL安全產(chǎn)品代理:深信服/奇安信/網(wǎng)御
合作廠商:
思科、華為、H3C、銳捷、聯(lián)想、DELL、VMware深信服、奇安信、網(wǎng)御星云、綠盟、啟明、IBM、EMC
微思軟實力
【集成資質(zhì)】
華為金牌代理商 | 思科金牌代理商 |
EMC金牌代理商 | NetApp金牌代理商 |
VMware企業(yè)級代理商 | 數(shù)存金牌代理商 |
深信服金牌代理商 | 綠盟金牌代理商 |
天融信金牌代理商 | 北塔金牌代理商 |
聯(lián)軟金牌代理商 | 盈高金牌代理商 |
Radware金牌代理商 | Panabit金牌代理商 |
【培訓(xùn)資質(zhì)】
思科授權(quán)培訓(xùn)中心 | Oralce授權(quán)培訓(xùn)中心 |
華為授權(quán)培訓(xùn)中心 | VMware授權(quán)培訓(xùn)中心 |
紅帽授權(quán)培訓(xùn)中心 | 微軟授權(quán)培訓(xùn)中心 |
普爾文授權(quán)考試中心 | VUE授權(quán)考試中心 |
【微思優(yōu)勢】
專業(yè)的技術(shù)專家團隊 | 22年國際IT認(rèn)證培訓(xùn)經(jīng)驗 |
設(shè)備齊全的備件庫 | 擁有資深專家講師團隊 |
豐富的系統(tǒng)集成經(jīng)驗 | 擁有專業(yè)的機房和網(wǎng)絡(luò)實驗室 |
完美的產(chǎn)品體驗中心 | 百家名企合作豐富的就業(yè)渠道 |
微思硬實力
【八大廠商授權(quán)】
【三大上課教師,可同時容納100+人】
實驗平臺使用方法
步驟:
- 安裝VMware Workstation
- 安裝EVE-NG客戶端
- 關(guān)聯(lián)SecureCRT
- 解壓“微思網(wǎng)絡(luò)CCNA實驗平臺”虛擬機
步驟1:安裝VMware Workstation
雙擊VMware-workstation-full-15.5.1-15018445安裝程序。
點擊“下一步”。
勾選“我接受許可協(xié)議中的條款”,點擊“下一步”。
安裝位置使用默認(rèn)路徑即可,點擊“下一步”。
按默認(rèn),點擊“下一步”。
按默認(rèn),點擊“下一步”。
點擊“安裝”。
程序正在安裝,耐心等待。
點擊“許可證”輸入許可。
輸入VMware-workstation-full-15.5.1-15018445-KEY記事本中的序列號,點擊“輸入”。
點擊“完成”。
步驟2:安裝EVE-NG客戶端
雙擊EVE-NG-Win-Client-Pack-2.0安裝程序。
點擊“運行”。
點擊“下一步”。
點擊“下一步”。
按默認(rèn)即可,點擊“下一步”
選中“I accept the agreement”,點擊“Next”。
點擊“Next”。
按默認(rèn)即可,點擊“Next”。
按默認(rèn)即可,點擊“Next”。
點擊“Install”。
點擊“Next”。
點擊“Finish”。
安裝Wireshark,點擊“Next”
點擊“I Agree”
按默認(rèn)即可,點擊“Next”。
按默認(rèn)即可,點擊“Next”
安裝路徑按默認(rèn)即可,點擊“Next”。
按默認(rèn)即可,點擊“Next”。
按默認(rèn)即可,點擊“Install”
點擊“I Agree”
按默認(rèn)即可,點擊“Install”。
點擊“Next”
點擊“Finish”
點擊“Next”
點擊“Finish”
點擊“Finish”
步驟3:關(guān)聯(lián)SecureCRT
把“微思網(wǎng)絡(luò)CCNA實驗平臺登錄軟件SecureCRT”壓縮包解壓到當(dāng)前文件夾。
進入SecureCRT文件夾,找到“SecureCRT.exe”文件,鼠標(biāo)右鍵“SecureCRT.exe”,點擊發(fā)送到“桌面快捷方式”。
進入EVE-NG客戶端的安裝目錄,默認(rèn)在:C:\Program Files\EVE-NG,把注冊表文件win10_64bit_sCRT.reg拷貝到其他盤,比如D盤。
鼠標(biāo)右鍵D盤中的win10_64bit_sCRT.reg文件,單擊“編輯”。
把SecureCRT的存放路徑輸入到箭頭所指的地方(注意路徑是雙斜杠!!!),改完之后保存。
注意:SecureCRT的存放路徑視具體情況而定,截圖中的路徑只是個例子!!!
保存后,雙擊注冊表文件win10_64bit_sCRT.reg,選擇“是”即可。
步驟4:解壓“微思網(wǎng)絡(luò)CCNA實驗平臺”虛擬機
把“微思網(wǎng)絡(luò)CCNA實驗平臺”壓縮包解壓到當(dāng)前文件夾。
解壓之后,進入VM XMWS CCNA文件夾,找到“VMware虛擬機配置”文件,然后雙擊運行。
此時,VMware Workstation會打開虛擬機XMWS CCNA。單擊“開啟此虛擬機”,打開虛擬機的電源。
記錄箭頭所指的地方的IP地址。
在瀏覽器中輸入上一步記錄的IP地址,訪問實驗臺;
用戶名是:admin
密碼是:www.xmws.cn
輸入用戶名和密碼之后,點擊“Sign In”登錄實驗臺。
鼠標(biāo)點擊某個Lab之后,右邊會有個“Open”按鈕。
單擊“Open”打開實驗,鼠標(biāo)移動到瀏覽器左側(cè),單擊“More actions”,點擊“Start all nodes”開啟實驗設(shè)備。
設(shè)備啟動完成之后,圖標(biāo)顏色會變成藍(lán)色,如下圖所示。
鼠標(biāo)點擊設(shè)備圖標(biāo)會自動關(guān)聯(lián)SecureCRT,連續(xù)敲幾下回車即可進入設(shè)備控制界面。
實驗做完之后,鼠標(biāo)移動到瀏覽器左側(cè),單擊“More actions”,點擊“Stop all nodes”關(guān)閉實驗設(shè)備。
關(guān)閉實驗臺設(shè)備之后,鼠標(biāo)移動到瀏覽器左側(cè),單擊“Close lab”即可回到主頁。
實驗做完之后,鼠標(biāo)右鍵虛擬機XMWS CCNA,單擊“電源”,點擊“關(guān)閉客戶機”即可關(guān)閉虛擬機。
熟悉CISCO IOS的各個模式
Router> //用戶模式
Router# //特權(quán)模式
Router(config-if)# //接口模式
Router(config-router)# //路由配置模式
Router(config-line)# //線路模式
Router(config-subif)# //子接口模式
Router> //用戶模式
Router>enable //在用戶模式敲enable進入特權(quán)模式
Router#disable //在特權(quán)模式敲disable退出到用戶模式
Router>enable //在用戶模式敲enable進入特權(quán)模式
Router#configure terminal //在特權(quán)模式敲入configure terminal進入到配置模式
Router(config)#interface ethernet0/0 //在配置模式敲入“interface+接口類型+接口編號”進入接口模式
Router(config-if)#exit //敲exit退出接口模式
Router(config)#router rip //敲“router + 路由協(xié)議”進入路由配置模式
Router(config-router)#exit //退出路由配置模式
Router(config)#line console 0 //進入線路模式
Router(config-line)#end //從線路模式退出(任何時候敲入end會退出到特權(quán)模式)
Router#configure terminal
Router(config)#interface ethernet 0/0.1 //進入子接口模式
Router(config-subif)#end //任何時候敲入end會退出到特權(quán)模式
Router#
熟悉CISCO IOS的基本配置
CISCO IOS常用配置命令
Router>enable
Router#configure terminal
Router(config)#enable secret xmws?? //設(shè)置enable的密碼為xmws
Router(config)#enable password wisdom?? //設(shè)置enable的密碼為wisdom,不能和enable secret 設(shè)置的密碼相同,如果都設(shè)置,secret生效
Router(config)#no ip domain-lookup?? //關(guān)掉域名查找功能
Router(config)#service password-encryption?? //對明文口令進行加密,比如加密Console口、VTY或enable password設(shè)置的密碼,這樣密碼不再顯示為明文
Router(config)#line console 0?? //進入Cconsole口
Router(config-line)#password xmws? //設(shè)置Console口密碼為xmws
Router(config-line)#login? //啟用密碼
Router(config-line)#exec-timeout 0 0? //設(shè)置操作會話不超時
Router(config-line)#logging synchronous? //配置光標(biāo)跟隨, 阻止控制臺信息打斷你當(dāng)前的輸入,從而使輸入信息顯得更為簡單易讀
Router(config)#line vty 0 4? //進入VTY
Router(config-line)#password cisco
Router(config-line)#login
Router(config-line)#exec-timeout 0 0
Router(config-line)#logging synchronous
注:VTY (虛擬終端) 在網(wǎng)絡(luò)操作系統(tǒng)(包括Cisco IOS)中是一個接受telent或ssh連接的邏輯端口。
配置一臺路由器當(dāng)作PC使用
做實驗時可以將路由器當(dāng)作PC使用,用來測試網(wǎng)絡(luò)的連通性等。
步驟:(本例子中當(dāng)作PC的路由器接口為Ethernet 0/0)
- 關(guān)閉路由器的路由功能
- 設(shè)置接口IP地址
- 配置默認(rèn)網(wǎng)關(guān)
- 檢查
Router>enable
Router#configure terminal
Router(config)#hostname PC1
PC1(config)#no ip routing?? //關(guān)閉路由器的路由功能
PC1(config)#interface ethernet 0/0
PC1(config-if)#ip address 192.168.10.1 255.255.255.0?? //配置接口IP地址
PC1(config-if)#no shutdown?? //激活接口
PC1(config-if)#exit
PC1(config)#ip default-gateway 192.168.10.254?? //配置默認(rèn)網(wǎng)關(guān)
PC1(config)#end
PC1#show ip interface brief ??//查看接口IP地址和狀態(tài)
Interface??????? ??????????IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 10.1.1.1??????? YES manual up??????????????????? up?????
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2?????? ?????????unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
PC1#show ip route?? //show ip route可以看到網(wǎng)關(guān)
Default gateway is 192.168.10.254
Host?????????????? Gateway?????????? Last Use??? Total Uses? Interface
ICMP redirect cache is empty
實驗01:IOS基本配置
實驗?zāi)康?/strong>
- 熟悉CISCO IOS的常用模式
- 掌握CISCO IOS模式之間的切換
- 掌握CISCO IOS的基本配置命令
- 掌握如何把一臺路由器配置成PC
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
包括:主機名、Enable密碼、關(guān)閉域名查找功能等;
- PC和Server使用路由器模擬,把路由器PC1、PC2、PC3、Server A、Server B配置成PC;
- 測試主機與網(wǎng)關(guān),以及設(shè)備之間的網(wǎng)絡(luò)連通性。
實驗步驟
步驟1:路由器和交換機的基本配置
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#enable password xmws
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#password xmws
R1(config-line)#login
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#line vty 0 4
R1(config-line)#password xmws
R1(config-line)#login
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface serial1/0
R1(config-if)#ip address 10.1.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface serial1/1
R1(config-if)#ip address 13.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.10.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface ethernet0/1
R1(config-if)#ip address 192.168.20.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#enable password xmws
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#password xmws
R2(config-line)#login
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#line vty 0 4
R2(config-line)#password xmws
R2(config-line)#login
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface serial1/0
R2(config-if)#ip address 10.1.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface serial1/1
R2(config-if)#ip address 23.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface ethernet0/0
R2(config-if)#ip address 172.16.1.254 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
配置R3:
Router>enable
Router#configure terminal
Router(config)#hostname R3conc
R3(config)#enable password xmws
R3(config)#no ip domain-lookup
R3(config)#line console 0
R3(config-line)#password xmws
R3(config-line)#login
R3(config-line)#exec-timeout 0 0
R3(config-line)#logging synchronous
R3(config-line)#exit
R3(config)#line vty 0 4
R3(config-line)#password xmws
R3(config-line)#login
R3(config-line)#exec-timeout 0 0
R3(config-line)#logging synchronous
R3(config-line)#exit
R3(config)#interface serial1/0
R3(config-if)#ip address 13.1.1.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface serial1/1
R3(config-if)#ip address 23.1.1.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface loopback0
R3(config-if)#ip address 9.2.6.7 255.255.255.255
R3(config-if)#end
R3#
配置SW1:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW1
SW1(config)#enable password xmws
SW1(config)#no ip domain-lookup
SW1(config)#line console 0
SW1(config-line)#password xmws
SW1(config-line)#login
SW1(config-line)#exec-timeout 0 0
SW1(config-line)#logging synchronous
SW1(config-line)#exit
SW1(config)#line vty 0 4
SW1(config-line)#password xmws
SW1(config-line)#login
SW1(config-line)#exec-timeout 0 0
SW1(config-line)#logging synchronous
SW1(config-line)#exit
SW1(config)#interface vlan 1
SW1(config-if)#ip address 192.168.10.11 255.255.255.0
SW1(config-if)#no shutdown
SW1(config-if)#exit
SW1(config)#ip default-gateway 192.168.10.254
SW1(config)#end
SW1#
配置SW2:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW2
SW2(config)#enable password xmws
SW2(config)#no ip domain-lookup
SW2(config)#line console 0
SW2(config-line)#password xmws
SW2(config-line)#login
SW2(config-line)#exec-timeout 0 0
SW2(config-line)#logging synchronous
SW2(config-line)#exit
SW2(config)#line vty 0 4
SW2(config-line)#password xmws
SW2(config-line)#login
SW2(config-line)#exec-timeout 0 0
SW2(config-line)#logging synchronous
SW2(config-line)#exit
SW2(config)#interface vlan 1
SW2(config-if)#ip address 192.168.10.12 255.255.255.0
SW2(config-if)#no shutdown
SW2(config-if)#exit
SW2(config)#ip default-gateway 192.168.10.254
SW2(config)#end
SW2#
配置SW3:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW3
SW3(config)#enable password xmws
SW3(config)#no ip domain-lookup
SW3(config)#line console 0
SW3(config-line)#password xmws
SW3(config-line)#login
SW3(config-line)#exec-timeout 0 0
SW3(config-line)#logging synchronous
SW3(config-line)#exit
SW3(config)#line vty 0 4
SW3(config-line)#password xmws
SW3(config-line)#login
SW3(config-line)#exec-timeout 0 0
SW3(config-line)#logging synchronous
SW3(config-line)#exit
SW3(config)#interface vlan 1
SW3(config-if)#ip address 192.168.10.13 255.255.255.0
SW3(config-if)#no shutdown
SW3(config-if)#exit
SW3(config)#ip default-gateway 192.168.10.254
SW3(config)#end
SW3#
步驟2:PC的基本配置
配置PC1:
Router>enable
Router#configure terminal
Router(config)#hostname PC1
PC1(config)#no ip routing
PC1(config)#ip default-gateway 192.168.10.254
PC1(config)#interface ethernet0/0
PC1(config-if)#ip address 192.168.10.1 255.255.255.0
PC1(config-if)#no shutdown
PC1(config-if)#end
PC1#
配置PC2:
Router>enable
Router#configure terminal
Router(config)#hostname PC2
PC2(config)#no ip routing
PC2(config)#ip default-gateway 192.168.10.254
PC2(config)#interface ethernet0/0
PC2(config-if)#ip address 192.168.10.2 255.255.255.0
PC2(config-if)#no shutdown
PC2(config-if)#end
PC2#
配置PC3:
Router>enable
Router#configure terminal
Router(config)#hostname PC3
PC3(config)#no ip routing
PC3(config)#ip default-gateway 172.16.1.254
PC3(config)#interface ethernet0/0
PC3(config-if)#ip address 172.16.1.1 255.255.255.0
PC3(config-if)#no shutdown
PC3(config-if)#end
PC3#
配置ServerA:
Router>enable
Router#configure terminal
Router(config)#hostname ServerA
ServerA(config)#no ip routing
ServerA(config)#ip default-gateway 192.168.10.254
ServerA(config)#interface ethernet0/0
ServerA(config-if)#ip address 192.168.10.3 255.255.255.0
ServerA(config-if)#no shutdown
ServerA(config-if)#end
ServerA#
配置PCB:
Router>enable
Router#configure terminal
Router(config)#hostname ServerB
ServerB(config)#no ip routing
ServerB(config)#ip default-gateway 192.168.10.254
ServerB(config)#interface ethernet0/0
ServerB(config-if)#ip address 192.168.10.4 255.255.255.0
ServerB(config-if)#no shutdown
ServerB(config-if)#end
ServerB#
實驗檢查
步驟1:檢查路由器
檢查R1:
R1#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.10.254? YES manual up??????????????????? up?????
Ethernet0/1??????????????? 192.168.20.254? YES manual up?????????? ?????????up?????
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 10.1.12.1?????? YES manual up??????????? ????????up?????
Serial1/1????????????????? 13.1.1.1??????? YES manual up??????????????????? up?????
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down??
R1使用到的接口已經(jīng)配置好IP地址,并且是up up狀態(tài)。
檢查R2:
R2#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 172.16.1.254??? YES manual up??????????????????? up?????
Ethernet0/1??????????? ????unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0?????????????? ???10.1.12.2?????? YES manual up??????????????????? up?????
Serial1/1????????????????? 23.1.1.2??????? YES manual up??????????????????? up?????
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3??????????????? ??unassigned????? YES unset? administratively down down??
R2使用到的接口已經(jīng)配置好IP地址,并且是up up狀態(tài)。
檢查R3:
R3#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 13.1.1.3??????? YES manual up??????????????????? up?????
Serial1/1????????????????? 23.1.1.3??????? YES manual up??????????????????? up?????
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down???
Loopback0????????????????? 9.2.6.7???????? YES manual up??????????????????? up
R3使用到的接口已經(jīng)配置好IP地址,并且是up up狀態(tài)。
步驟2:檢查交換機
檢查SW1:
SW1#show ip interface brief
Interface????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/1??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/2??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/3??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet1/0??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet1/1??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet1/2??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet1/3??????????? unassigned????? YES unset? up??????????????????? up?????
Vlan1???????????? ????192.168.10.11?? YES manual up??????????????????? up?????
SW1的Vlan1接口已經(jīng)配置好IP地址,并且是up up狀態(tài)。
檢查SW2:
Interface????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/1??????????? unassigned????? YES unset? up??? ????????????????up?????
Ethernet0/2??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/3??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet1/0??????????? unassigned????? YES unset? up???????????????? ???up?????
Ethernet1/1??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet1/2??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet1/3??????????? unassigned????? YES unset? up??????????????????? up?????
Vlan1???????????????? 192.168.10.12?? YES manual up??????????????????? up?????
SW2的Vlan1接口已經(jīng)配置好IP地址,并且是up up狀態(tài)。
檢查SW3:
SW3#show ip interface brief
Interface????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/1??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/2??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/3??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet1/0??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet1/1??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet1/2??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet1/3??????????? unassigned????? YES unset? up??????????????????? up?????
Vlan1???????????????? 192.168.10.13?? YES manual up??????????????????? up?????
SW3的Vlan1接口已經(jīng)配置好IP地址,并且是up up狀態(tài)。
步驟3:檢查PC
檢查PC1:
PC1#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.10.1??? YES manual up??????????????????? up?????
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
PC1已經(jīng)配置好IP地址,并且是up up狀態(tài)。
PC1#show ip route
Default gateway is 192.168.10.254
Host?????????????? Gateway?????????? Last Use??? Total Uses? Interface
ICMP redirect cache is empty
PC1的網(wǎng)關(guān)是192.168.10.254。
檢查PC2:
PC2#show ip interface brief
Interface??????????? ??????IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.10.2??? YES manual up??????????????????? up?????
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2?????????? ?????unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
PC2已經(jīng)配置好IP地址,并且是up up狀態(tài)。
PC2#show ip route
Default gateway is 192.168.10.254
Host?????????????? Gateway?????????? Last Use??? Total Uses? Interface
ICMP redirect cache is empty
PC2的網(wǎng)關(guān)是192.168.10.254。
檢查PC3:
PC3#show ip interface brief
Interface??????????? ??????IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 172.16.1.1????? YES manual up??????????????????? up?????
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2?????????? ?????unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
PC3已經(jīng)配置好IP地址,并且是up up狀態(tài)。
PC3#show ip route
Default gateway is 172.16.1.254
Host?????????????? Gateway?????????? Last Use??? Total Uses? Interface
ICMP redirect cache is empty
PC3的網(wǎng)關(guān)是172.16.1.254。
檢查ServerA:
ServerA#show ip interface brief
Interface??????? ??????????IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.10.3??? YES manual up??????????????????? up?????
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2?????? ?????????unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
ServerA已經(jīng)配置好IP地址,并且是up up狀態(tài)。
ServerA#show ip route
Default gateway is 192.168.10.254
Host?????????????? Gateway?????????? Last Use??? Total Uses? Interface
ICMP redirect cache is empty
ServerA的網(wǎng)關(guān)是192.168.10.254。
檢查ServerB:
ServerB#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.10.4??? YES manual up??????????????????? up?????
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
ServerB已經(jīng)配置好IP地址,并且是up up狀態(tài)。
ServerB#show ip route
Default gateway is 192.168.10.254
Host?????????????? Gateway?????????? Last Use??? Total Uses? Interface
ICMP redirect cache is empty
ServerB的網(wǎng)關(guān)是192.168.10.254。
連通性測試
步驟1:測試PC和網(wǎng)關(guān)的連通性
測試PC1:
PC1#ping 192.168.10.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/203/1012 ms
PC1跟網(wǎng)關(guān)的連通性正常。
測試PC2:
PC2#ping 192.168.10.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/203/1011 ms
PC2跟網(wǎng)關(guān)的連通性正常。
測試PC3:
PC3#ping 172.16.1.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/201/1002 ms
PC3跟網(wǎng)關(guān)的連通性正常。
測試ServerA:
ServerA#ping 192.168.10.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/202/1009 ms
ServerA跟網(wǎng)關(guān)的連通性正常。
測試ServerB:
ServerB#ping 192.168.10.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/202/1006 ms
ServerB跟網(wǎng)關(guān)的連通性正常。
步驟2:測試交換機和網(wǎng)關(guān)的連通性
測試SW1:
SW1#ping 192.168.10.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
SW1跟網(wǎng)關(guān)的連通性正常。
測試SW2:
SW2#ping 192.168.10.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
SW2跟網(wǎng)關(guān)的連通性正常。
測試SW3:
SW3#ping 192.168.10.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
SW3跟網(wǎng)關(guān)的連通性正常。
步驟3:測試路由器之間鏈路的連通性
測試R1和R2之間鏈路:
R1#ping 10.1.12.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 5/9/10 ms
R1和R2之間的連通性正常。
測試R1和R3之間的鏈路:
R1#ping 13.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 13.1.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/10/11 ms
R1和R3之間的連通性正常。
測試R2和R3之間的鏈路:
R2#ping 23.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 23.1.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/9/11 ms
R2和R3之間的連通性正常。
實驗02:配置Telnet與SSH
實驗?zāi)康?/strong>
- 理解Telnet與SSH的運行原理
- 掌握Telnet與SSH的配置方法
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- SW1允許R1通過Telnet遠(yuǎn)程管理,VTY密碼為xmws;
- R2允許R1通過SSH version2遠(yuǎn)程管理,用戶名為xmws,密碼為wisdom,域名為xmws.cn。
實驗步驟
步驟1:設(shè)備的基本配置
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#enable password xmws
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface ethernet0/1
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#enable password xmws
R2(config)#interface ethernet0/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
配置SW1:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW1
SW1(config)#no ip domain-lookup
SW1(config)#line console 0
SW1(config-line)#exec-timeout 0 0
SW1(config-line)#logging synchronous
SW1(config-line)#exit
SW1(config)#enable password xmws?? //必須設(shè)置,否則Telnet上SW1后無法進入特權(quán)模式
SW1(config)#interface vlan 1
SW1(config-if)#ip address 192.168.1.1 255.255.255.0
SW1(config-if)#no shutdown
SW1(config-if)#exit
SW1(config)#ip default-gateway 192.168.1.254
SW1(config)#end
SW1#
步驟2:配置Telnet
配置SW1:
SW1>enable
SW1#configure terminal
SW1(config)#line vty 0 4?? //進入VTY
SW1(config-line)#password xmws?? //設(shè)置Telnet登錄的密碼為xmws
SW1(config-line)#login?? //啟用密碼
SW1(config-line)#transport input telnet?? //允許通過Telnet遠(yuǎn)程登錄
SW1(config-line)#end
SW1#
步驟3:配置SSH
配置R2:
R2>enable
R2#configure terminal
R2(config)#username xmws password wisdom?? //創(chuàng)建用戶名和密碼
R2(config)#ip ssh version 2?? //啟用SSH版本2
R2(config)#ip domain-name xmws.cn?? //定義域名
R2(config)#crypto key generate rsa?? //生成密鑰
The name for the keys will be: R2.xmws.cn
Choose the size of the key modulus in the range of 360 to 4096 for your
? General Purpose Keys. Choosing a key modulus greater than 512 may take
? a few minutes.
How many bits in the modulus [512]: 1024?? //SSHv2密鑰長度至少768位
% Generating 1024 bit RSA keys, keys will be non-exportable...
[OK] (elapsed time was 0 seconds)
R2(config)#
R2(config)#line vty 0 4
R2(config-line)#login local ??//使用用戶名和密碼驗證
R2(config-line)# transport input ssh ??//允許通過SSH遠(yuǎn)程登錄
R2(config-line)#end
R2#
實驗檢查
步驟1:Telnet測試
R1#telnet 192.168.1.1
Trying 192.168.1.1 ... Open
User Access Verification
Password:
SW1>?? //成功登錄SW1
注意,如果SW1沒有設(shè)置Enable密碼,R1登錄到SW1后輸Enable會出現(xiàn)如下提示:
R1#telnet 192.168.1.1
Trying 192.168.1.1 ... Open
User Access Verification
Password:
SW1>enable
% No password set
同時按<Ctrl+Shit+6>組合鍵,然后再按x把界面切回R1
R1#show sessions?? //查看R1打開的Telnet會話
Conn Host??????????????? Address???????????? Byte? Idle Conn Name
*? 1 192.168.1.1???????? 192.168.1.1??????????? 6???? 5 192.168.1.1
R1#resume 1?? //重新連接到SW1
[Resuming connection 1 to 192.168.1.1 ... ]
SW1>
步驟2:檢查Telnet
SW1#show users?? //SW1上查看誰登錄到自己
??? Line?????? User?????? Host(s)????????????? Idle?????? Location
*? 0 con 0??????????????? idle???????????????? 00:00:00??
?? 2 vty 0??????????????? idle???????????????? 00:02:47 192.168.1.254
? Interface???? User?????????????? Mode??????? Idle???? Peer Address
Location表示是誰登錄到自己,192.168.1.254是R1。
SW1#clear line 2?? //清除R1的Telnet連接
[confirm]
?[OK]
SW1#show users
??? Line?????? User?????? Host(s)????????????? Idle?????? Location
*? 0 con 0??????????????? idle???????????????? 00:00:00??
? Interface??? User?????????????? Mode???????? Idle???? Peer Address
R1已經(jīng)被清除。
步驟3:SSH測試
R1#ssh -l xmws 192.168.12.2
Password:
R2>enable
Password:
R2#?? //成功登錄到R2
步驟4:檢查SSH
R2#show ssh
Connection Version?? Mode? Encryption? Hmac????????? State??????????? Username
0????????? 1.99???? IN??? aes128-ctr? hmac-sha2-256 Session started?????? xmws
0????????? 1.99???? OUT? aes128-ctr? hmac-sha2-256 Session started?????? xmws
實驗03:配置CDP協(xié)議
實驗?zāi)康?/strong>
- 了解思科發(fā)現(xiàn)協(xié)議CDP的運行原理
- 掌握思科發(fā)現(xiàn)協(xié)議CDP的配置方法
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 在R1上使用CDP查看SW1和R2的設(shè)備信息;
- 注意:CDP默認(rèn)已經(jīng)運行,不需要打開。
實驗步驟
步驟1:設(shè)備的基本配置
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface ethernet0/1
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface ethernet0/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
配置SW1:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW1
SW1(config)#no ip domain-lookup
SW1(config)#line console 0
SW1(config-line)#exec-timeout 0 0
SW1(config-line)#logging synchronous
SW1(config-line)#exit
SW1(config)#interface vlan 1
SW1(config-if)#ip address 192.168.1.1 255.255.255.0
SW1(config-if)#no shutdown
SW1(config-if)#exit
SW1(config)#ip default-gateway 192.168.1.254
SW1(config)#end
SW1#
實驗檢查
步驟1:檢查設(shè)備的接口狀態(tài)
檢查R1:
R1#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.1.254?? YES manual up??????????????????? up?????
Ethernet0/1??????????????? 192.168.12.1??? YES manual up??????????????????? up?????
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
R1使用到的接口已經(jīng)配置好IP地址,并且是up up狀態(tài)。
檢查R2:
R2#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.12.2??? YES manual up??????????????????? up?????
Ethernet0/1??????????????? unassigned????? YES TFTP? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
R2使用到的接口已經(jīng)配置好IP地址,并且是up up狀態(tài)。
檢查SW1:
SW1#show ip interface brief
Interface????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/1??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/2??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/3??????????? unassigned????? YES unset? up??????????????????? up?????
Vlan1??????????????? ?192.168.1.1???? YES manual up??????????????????? up?????
SW1使用到的接口已經(jīng)配置好IP地址,并且是up up狀態(tài)。
步驟2:使用CDP查看物理相連的設(shè)備信息
檢查R1上運行CDP的接口:
R1#show cdp interface
Ethernet0/0 is up, line protocol is up
? Encapsulation ARPA
? Sending CDP packets every 60 seconds?? //CDP報文每60秒發(fā)送一次
? Holdtime is 180 seconds?? //CDP保持時間是180秒
Ethernet0/1 is up, line protocol is up
? Encapsulation ARPA
? Sending CDP packets every 60 seconds
? Holdtime is 180 seconds
Ethernet0/2 is administratively down, line protocol is down
? Encapsulation ARPA
? Sending CDP packets every 60 seconds
? Holdtime is 180 seconds
Ethernet0/3 is administratively down, line protocol is down
? Encapsulation ARPA
? Sending CDP packets every 60 seconds
? Holdtime is 180 seconds
?cdp enabled interfaces : 4
?interfaces up????????? : 2
?interfaces down??????? : 2
R1的E0/0和E0/1接口已經(jīng)運行CDP。
檢查R1上的CDP鄰居:
R1#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
????????????????? S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
????????????????? D - Remote, C - CVTA, M - Two-port Mac Relay
Device ID??????? Local Intrfce???? Holdtme??? Capability? Platform? Port ID
SW1???????????? Eth 0/0?????????? 169???????????? R S I? Linux Uni Eth 0/0
R2?????????????? Eth 0/1?????????? 163???????????? R B?? Linux Uni Eth 0/0
Total cdp entries displayed : 2
R1上能夠看到SW1和R2兩個CDP鄰居。
檢查R1上的CDP條目:
R1#show cdp entry *
-------------------------
Device ID: SW1?? //R1的CDP鄰居SW1
Entry address(es):
? IP address: 192.168.1.1?? //SW1的IP地址
Platform: Linux Unix,? Capabilities: Router Switch IGMP
Interface: Ethernet0/0,? Port ID (outgoing port): Ethernet0/0? //R1的E0/0連接到了SW1的E0/0
Holdtime : 132 sec
Version :
Cisco IOS Software, Linux Software (I86BI_LINUXL2-ADVENTERPRISEK9-M), Version 15.2(CML_NIGHTLY_20190423)FLO_DSGS7, EARLY DEPLOYMENT DEVELOPMENT BUILD, synced to? V152_6_0_81_E
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2019 by Cisco Systems, Inc.
Compiled Tue 23-Apr-19 02:38 by mmen
advertisement version: 2
VTP Management Domain: ''
Native VLAN: 1
Duplex: full
Management address(es):
? IP address: 192.168.1.1
-------------------------
Device ID: R2?? //R1的CDP鄰居R2
Entry address(es):
? IP address: 192.168.12.2?? //R2的IP地址
Platform: Linux Unix,? Capabilities: Router Source-Route-Bridge
Interface: Ethernet0/1,? Port ID (outgoing port): Ethernet0/0?? //R1的E0/1連接到了R2的E0/0
Holdtime : 124 sec
Version :
Cisco IOS Software, Linux Software (I86BI_LINUX-ADVENTERPRISEK9-M), Version 15.7(3)M2, DEVELOPMENT TEST SOFTWARE
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2018 by Cisco Systems, Inc.
Compiled Wed 28-Mar-18 11:18 by prod_rel_team
advertisement version: 2
Management address(es):
? IP address: 192.168.12.2
R1有兩個CDP鄰居,分別是SW1和R2。
實驗04:配置LLDP協(xié)議
實驗?zāi)康?/strong>
- 了解鏈路層發(fā)現(xiàn)協(xié)議LLDP的運行原理
- 掌握鏈路層發(fā)現(xiàn)協(xié)議LLDP的配置方法
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 在R1上使用LLDP查看SW1和R2的設(shè)備信息;
- 注意:LLDP默認(rèn)關(guān)閉,需要手工打開。
實驗步驟
步驟1:設(shè)備的基本配置
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface ethernet0/1
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface ethernet0/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
配置SW1:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW1
SW1(config)#no ip domain-lookup
SW1(config)#line console 0
SW1(config-line)#exec-timeout 0 0
SW1(config-line)#logging synchronous
SW1(config-line)#exit
SW1(config)#interface vlan 1
SW1(config-if)#ip address 192.168.1.1 255.255.255.0
SW1(config-if)#no shutdown
SW1(config-if)#exit
SW1(config)#ip default-gateway 192.168.1.254
SW1(config)#end
SW1#
步驟2:配置LLDP
配置R1:
R1>enable
R1#configure terminal
R1(config)#lldp run?? //運行LLDP
配置R2:
R2>enable
R2#configure terminal
R2(config)#lldp run
配置SW1:
SW1>enable
SW1#configure terminal
SW1(config)#lldp run
實驗檢查
步驟1:檢查設(shè)備的接口狀態(tài)
檢查R1:
R1#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.1.254?? YES manual up??????????????????? up?????
Ethernet0/1??????????????? 192.168.12.1??? YES manual up??????????????????? up?????
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
R1使用到的接口已經(jīng)配置好IP地址,并且是up up狀態(tài)。
檢查R2:
R2#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.12.2??? YES manual up??????????????????? up?????
Ethernet0/1??????????? ????unassigned????? YES TFTP? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
R2使用到的接口已經(jīng)配置好IP地址,并且是up up狀態(tài)。
檢查SW1:
SW1#show ip interface brief
Interface????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/1??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/2??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/3??????????? unassigned????? YES unset? up??????????????????? up?????
Vlan1???????????????? 192.168.1.1???? YES manual up????????????? ??????up?????
SW1使用到的接口已經(jīng)配置好IP地址,并且是up up狀態(tài)。
步驟2:使用LLDP查看物理相連的設(shè)備信息
檢查R1上運行LLDP的接口:
R1#show lldp interface
Ethernet0/0:
??? Tx: enabled
??? Rx: enabled
??? Tx state: IDLE
??? Rx state: WAIT FOR FRAME
Ethernet0/1:
??? Tx: enabled
??? Rx: enabled
??? Tx state: IDLE
??? Rx state: WAIT FOR FRAME
Ethernet0/2:
??? Tx: enabled
??? Rx: enabled
??? Tx state: INIT
??? Rx state: WAIT PORT OPER
Ethernet0/3:
??? Tx: enabled
??? Rx: enabled
??? Tx state: INIT
?--More--
R1的E0/0和E0/1接口已經(jīng)運行LLDP。
檢查R1上的LLDP鄰居:
R1#show lldp neighbors
Capability codes:
??? (R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device
??? (W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other
Device ID?????????? Local Intf???? Hold-time? Capability????? Port ID
SW1???????????????? Et0/0????????? 120?? ?????R?????????????? Et0/0
R2???????????????? ??Et0/1????????? 120??????? R?????????????? Et0/0
Total entries displayed: 2
R1上能夠看到SW1和R2兩個LLDP鄰居。
檢查R1上的LLDP條目:
R1#show lldp entry *
Capability codes:
??? (R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device
??? (W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other
------------------------------------------------
Local Intf: Et0/0?? //R1本端的接口
Chassis id: aabb.cc00.3000
Port id: Et0/0?? //對端的接口
Port Description: Ethernet0/0
System Name: SW1?? //對端設(shè)備的主機名
System Description:
Cisco IOS Software, Linux Software (I86BI_LINUXL2-ADVENTERPRISEK9-M), Version 15.2(CML_NIGHTLY_20190423)FLO_DSGS7, EARLY DEPLOYMENT DEVELOPMENT BUILD, synced to? V152_6_0_81_E
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2019 by
Time remaining: 103 seconds
System Capabilities: B,R
Enabled Capabilities: R
Management Addresses:
??? IP: 192.168.1.1?? //SW1的IP地址
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised
------------------------------------------------
Local Intf: Et0/1
Chassis id: aabb.cc00.2000
Port id: Et0/0
Port Description: Ethernet0/0
System Name: R2
System Description:
Cisco IOS Software, Linux Software (I86BI_LINUX-ADVENTERPRISEK9-M), Version 15.7(3)M2, DEVELOPMENT TEST SOFTWARE
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2018 by Cisco Systems, Inc.
Compiled Wed 28-Mar-18 11:18 by prod_rel_te
Time remaining: 98 seconds
System Capabilities: B,R
Enabled Capabilities: R
Management Addresses:
??? IP: 192.168.12.2
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised
Total entries displayed: 2
R1有兩個CDP鄰居,分別是SW1和R2。
實驗05:管理交換機MAC地址表
實驗?zāi)康?/strong>
- 理解交換機的工作原理
- 掌握交換機MAC地址表的管理方法
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 測試主機之間以及主機和服務(wù)器之間的網(wǎng)絡(luò)連通性;
- 把服務(wù)器的MAC地址綁定到SW2的MAC地址表。
實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
VPCS> set pcname PC1?? //設(shè)置主機名
PC1> ip 10.1.1.1/24????? //設(shè)置IP地址
配置PC2:
VPCS> set pcname PC2
PC2> ip 10.1.1.2/24
配置PC3:
VPCS> set pcname PC3
PC3> ip 10.1.1.3/24
配置PC4:
VPCS> set pcname PC4
PC4> ip 10.1.1.4/24
配置Server:
VPCS> set pcname Server
Server> ip 10.1.1.5/24
配置SW1:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW1
SW1(config)#no ip domain-lookup
SW1(config)#line console 0
SW1(config-line)#exec-timeout 0 0
SW1(config-line)#logging synchronous
SW1(config-line)#end
SW1#
配置SW2:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW2
SW2(config)#no ip domain-lookup
SW2(config)#line console 0
SW2(config-line)#exec-timeout 0 0
SW2(config-line)#logging synchronous
SW2(config-line)#end
SW2#
步驟2:綁定服務(wù)器的MAC地址到SW2的MAC地址表
配置SW2:
SW2#configure terminal
SW2(config)# mac address-table static 0050.7966.6805 vlan 1 interface Ethernet0/3
實驗檢查
步驟1:網(wǎng)絡(luò)連通性測試
PC1> ping 10.1.1.2
84 bytes from 10.1.1.2 icmp_seq=1 ttl=64 time=0.502 ms
84 bytes from 10.1.1.2 icmp_seq=2 ttl=64 time=0.738 ms
84 bytes from 10.1.1.2 icmp_seq=3 ttl=64 time=0.584 ms
84 bytes from 10.1.1.2 icmp_seq=4 ttl=64 time=0.646 ms
84 bytes from 10.1.1.2 icmp_seq=5 ttl=64 time=0.730 ms
PC1與PC2的連通性正常。
PC1> ping 10.1.1.3
84 bytes from 10.1.1.3 icmp_seq=1 ttl=64 time=0.968 ms
84 bytes from 10.1.1.3 icmp_seq=2 ttl=64 time=0.816 ms
84 bytes from 10.1.1.3 icmp_seq=3 ttl=64 time=1.265 ms
84 bytes from 10.1.1.3 icmp_seq=4 ttl=64 time=1.122 ms
84 bytes from 10.1.1.3 icmp_seq=5 ttl=64 time=1.242 ms
PC1與PC3的連通性正常。
PC1> ping 10.1.1.4
84 bytes from 10.1.1.4 icmp_seq=1 ttl=64 time=0.900 ms
84 bytes from 10.1.1.4 icmp_seq=2 ttl=64 time=1.303 ms
84 bytes from 10.1.1.4 icmp_seq=3 ttl=64 time=0.880 ms
84 bytes from 10.1.1.4 icmp_seq=4 ttl=64 time=1.086 ms
84 bytes from 10.1.1.4 icmp_seq=5 ttl=64 time=1.259 ms
PC1與PC4的連通性正常。
PC1> ping 10.1.1.5
84 bytes from 10.1.1.5 icmp_seq=1 ttl=64 time=0.875 ms
84 bytes from 10.1.1.5 icmp_seq=2 ttl=64 time=1.248 ms
84 bytes from 10.1.1.5 icmp_seq=3 ttl=64 time=1.145 ms
84 bytes from 10.1.1.5 icmp_seq=4 ttl=64 time=0.942 ms
84 bytes from 10.1.1.5 icmp_seq=5 ttl=64 time=1.317 ms
PC1與Server的連通性正常。
步驟2:管理交換機的MAC地址表
查看SW1的MAC地址表:
SW1#show mac address-table
????????? Mac Address Table
-------------------------------------------
Vlan??? Mac Address?????? Type????????? Ports
----???? -----------????????? --------???????? -----
?? 1??? 0050.7966.6801??? DYNAMIC???? Et0/1
?? 1??? 0050.7966.6802??? DYNAMIC???? Et0/2
?? 1??? 0050.7966.6803??? DYNAMIC???? Et0/0
?? 1??? 0050.7966.6804??? DYNAMIC???? Et0/0
?? 1??? 0050.7966.6805??? DYNAMIC???? Et0/0
?? 1??? aabb.cc00.7000??? DYNAMIC???? Et0/0
Total Mac Addresses for this criterion: 6
SW1已經(jīng)學(xué)習(xí)到PC1、PC2、PC3、PC4以及Server的MAC地址,學(xué)習(xí)方式是Dynamic。
清除SW1動態(tài)學(xué)習(xí)到的MAC地址條目:
SW1#clear mac address-table dynamic
SW1#show mac address-table?????????
????????? Mac Address Table
-------------------------------------------
Vlan??? Mac Address?????? Type??????? Ports
----???? -----------????????? --------?????? -----
?? 1??? aabb.cc00.7000??? DYNAMIC?? Et0/0
Total Mac Addresses for this criterion: 1
Clear mac address-table dynamic命令能夠清除通過Dynamic方式學(xué)習(xí)到的MAC地址條目。
查看SW2的MAC地址表:
SW2#show mac address-table
????????? Mac Address Table
-------------------------------------------
Vlan??? Mac Address?????? Type?????? ???Ports
----???? -----------????????? --------???? ????-----
?? 1??? 0050.7966.6801??? DYNAMIC???? Et0/0
?? 1??? 0050.7966.6803??? DYNAMIC???? Et0/1
?? 1??? 0050.7966.6804??? DYNAMIC???? Et0/2
?? 1??? 0050.7966.6805??? STATIC ??????Et0/3
?? 1??? aabb.cc00.6000??? DYNAMIC???? Et0/0
Total Mac Addresses for this criterion: 5
Server的MAC地址是靜態(tài)綁定的,所以類型是STATIC。
清除SW2動態(tài)學(xué)習(xí)到的MAC地址條目:
SW2#clear mac address-table dynamic
SW2#show mac address-table?????????
????????? Mac Address Table
-------------------------------------------
Vlan??? Mac Address?????? Type??????? Ports
----???? -----------????????? --------?????? -----
?? 1??? 0050.7966.6805??? STATIC????? Et0/3
?? 1??? aabb.cc00.6000??? DYNAMIC??? Et0/0
Total Mac Addresses for this criterion: 2
Clear mac address-table dynamic命令無法清除靜態(tài)綁定的MAC地址條目。
實驗06:配置VLAN
實驗?zāi)康?/strong>
- 理解VLAN的運行原理
- 掌握VLAN的配置方法
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 分別在SW1和SW2上創(chuàng)建VLAN 10,名字為IT;
- 分別在SW1和SW2上把接口E0/0、E0/1和E0/2劃入VLAN10;
- 測試PC之間的網(wǎng)絡(luò)連通性。
實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
VPCS> set pcname PC1?? //設(shè)置主機名
PC1> ip 10.1.1.1/24????? //設(shè)置IP地址
配置PC2:
VPCS> set pcname PC2
PC2> ip 10.1.1.2/24
配置PC3:
VPCS> set pcname PC3
PC3> ip 10.1.1.3/24
配置PC4:
VPCS> set pcname PC4
PC4> ip 10.1.1.4/24
配置SW1:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW1
SW1(config)#no ip domain-lookup
SW1(config)#line console 0
SW1(config-line)#exec-timeout 0 0
SW1(config-line)#logging synchronous
SW1(config-line)#end
SW1#
配置SW2:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW2
SW2(config)#no ip domain-lookup
SW2(config)#line console 0
SW2(config-line)#exec-timeout 0 0
SW2(config-line)#logging synchronous
SW2(config-line)#end
SW2#
步驟2:VLAN的配置
配置SW1:
SW1(config)#vlan 10
SW1(config-vlan)#name IT
SW1(config-vlan)#exit
SW1(config)#interface Eth0/0
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 10
SW1(config-if)#exit
SW1(config)#interface Eth0/1????????
SW1(config-if)#switchport mode access??
SW1(config-if)#switchport access vlan 10
SW1(config-if)#exit????????????????????
SW1(config)#interface Eth0/2????????
SW1(config-if)#switchport mode access??
SW1(config-if)#switchport access vlan 10
SW1(config-if)#end
SW1#
配置SW2:
SW2(config)#vlan 10
SW2(config-vlan)#name IT
SW2(config-vlan)#exit
SW2(config)#interface range Eth0/0 - 2?? //同時將多個端口劃入VLAN 10
SW2(config-if-range)#switchport mode access???
SW2(config-if-range)#switchport access vlan 10
SW2(config-if-range)#end
SW2#
實驗檢查
步驟1:檢查SW1的VLAN信息
SW1#show vlan brief
VLAN Name???????????????????????????? Status??? Ports
---- -------------------------------- --------- -------------------------------
1??? default????????????????????????? active??? Et0/3
10?? IT????????????? ????????????????active??? Et0/0, Et0/1, Et0/2
1002 fddi-default???????????????????? act/unsup
1003 token-ring-default?????????????? act/unsup
1004 fddinet-default????????????????? act/unsup
1005 trnet-default??????????????????? act/unsup
VLAN10有三個接口,分別是Et0/0、Et0/1、Et0/2。
步驟2:檢查SW1的接口配置
SW1#sh run int Eth0/0
Building configuration...
Current configuration : 80 bytes
!
interface Ethernet0/0
?switchport access vlan 10
?switchport mode access
end
SW1#sh run int Eth0/1
Building configuration...
Current configuration : 80 bytes
!
interface Ethernet0/1
?switchport access vlan 10
?switchport mode access
end
SW1#sh run int Eth0/2
Building configuration...
Current configuration : 80 bytes
!
interface Ethernet0/2
?switchport access vlan 10
?switchport mode access
end
步驟3:測試網(wǎng)絡(luò)的連通性
PC1> ping 10.1.1.2
84 bytes from 10.1.1.2 icmp_seq=1 ttl=64 time=0.835 ms
84 bytes from 10.1.1.2 icmp_seq=2 ttl=64 time=0.765 ms
84 bytes from 10.1.1.2 icmp_seq=3 ttl=64 time=0.866 ms
84 bytes from 10.1.1.2 icmp_seq=4 ttl=64 time=0.824 ms
84 bytes from 10.1.1.2 icmp_seq=5 ttl=64 time=0.828 ms
PC1與PC2的連通性正常。
PC1> ping 10.1.1.3
84 bytes from 10.1.1.3 icmp_seq=1 ttl=64 time=1.105 ms
84 bytes from 10.1.1.3 icmp_seq=2 ttl=64 time=1.337 ms
84 bytes from 10.1.1.3 icmp_seq=3 ttl=64 time=1.235 ms
84 bytes from 10.1.1.3 icmp_seq=4 ttl=64 time=1.291 ms
84 bytes from 10.1.1.3 icmp_seq=5 ttl=64 time=1.059 ms
PC1與PC3的連通性正常。
PC1> ping 10.1.1.4
84 bytes from 10.1.1.4 icmp_seq=1 ttl=64 time=0.826 ms
84 bytes from 10.1.1.4 icmp_seq=2 ttl=64 time=0.957 ms
84 bytes from 10.1.1.4 icmp_seq=3 ttl=64 time=1.194 ms
84 bytes from 10.1.1.4 icmp_seq=4 ttl=64 time=1.214 ms
84 bytes from 10.1.1.4 icmp_seq=5 ttl=64 time=1.184 ms
PC1與PC4的連通性正常。
實驗07:配置Trunk
實驗?zāi)康?/strong>
- 理解Trunk的運行原理
- 掌握Trunk的配置方法
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 分別在SW1和SW2創(chuàng)建VLAN10和VLAN20,名字為IT和HR;
- 分別在SW1和SW2上把相應(yīng)的接口劃入VLAN10和VLAN20;
- 把SW1和SW2互連的鏈路配置成Trunk,采用Dot1q封裝;
- 測試PC之間的網(wǎng)絡(luò)連通性。
- 實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
VPCS> set pcname PC1?? //設(shè)置主機名
PC1> ip 10.1.1.1/24????? //設(shè)置IP地址
配置PC2:
VPCS> set pcname PC2
PC2> ip 10.1.2.1/24
配置PC3:
VPCS> set pcname PC3
PC3> ip 10.1.1.2/24
配置PC4:
VPCS> set pcname PC4
PC4> ip 10.1.2.2/24
配置SW1:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW1
SW1(config)#no ip domain-lookup
SW1(config)#line console 0
SW1(config-line)#exec-timeout 0 0
SW1(config-line)#logging synchronous
SW1(config-line)#end
SW1#
配置SW2:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW2
SW2(config)#no ip domain-lookup
SW2(config)#line console 0
SW2(config-line)#exec-timeout 0 0
SW2(config-line)#logging synchronous
SW2(config-line)#end
SW2#
步驟2:VLAN的配置
配置SW1:
SW1(config)#vlan 10
SW1(config-vlan)#name IT
SW1(config-vlan)#exit
SW1(config)#vlan 20
SW1(config-vlan)#name HR
SW1(config-vlan)#exit
SW1(config)#interface Eth0/1
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 10
SW1(config-if)#exit
SW1(config)#interface Eth0/2
SW1(config-if)#switchport mode access??
SW1(config-if)#switchport access vlan 20
SW1(config-if)#end
SW1#
配置SW2:
SW2(config)#vlan 10
SW2(config-vlan)#name IT
SW2(config-vlan)#exit
SW2(config)#vlan 20
SW2(config-vlan)#name HR
SW2(config-vlan)#exit
SW2(config)#interface Eth0/1
SW2(config-if)#switchport mode access
SW2(config-if)#switchport access vlan 10
SW2(config-if)#exit
SW2(config)#interface Eth0/2
SW2(config-if)#switchport mode access??
SW2(config-if)#switchport access vlan 20
SW2(config-if)#end
SW2#
步驟3:Trunk的配置
配置SW1:
SW1(config)#interface Eth0/0
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if)#end
SW1#
配置SW2:
SW2(config)#interface Eth0/0
SW2(config-if)#switchport trunk encapsulation dot1q
SW2(config-if)#switchport mode trunk
SW2(config-if)#end
SW2#
實驗檢查
步驟1:檢查VLAN
檢查SW1:
SW1#show vlan brief
VLAN Name???????????????????????????? Status??? Ports
---- -------------------------------- --------- -------------------------------
1??? default??????? ?????????????????????active???? Et0/3
10?? IT??????????????????????????????? ?active???? Et0/1
20?? HR????????????????????????????? ??active???? Et0/2
1002 fddi-default???????????????????? act/unsup
1003 token-ring-default?????????????? act/unsup
1004 fddinet-default????????????????? act/unsup
1005 trnet-default??????????????????? act/unsup
SW1已經(jīng)創(chuàng)建好VLAN10和VLAN20,并已將對應(yīng)接口劃入。
檢查SW2:
SW2#show vlan brief
VLAN Name???????????????????????????? Status??? Ports
---- -------------------------------- --------- -------------------------------
1??? default???????????????????????????? active??? Et0/3
10?? IT???????????????????????????????? active??? Et0/1
20?? HR??????????????????????????????? active??? Et0/2
1002 fddi-default???????????????????? act/unsup
1003 token-ring-default?????????????? act/unsup
1004 fddinet-default????????????????? act/unsup
1005 trnet-default??????????????????? act/unsup
SW2已經(jīng)創(chuàng)建好VLAN10和VLAN20,并已將對應(yīng)接口劃入。
步驟2:檢查Trunk
檢查SW1:
SW1#show interfaces Eth0/0 switchport
Name: Et0/0
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Appliance trust: none
E0/0接口當(dāng)前是Trunk,封裝的協(xié)議是dot1q。
SW1#show interfaces trunk
Port??????? Mode??????????? Encapsulation?? Status??????? Native vlan
Et0/0?????? on?????????????? 802.1q???????? trunking????? 1
Port??????? Vlans allowed on trunk
Et0/0?????? 1-4094
Port??????? Vlans allowed and active in management domain
Et0/0?????? 1,10,20
Port??????? Vlans in spanning tree forwarding state and not pruned
Et0/0?????? 1,10,20
E0/0封裝的Trunk協(xié)議是dot1q,當(dāng)前的狀態(tài)是trunking。
SW1#sh run int Eth0/0
Building configuration...
Current configuration : 90 bytes
!
interface Ethernet0/0
?switchport trunk encapsulation dot1q
?switchport mode trunk
end
E0/0接口的Trunk封裝協(xié)議是dot1q,模式是trunk。
檢查SW2:
SW2#show interfaces trunk
Port??????? Mode???????????? Encapsulation? Status??????? Native vlan
Et0/0?????? on????????????? ??802.1q ???????trunking????? 1
Port??????? Vlans allowed on trunk
Et0/0?????? 1-4094
Port??????? Vlans allowed and active in management domain
Et0/0?????? 1,10,20
Port??????? Vlans in spanning tree forwarding state and not pruned
Et0/0?????? 1,10,20
E0/0封裝的Trunk協(xié)議是dot1q,當(dāng)前的狀態(tài)是trunking。
步驟4:網(wǎng)絡(luò)連通性測試
測試PC1和PC3的連通性:
PC1> ping 10.1.1.2
84 bytes from 10.1.1.2 icmp_seq=1 ttl=64 time=1.603 ms
84 bytes from 10.1.1.2 icmp_seq=2 ttl=64 time=1.234 ms
84 bytes from 10.1.1.2 icmp_seq=3 ttl=64 time=1.027 ms
84 bytes from 10.1.1.2 icmp_seq=4 ttl=64 time=2.372 ms
84 bytes from 10.1.1.2 icmp_seq=5 ttl=64 time=1.200 ms
PC1和PC3的網(wǎng)絡(luò)連通性正常。
測試PC2和PC4的連通性:
PC2> ping 10.1.2.2
84 bytes from 10.1.2.2 icmp_seq=1 ttl=64 time=0.887 ms
84 bytes from 10.1.2.2 icmp_seq=2 ttl=64 time=0.932 ms
84 bytes from 10.1.2.2 icmp_seq=3 ttl=64 time=1.295 ms
84 bytes from 10.1.2.2 icmp_seq=4 ttl=64 time=0.926 ms
84 bytes from 10.1.2.2 icmp_seq=5 ttl=64 time=1.011 ms
PC2和PC4的網(wǎng)絡(luò)連通性正常。
實驗08:配置VTP
實驗?zāi)康?/strong>
- 了解VTP的運行原理
- 掌握VTP的配置方法
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 把交換機互連的鏈路配置成Trunk,采用Dot1q封裝;
- SW1是VTP服務(wù)器,SW2和SW3是VTP客戶端,VTP域名為xmws,VTP密碼為wisdom,開啟VTP裁剪;
- 在SW1上創(chuàng)建VLAN10和VLAN20,名字為IT和HR;
- 分別在SW1、SW2和SW3上把相應(yīng)的接口劃入VLAN10和VLAN20;
實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
VPCS> set pcname PC1?? //設(shè)置主機名
PC1> ip 10.1.1.1/24????? //設(shè)置IP地址
配置PC2:
VPCS> set pcname PC2
PC2> ip 10.1.2.1/24
配置PC3:
VPCS> set pcname PC3
PC3> ip 10.1.1.2/24
配置PC4:
VPCS> set pcname PC4
PC4> ip 10.1.2.2/24
配置PC5:
VPCS> set pcname PC5
PC5> ip 10.1.1.3/24
配置PC6:
VPCS> set pcname PC6
PC6> ip 10.1.2.3/24
配置SW1:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW1
SW1(config)#no ip domain-lookup
SW1(config)#line console 0
SW1(config-line)#exec-timeout 0 0
SW1(config-line)#logging synchronous
SW1(config-line)#end
SW1#
配置SW2:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW2
SW2(config)#no ip domain-lookup
SW2(config)#line console 0
SW2(config-line)#exec-timeout 0 0
SW2(config-line)#logging synchronous
SW2(config-line)#end
SW2#
配置SW3:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW3
SW3(config)#no ip domain-lookup
SW3(config)#line console 0
SW3(config-line)#exec-timeout 0 0
SW3(config-line)#logging synchronous
SW3(config-line)#end
SW3#
步驟2:配置Trunk
配置SW1:
SW1(config)#interface Eth0/0
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if)#end
SW1#
配置SW2:
SW2(config)#interface range Eth0/0 , Eth0/3
SW2(config-if-range)#switchport trunk encapsulation dot1q
SW2(config-if-range)#switchport mode trunk
SW2(config-if-range)#end
SW2#
配置SW3:
SW3(config)#interface Eth0/0
SW3(config-if)#switchport trunk encapsulation dot1q
SW3(config-if)#switchport mode trunk
SW3(config-if)#end
SW3#
步驟3:配置VTP
配置SW1:
SW1(config)#vtp mode server
SW1(config)#vtp domain xmws
SW1(config)#vtp password wisdom
SW1(config)#vtp pruning
配置SW2:
SW2(config)#vtp mode client
SW2(config)#vtp domain xmws
SW2(config)#vtp password wisdom
配置SW3:
SW3(config)#vtp mode client
SW3(config)#vtp domain xmws
SW3(config)#vtp password wisdom
步驟4:配置VLAN
配置SW1:
SW1(config)#vlan 10
SW1(config-vlan)#name IT
SW1(config-vlan)#exit
SW1(config)#vlan 20
SW1(config-vlan)#name HR
SW1(config-vlan)#exit
SW1(config)#interface Eth0/1
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 10
SW1(config-if)#exit
SW1(config)#interface Eth0/2
SW1(config-if)#switchport mode access??
SW1(config-if)#switchport access vlan 20
SW1(config-if)#end
SW1#
配置SW2:
SW2(config)#interface Eth0/1
SW2(config-if)#switchport mode access
SW2(config-if)#switchport access vlan 10
SW2(config-if)#exit
SW2(config)#interface Eth0/2
SW2(config-if)#switchport mode access??
SW2(config-if)#switchport access vlan 20
SW2(config-if)#end
SW2#
配置SW3:
SW3(config)#interface Eth0/1
SW3(config-if)#switchport mode access
SW3(config-if)#switchport access vlan 10
SW3(config-if)#exit
SW3(config)#interface Eth0/2
SW3(config-if)#switchport mode access??
SW3(config-if)#switchport access vlan 20
SW3(config-if)#end
SW3#
實驗檢查
步驟1:檢查VTP
檢查SW1:
SW1#show vtp status
VTP Version capable???????????? : 1 to 3
VTP version running???????????? : 1
VTP Domain Name???????????????? : xmws
VTP Pruning Mode??????????????? : Enabled
VTP Traps Generation???? ???????: Disabled
Device ID?????????????????????? : aabb.cc80.7000
Configuration last modified by 0.0.0.0 at 4-23-20 17:18:33
Local updater ID is 0.0.0.0 (no valid interface found)
Feature VLAN:
--------------
VTP Operating Mode??????????????? : Server
Maximum VLANs supported locally?? : 1005
Number of existing VLANs????????? : 7
Configuration Revision??????????? : 3
MD5 digest??????????????????????? : 0x85 0x2D 0x06 0xA3 0x42 0x1B 0x93 0xEE
??????????????????????????????????? 0x90 0x66 0x1F 0x3C 0xA9 0x52 0xD5 0x38
SW1是VTP服務(wù)器,域名是xmws,裁剪已經(jīng)啟用。
SW1#show vtp password
VTP Password: wisdom
VTP密碼是wisdom。
檢查SW2:
SW2#show vtp status
VTP Version capable???????????? : 1 to 3
VTP version running???????????? : 1
VTP Domain Name???????????????? : xmws
VTP Pruning Mode??????????????? : Enabled
VTP Traps Generation??????????? : Disabled
Device ID?????????????????????? : aabb.cc80.8000
Configuration last modified by 0.0.0.0 at 4-23-20 17:18:33
Feature VLAN:
--------------
VTP Operating Mode??????????????? : Client
Maximum VLANs supported locally?? : 1005
Number of existing VLANs????????? : 7
Configuration Revision??????????? : 3
MD5 digest??????????????????????? : 0x85 0x2D 0x06 0xA3 0x42 0x1B 0x93 0xEE
??????????????????????????????????? 0x90 0x66 0x1F 0x3C 0xA9 0x52 0xD5 0x38
SW2是VTP客戶端,域名是xmws,裁剪已經(jīng)啟用。
SW2#show vtp password
VTP Password: wisdom
VTP密碼是wisdom。
步驟2:檢查VLAN信息
檢查SW1:
SW1#show vlan brief
VLAN Name?????????????????????????? Status??? Ports
---- -------------------------------- --------- -------------------------------
1??? default?????????????????????????? active??? Et0/3
10?? IT?????????????????????????????? active??? Et0/1
20?? HR????????????????????????????? active??? Et0/2
1002 fddi-default???????????????????? act/unsup
1003 token-ring-default?????????? ????act/unsup
1004 fddinet-default????????????????? act/unsup
1005 trnet-default??????????????????? act/unsup
SW1作為VTP服務(wù)器,已經(jīng)創(chuàng)建好VLAN10和VLAN20。
檢查SW2:
SW2#show vlan brief
VLAN Name????????????????????????? Status??? Ports
---- -------------------------------- --------- -------------------------------
1??? default????????????????????????? active???
10?? IT?????????? ???????????????????active??? Et0/1
20?? HR???????????????????????????? active??? Et0/2
1002 fddi-default???????????????????? act/unsup
1003 token-ring-default?????????????? act/unsup
1004 fddinet-default????????????????? act/unsup
1005 trnet-default??? ????????????????act/unsup
SW2作為VTP客戶端,已經(jīng)同步VTP服務(wù)器的VLAN信息。
檢查SW3:
SW3#show vlan brief
VLAN Name????????????????????????? Status??? Ports
---- -------------------------------- --------- -------------------------------
1??? default????????????????????????? active??? Et0/3
10?? IT?????? ???????????????????????active??? Et0/1
20?? HR???????????????????????????? active??? Et0/2
1002 fddi-default???????????????????? act/unsup
1003 token-ring-default?????????????? act/unsup
1004 fddinet-default????????????????? act/unsup
1005 trnet-default??????????????????? act/unsup
SW3作為VTP客戶端,已經(jīng)同步VTP服務(wù)器的VLAN信息。
實驗09:配置生成樹
實驗?zāi)康?/strong>
- 理解生成樹的運行原理
- 掌握生成樹的配置方法
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 把交換機互連的鏈路配置成Trunk,采用Dot1q封裝;
- 分別在SW1、SW2和SW3上創(chuàng)建VLAN10和VLAN20,并將相應(yīng)的接口劃到對應(yīng)的VLAN;
- SW1要作為VLAN10的根,VLAN20的備份根,使PC1訪問Server1的路徑通過:PC1->SW3->SW1->Server1;
- SW2要作為VLAN20的根,VLAN10的備份根,使PC2訪問Server2的路徑通過:PC2->SW3->SW2->Server2;
實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
VPCS> set pcname PC1?? //設(shè)置主機名
PC1> ip 192.168.1.1/24????? //設(shè)置IP地址
配置PC2:
VPCS> set pcname PC2
PC2> ip 172.16.1.1/24
配置Server1:
VPCS> set pcname Server1
Server1> ip 192.168.1.88/24
配置Server2:
VPCS> set pcname Server2
Server2> ip 172.16.1.88/24
配置SW1:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW1
SW1(config)#no ip domain-lookup
SW1(config)#line console 0
SW1(config-line)#exec-timeout 0 0
SW1(config-line)#logging synchronous
SW1(config-line)#end
SW1#
配置SW2:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW2
SW2(config)#no ip domain-lookup
SW2(config)#line console 0
SW2(config-line)#exec-timeout 0 0
SW2(config-line)#logging synchronous
SW2(config-line)#end
SW2#
配置SW3:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW3
SW3(config)#no ip domain-lookup
SW3(config)#line console 0
SW3(config-line)#exec-timeout 0 0
SW3(config-line)#logging synchronous
SW3(config-line)#end
SW3#
步驟2:配置Trunk與VLAN
配置SW1:
SW1(config)#interface range Eth0/0 - 1
SW1(config-if-range)#switchport trunk encapsulation dot1q
SW1(config-if-range)#switchport mode trunk
SW1(config-if-range)#exit
SW1(config)#vlan 10
SW1(config-vlan)#name IT
SW1(config-vlan)#exit
SW1(config)#vlan 20
SW1(config-vlan)#name HR
SW1(config-vlan)#exit
SW1(config)#interface Eth0/2
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 10
SW1(config-if)#exit
SW1(config)#end
SW1#
配置SW2:
SW2(config)#interface range Eth0/1 , Eth0/3
SW2(config-if-range)#switchport trunk encapsulation dot1q
SW2(config-if-range)#switchport mode trunk
SW2(config-if-range)#exit
SW2(config)#vlan 10
SW2(config-vlan)#name IT
SW2(config-vlan)#exit
SW2(config)#vlan 20
SW2(config-vlan)#name HR
SW2(config-vlan)#exit
SW2(config)#interface Eth0/2
SW2(config-if)#switchport mode access
SW2(config-if)#switchport access vlan 20
SW2(config-if)#exit
SW2(config)#end
SW2#
配置SW3:
SW3(config)#interface range Eth0/0 , Eth0/3
SW3(config-if-range)#switchport trunk encapsulation dot1q
SW3(config-if-range)#switchport mode trunk
SW3(config-if-range)#exit
SW3(config)#vlan 10
SW3(config-vlan)#name IT
SW3(config-vlan)#exit
SW3(config)#vlan 20
SW3(config-vlan)#name HR
SW3(config-vlan)#exit
SW3(config)#interface Eth0/1
SW3(config-if)#switchport mode access
SW3(config-if)#switchport access vlan 10
SW3(config-if)#exit
SW3(config)#interface Eth0/2
SW3(config-if)#switchport mode access
SW3(config-if)#switchport access vlan 20
SW2(config-if)#exit
SW3(config)#end
SW3#
步驟3:配置生成樹
配置SW1:
SW1(config)#spanning-tree vlan 10 root primary
SW1(config)#spanning-tree vlan 20 root secondary
配置SW2:
SW2(config)#spanning-tree vlan 20 root primary
SW2(config)#spanning-tree vlan 10 root secondary
實驗檢查
步驟1:檢查VLAN10的生成樹
檢查SW1:
SW1#show spanning-tree vlan 10
VLAN0010
? Spanning tree enabled protocol ieee
? Root ID??? Priority??? 24586
???????????? Address???? aabb.cc00.1000
???????????? This bridge is the root
???????????? Hello Time?? 2 sec? Max Age 20 sec? Forward Delay 15 sec
? Bridge ID? Priority??? 24586? (priority 24576 sys-id-ext 10)
???????????? Address???? aabb.cc00.1000
???????????? Hello Time?? 2 sec? Max Age 20 sec? Forward Delay 15 sec
???????????? Aging Time? 15? sec
Interface?????????? Role Sts Cost????? Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0?????????????? Desg FWD 100?????? 128.1??? P2p
Et0/1?????????????? Desg FWD 100?????? 128.2??? P2p
Et0/2?????????????? Desg FWD 100?????? 128.3??? P2p
SW1是VLAN10的根網(wǎng)橋,因為SW2是VLAN10的備份根網(wǎng)橋,所以SW3的E0/3針對VLAN10肯定是阻塞狀態(tài)。
檢查SW3:
SW3#show spanning-tree vlan 10
VLAN0010
? Spanning tree enabled protocol ieee
? Root ID??? Priority??? 24586
???????????? Address???? aabb.cc00.1000
???????????? Cost??????? 100
???????????? Port??????? 1 (Ethernet0/0)
???????????? Hello Time?? 2 sec? Max Age 20 sec? Forward Delay 15 sec
? Bridge ID? Priority??? 32778? (priority 32768 sys-id-ext 10)
???????????? Address???? aabb.cc00.3000
???????????? Hello Time?? 2 sec? Max Age 20 sec? Forward Delay 15 sec
???????????? Aging Time? 300 sec
Interface?????????? Role Sts Cost????? Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0?????????????? Root FWD 100?????? 128.1??? P2p
Et0/1?????????????? Desg FWD 100??? ???128.2??? P2p
Et0/3?????????????? Altn BLK 100?????? 128.4??? P2p
針對VLAN10,SW3的E0/3是阻塞的,E0/0是轉(zhuǎn)發(fā)的,這樣PC1訪問Server1的路徑就是:PC1->SW3->SW1->Server1。
步驟2:檢查VLAN20的生成樹
檢查SW2:
SW2#show spanning-tree vlan 20
VLAN0020
? Spanning tree enabled protocol ieee
? Root ID??? Priority??? 24596
???????????? Address???? aabb.cc00.2000
???????????? This bridge is the root
???????????? Hello Time?? 2 sec? Max Age 20 sec? Forward Delay 15 sec
? Bridge ID? Priority??? 24596? (priority 24576 sys-id-ext 20)
???????????? Address?? ??aabb.cc00.2000
???????????? Hello Time?? 2 sec? Max Age 20 sec? Forward Delay 15 sec
???????????? Aging Time? 300 sec
Interface?????????? Role Sts Cost????? Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/1?????????????? Desg FWD 100?????? 128.2??? P2p
Et0/2?????????????? Desg FWD 100?????? 128.3??? P2p
Et0/3?????????????? Desg FWD 100?????? 128.4??? P2p
SW2是VLAN20的根網(wǎng)橋,因為SW1是VLAN10的備份根網(wǎng)橋,所以SW3的E0/0針對VLAN20肯定是阻塞狀態(tài)。
檢查SW3:
SW3#show spanning-tree vlan 20
VLAN0020
? Spanning tree enabled protocol ieee
? Root ID??? Priority??? 24596
???????????? Address???? aabb.cc00.2000
???????????? Cost??????? 100
???????????? Port??????? 4 (Ethernet0/3)
???????????? Hello Time?? 2 sec? Max Age 20 sec? Forward Delay 15 sec
? Bridge ID? Priority??? 32788? (priority 32768 sys-id-ext 20)
???????????? Address???? aabb.cc00.3000
???????????? Hello Time?? 2 sec? Max Age 20 sec? Forward Delay 15 sec
???????????? Aging Time? 300 sec
Interface?????????? Role Sts Cost????? Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0?????????????? Altn BLK 100?????? 128.1??? P2p
Et0/2?????????????? Desg FWD 100?????? 128.3??? P2p
Et0/3?????????????? Root FWD 100?????? 128.4??? P2p
針對VLAN20,SW3的E0/0是阻塞的,E0/3是轉(zhuǎn)發(fā)的,這樣PC2訪問Server2的路徑就是:PC2->SW3->SW2->Server2。
實驗10:配置VLAN間路由_01
實驗?zāi)康?/strong>
- 理解VLAN間路由的原理
- 掌握VLAN間路由的配置
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 配置單臂路由實現(xiàn)VLAN10和VLAN20之間的互訪。
實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
VPCS> set pcname PC1?? //設(shè)置主機名
PC1> ip 192.168.1.1/24 192.168.1.254??? //設(shè)置IP地址與網(wǎng)關(guān)
配置PC2:
VPCS> set pcname PC2
PC2> ip 172.16.1.1/24 172.16.1.254
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#end
R1#
配置SW1:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW1
SW1(config)#no ip domain-lookup
SW1(config)#line console 0
SW1(config-line)#exec-timeout 0 0
SW1(config-line)#logging synchronous
SW1(config-line)#end
SW1#
步驟2:單臂路由的配置
配置R1:
R1(config)#interface Ethernet0/0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface Ethernet0/0.10
R1(config-if)#encapsulation dot1Q 10
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#exit
R1(config)#interface Ethernet0/0.20
R1(config-if)#encapsulation dot1Q 20
R1(config-if)#ip address 172.16.1.254 255.255.255.0
R1(config-if)#end
R1#
配置SW1:
SW1(config)#vlan 10
SW1(config-vlan)#name IT
SW1(config-vlan)#exit
SW1(config)#vlan 20
SW1(config-vlan)#name HR
SW1(config-vlan)#exit
SW1(config)#interface Ethernet0/0
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config)#interface Ethernet0/1
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 10
SW1(config)#interface Ethernet0/2
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 20
實驗檢查
步驟1:檢查R1
檢查R1的接口狀態(tài):
R1#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/0.10???????????? 192.168.1.254?? YES manual up??????????????????? up?????
Ethernet0/0.20???????????? 172.16.1.254??? YES manual up??????????????????? up?????
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down??
檢查R1的子接口信息:
R1#show vlans
Virtual LAN ID:? 1 (IEEE 802.1Q Encapsulation)
?? vLAN Trunk Interface:?? Ethernet0/0
?This is configured as native Vlan for the following interface(s) :
Ethernet0/0
?? Protocols Configured:?? Address:????????????? Received:????? ??Transmitted:
Ethernet0/0 (1)
??????? Other?????????????????????????????????????????? 0????????????????? 20
?? 0 packets, 0 bytes input
?? 20 packets, 1440 bytes output
Virtual LAN ID:? 10 (IEEE 802.1Q Encapsulation)
?? vLAN Trunk Interface:? ?Ethernet0/0.10
?? Protocols Configured:?? Address:????????????? Received:??????? Transmitted:
Ethernet0/0.10 (10)
?????????? IP????????????? 192.168.1.254? ?????????????14?????????????????? 9
??????? Other?????????????????????????????????????????? 0???????????????? ??3
?? 72 packets, 5232 bytes input
?? 12 packets, 1056 bytes output
Virtual LAN ID:? 20 (IEEE 802.1Q Encapsulation)
?? vLAN Trunk Interface:? ?Ethernet0/0.20
?? Protocols Configured:?? Address:????????????? Received:??????? Transmitted:
Ethernet0/0.20 (20)
?????????? IP????????????? 172.16.1.254? ??????????????14?????????????????? 9
??????? Other?????????????????????????????????????????? 0?????????????????? 3
?? 72 packets, 5232 bytes input
?? 12 packets, 1056 bytes output
子接口E0/0.10的VLAN ID是10,IP地址是192.168.1.254;
子接口E0/0.20的VLAN ID是20,IP地址是172.16.1.254。
步驟2:檢查SW1
檢查SW1的VLAN信息:
SW1#show vlan brief
VLAN Name???????????????????????????? Status??? Ports
---- -------------------------------- --------- -------------------------------
1??? default???????????????????????????? active??? Et0/3
10?? VLAN0010???????????????????????? active??? Et0/1
20?? VLAN0020???????????????????????? active??? Et0/2
1002 fddi-default???????????????????? act/unsup
1003 token-ring-default??????????? ???act/unsup
1004 fddinet-default????????????????? act/unsup
1005 trnet-default??????????????????? act/unsup
檢查SW1的Trunk狀態(tài):
SW1#show interfaces trunk
Port??????? Mode???????????? Encapsulation? Status??????? Native vlan
Et0/0?????? on?????????????? 802.1q???????? trunking????? 1
Port??????? Vlans allowed on trunk
Et0/0?????? 1-4094
Port??????? Vlans allowed and active in management domain
Et0/0?????? 1,10,20
Port??????? Vlans in spanning tree forwarding state and not pruned
Et0/0?????? 1,10,20
步驟3:測試網(wǎng)絡(luò)連通性
PC1訪問PC2:
PC1> ping 172.16.1.1
84 bytes from 172.16.1.1 icmp_seq=1 ttl=63 time=1.597 ms
84 bytes from 172.16.1.1 icmp_seq=2 ttl=63 time=1.237 ms
84 bytes from 172.16.1.1 icmp_seq=3 ttl=63 time=1.975 ms
84 bytes from 172.16.1.1 icmp_seq=4 ttl=63 time=1.274 ms
84 bytes from 172.16.1.1 icmp_seq=5 ttl=63 time=1.243 ms
PC1> trace 172.16.1.1
trace to 172.16.1.1, 8 hops max, press Ctrl+C to stop
?1?? 192.168.1.254?? 0.443 ms? 0.400 ms? 0.715 ms
?2?? *172.16.1.1?? 1.938 ms (ICMP type:3, code:3, Destination port unreachable)
通過Trace看到,數(shù)據(jù)包先到網(wǎng)關(guān)(R1),再到PC2。
實驗11:配置VLAN間路由_02
實驗?zāi)康?/strong>
- 理解VLAN間路由的原理
- 掌握VLAN間路由的配置
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 通過三層交換機的SVI實現(xiàn)VLAN10和VLAN20的互訪。
實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
VPCS> set pcname PC1?? //設(shè)置主機名
PC1> ip 192.168.1.1/24 192.168.1.254??? //設(shè)置IP地址與網(wǎng)關(guān)
配置PC2:
VPCS> set pcname PC2
PC2> ip 172.16.1.1/24 172.16.1.254
配置SW1:
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW1
SW1(config)#no ip domain-lookup
SW1(config)#line console 0
SW1(config-line)#exec-timeout 0 0
SW1(config-line)#logging synchronous
SW1(config-line)#end
SW1#
步驟2:VLAN間路由的配置
配置SW1:
SW1(config)#vlan 10
SW1(config-vlan)#name IT
SW1(config-vlan)#exit
SW1(config)#vlan 20
SW1(config-vlan)#name HR
SW1(config-vlan)#exit
SW1(config)#interface Ethernet0/1
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 10
SW1(config)#interface Ethernet0/2
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 20
SW1(config-if)#exit
SW1(config)#interface vlan 10
SW1(config-if)#ip address 192.168.1.254 255.255.255.0
SW1(config-if)#no shutdown
SW1(config)#interface vlan 20
SW1(config-if)#ip address 172.16.1.254 255.255.255.0
SW1(config-if)#no shutdown
SW1(config)#ip routing
實驗檢查
檢查SW1的接口狀態(tài):
SW1#show ip interface brief
Interface????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????? unassigned????? YES unset? administratively down down???
Ethernet0/1??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/2??????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/3??????????? unassigned????? YES unset? up??????????????????? up?????
Vlan10???????????????? 192.168.1.254?? YES manual up???????? ???????????up?????
Vlan20???????????????? 172.16.1.254??? YES manual up??????????????????? up?????
SVI10和SVI20狀態(tài)正常。
測試網(wǎng)絡(luò)的連通性:
PC1> ping 172.16.1.1
84 bytes from 172.16.1.1 icmp_seq=1 ttl=63 time=2.123 ms
84 bytes from 172.16.1.1 icmp_seq=2 ttl=63 time=0.626 ms
84 bytes from 172.16.1.1 icmp_seq=3 ttl=63 time=0.533 ms
84 bytes from 172.16.1.1 icmp_seq=4 ttl=63 time=0.466 ms
84 bytes from 172.16.1.1 icmp_seq=5 ttl=63 time=0.505 ms
PC1> trace 172.16.1.1
trace to 172.16.1.1, 8 hops max, press Ctrl+C to stop
?1?? 192.168.1.254?? 0.758 ms? 0.285 ms? 0.736 ms
?2?? *172.16.1.1?? 0.636 ms (ICMP type:3, code:3, Destination port unreachable)
實驗12:配置靜態(tài)路由
實驗?zāi)康?/strong>
- 了解靜態(tài)路由的原理
- 掌握靜態(tài)路由的配置
實驗任務(wù)
- 任務(wù)1
- 任務(wù)2
任務(wù)1:實驗拓?fù)?/strong>
任務(wù)1:實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 在路由器R1、R2、R3上配置靜態(tài)路由,保證全網(wǎng)路由可達;
任務(wù)1:實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
VPCS> set pcname PC1?? //設(shè)置主機名
PC1> ip 192.168.1.1/24 192.168.1.254??? //設(shè)置IP地址與網(wǎng)關(guān)
配置PC2:
VPCS> set pcname PC2
PC2> ip 192.168.2.1/24 192.168.2.254
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface serial1/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface serial1/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface serial1/1
R2(config-if)#ip address 192.168.23.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
配置R3:
Router>enable
Router#configure terminal
Router(config)#hostname R3
R3(config)#no ip domain-lookup
R3(config)#line console 0
R3(config-line)#exec-timeout 0 0
R3(config-line)#logging synchronous
R3(config-line)#exit
R3(config)#interface ethernet0/0
R3(config-if)#ip address 192.168.2.254 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface serial1/0
R3(config-if)#ip address 192.168.23.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#end
R3#
步驟2:檢查設(shè)備接口狀態(tài)
檢查PC1:
PC1> show ip
NAME??????? : PC1[1]
IP/MASK???? : 192.168.1.1/24
GATEWAY???? : 192.168.1.254
DNS???????? :
MAC???????? : 00:50:79:66:68:04
LPORT?????? : 20000
RHOST:PORT? : 127.0.0.1:30000
MTU???????? : 1500
檢查R1:
R1#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.1.254?? YES manual up??????????????????? up?????
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 192.168.12.1??? YES manual up??????????????????? up?? ???
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down? ??
檢查R2:
R2#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 192.168.12.2??? YES manual up??????????????????? up?????
Serial1/1????????????????? 192.168.23.2??? YES manual up??????????????????? up?????
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down
檢查R3:
R3#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.2.254?? YES manual up??????????????????? up?????
Ethernet0/1???????????? ???unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0??????????????? ??192.168.23.3??? YES manual up??????????????????? up?????
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3???????????????? ?unassigned????? YES unset? administratively down down???
檢查PC2:
PC2> show ip
NAME??????? : PC2[1]
IP/MASK???? : 192.168.2.1/24
GATEWAY???? : 192.168.2.254
DNS???????? :
MAC???????? : 00:50:79:66:68:05
LPORT?????? : 20000
RHOST:PORT? : 127.0.0.1:30000
MTU???????? : 1500
步驟3:測試直連網(wǎng)絡(luò)的連通性
測試PC1跟網(wǎng)關(guān)的網(wǎng)絡(luò)連通性:
PC1> ping 192.168.1.254
84 bytes from 192.168.1.254 icmp_seq=1 ttl=255 time=0.359 ms
84 bytes from 192.168.1.254 icmp_seq=2 ttl=255 time=0.459 ms
84 bytes from 192.168.1.254 icmp_seq=3 ttl=255 time=0.463 ms
84 bytes from 192.168.1.254 icmp_seq=4 ttl=255 time=0.403 ms
84 bytes from 192.168.1.254 icmp_seq=5 ttl=255 time=0.417 ms
測試R1跟R2之間的網(wǎng)絡(luò)連通性:
R1#ping 192.168.12.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/9/10 ms
測試R2跟R3之間的網(wǎng)絡(luò)連通性:
R2#ping 192.168.23.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/9/11 ms
測試PC2跟網(wǎng)關(guān)的網(wǎng)絡(luò)連通性:
PC2> ping 192.168.2.254
84 bytes from 192.168.2.254 icmp_seq=1 ttl=255 time=0.469 ms
84 bytes from 192.168.2.254 icmp_seq=2 ttl=255 time=0.484 ms
84 bytes from 192.168.2.254 icmp_seq=3 ttl=255 time=0.518 ms
84 bytes from 192.168.2.254 icmp_seq=4 ttl=255 time=0.400 ms
84 bytes from 192.168.2.254 icmp_seq=5 ttl=255 time=0.405 ms
注意,雖然設(shè)備之間的網(wǎng)絡(luò)連通性正常了,但是PC1和PC2之間的網(wǎng)絡(luò)是不可達的:
PC1> ping 192.168.2.1
*192.168.1.254 icmp_seq=1 ttl=255 time=0.345 ms (ICMP type:3, code:1, Destination host unreachable)
*192.168.1.254 icmp_seq=2 ttl=255 time=0.462 ms (ICMP type:3, code:1, Destination host unreachable)
*192.168.1.254 icmp_seq=3 ttl=255 time=0.543 ms (ICMP type:3, code:1, Destination host unreachable)
*192.168.1.254 icmp_seq=4 ttl=255 time=0.494 ms (ICMP type:3, code:1, Destination host unreachable)
*192.168.1.254 icmp_seq=5 ttl=255 time=0.467 ms (ICMP type:3, code:1, Destination host unreachable)
因為PC1把數(shù)據(jù)包發(fā)送給R1后,R1沒有到達網(wǎng)絡(luò)192.168.2.0/24的路由,所以R1無法轉(zhuǎn)發(fā)數(shù)據(jù)包。
檢查R1的路由表:
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
????? 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.1.0/24 is directly connected, Ethernet0/0
L??????? 192.168.1.254/32 is directly connected, Ethernet0/0
????? 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.12.0/24 is directly connected, Serial1/0
L??????? 192.168.12.1/32 is directly connected, Serial1/0
R1只有兩條直連路由,分別是192.168.1.0/24和192.168.12.0/24。
因此,我們需要在R1上配置去往192.168.2.0/24的靜態(tài)路由。
步驟4:配置靜態(tài)路由
配置R1:
R1(config)#ip route 192.168.2.0 255.255.255.0 192.168.12.2
//當(dāng)然也可以跟出接口
路由要有去有回網(wǎng)絡(luò)才能通,所以R3上要配置回程路由。
配置R3:
R3(config)#ip route 192.168.1.0 255.255.255.0 serial 1/0
//當(dāng)然也可以跟下一跳
另外,沿途的路由器也要有去往源和目標(biāo)網(wǎng)絡(luò)的路由。
配置R2:
R2(config)#ip route 192.168.1.0 255.255.255.0 192.168.12.1
//當(dāng)然也可以跟出接口
R2(config)#ip route 192.168.2.0 255.255.255.0 192.168.23.3
//當(dāng)然也可以跟出接口
這樣當(dāng)PC1把數(shù)據(jù)包發(fā)送給R1時,R1查路由表:
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
???? ??i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?? ????+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
????? 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.1.0/24 is directly connected, Ethernet0/0
L??????? 192.168.1.254/32 is directly connected, Ethernet0/0
S???? 192.168.2.0/24 [1/0] via 192.168.12.2
????? 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.12.0/24 is directly connected, Serial1/0
L??????? 192.168.12.1/32 is directly connected, Serial1/0
R1有到達網(wǎng)絡(luò)192.168.2.0/24的路由,所以R1把數(shù)據(jù)包發(fā)送給下一跳R2,R2檢查路由表:
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
S???? 192.168.1.0/24 [1/0] via 192.168.12.1
S???? 192.168.2.0/24 [1/0] via 192.168.23.3
????? 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.12.0/24 is directly connected, Serial1/0
L??????? 192.168.12.2/32 is directly connected, Serial1/0
????? 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.23.0/24 is directly connected, Serial1/1
L??????? 192.168.23.2/32 is directly connected, Serial1/1
R2有到達網(wǎng)絡(luò)192.168.2.0/24的路由,所以R2把數(shù)據(jù)包發(fā)送給下一跳R3,R3檢查路由表:
R3#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
S???? 192.168.1.0/24 is directly connected, Serial1/0
???? ?192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.2.0/24 is directly connected, Ethernet0/0
L??????? 192.168.2.254/32 is directly connected, Ethernet0/0
????? 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.23.0/24 is directly connected, Serial1/0
L??????? 192.168.23.3/32 is directly connected, Serial1/0
R3上192.168.2.0/24是自己的直連網(wǎng)絡(luò),所以R3把數(shù)據(jù)包直接發(fā)給PC2。
回程數(shù)據(jù)包的轉(zhuǎn)發(fā)原理一樣,這里不再撰述。
步驟5:測試PC1跟PC2的網(wǎng)絡(luò)連通性
PC1> ping 192.168.2.1
84 bytes from 192.168.2.1 icmp_seq=1 ttl=61 time=22.503 ms
84 bytes from 192.168.2.1 icmp_seq=2 ttl=61 time=18.859 ms
84 bytes from 192.168.2.1 icmp_seq=3 ttl=61 time=19.251 ms
84 bytes from 192.168.2.1 icmp_seq=4 ttl=61 time=19.350 ms
84 bytes from 192.168.2.1 icmp_seq=5 ttl=61 time=17.856 ms
因為需求要求全網(wǎng)路由可達;
如果這個時候在R1上Ping PC2,能不能通呢?不能!
在R1上Ping PC2,數(shù)據(jù)包源地址是192.168.12.1,數(shù)據(jù)包能到達PC2,但是回不來,因為R3上沒有到達192.168.12.0/24的路由;
同理,R3上Ping PC1也不通,因為R1沒有到達192.168.23.0/24的路由。
檢查R3的路由表:
R3#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
S???? 192.168.1.0/24 is directly connected, Serial1/0
????? 192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.2.0/24 is directly connected, Ethernet0/0
L??????? 192.168.2.254/32 is directly connected, Ethernet0/0
????? 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.23.0/24 is directly connected, Serial1/0
L??????? 192.168.23.3/32 is directly connected, Serial1/0
R3沒有到達網(wǎng)絡(luò)192.168.12.0/24的路由。
配置R3:
R3(config)#ip route 192.168.12.0 255.255.255.0 192.168.23.2
//當(dāng)然也可以跟出接口
同理,配置R1:
R1(config)#ip route 192.168.23.0 255.255.255.0 serial 1/0
//當(dāng)然也可以跟下一跳
檢查R1的路由表:
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
????? 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.1.0/24 is directly connected, Ethernet0/0
L??????? 192.168.1.254/32 is directly connected, Ethernet0/0
S???? 192.168.2.0/24 [1/0] via 192.168.12.2
????? 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.12.0/24 is directly connected, Serial1/0
L??????? 192.168.12.1/32 is directly connected, Serial1/0
S???? 192.168.23.0/24 is directly connected, Serial1/0
R1有到達192.168.2.0/24和192.168.23.0/24的路由。
檢查R3的路由表:
R3#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
????? ?N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
S???? 192.168.1.0/24 is directly connected, Serial1/0
????? 192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.2.0/24 is directly connected, Ethernet0/0
L??????? 192.168.2.254/32 is directly connected, Ethernet0/0
S???? 192.168.12.0/24 [1/0] via 192.168.23.2
????? 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.23.0/24 is directly connected, Serial1/0
L??????? 192.168.23.3/32 is directly connected, Serial1/0
R3有到達192.168.1.0/24和192.168.12.0/24的路由。
步驟6:測試網(wǎng)絡(luò)連通性
在PC1上測試:
PC1> ping 192.168.2.1
84 bytes from 192.168.2.1 icmp_seq=1 ttl=61 time=21.429 ms
84 bytes from 192.168.2.1 icmp_seq=2 ttl=61 time=18.079 ms
84 bytes from 192.168.2.1 icmp_seq=3 ttl=61 time=19.108 ms
84 bytes from 192.168.2.1 icmp_seq=4 ttl=61 time=19.006 ms
84 bytes from 192.168.2.1 icmp_seq=5 ttl=61 time=18.163 ms
PC1> ping 192.168.23.3
84 bytes from 192.168.23.3 icmp_seq=1 ttl=253 time=18.265 ms
84 bytes from 192.168.23.3 icmp_seq=2 ttl=253 time=18.186 ms
84 bytes from 192.168.23.3 icmp_seq=3 ttl=253 time=18.184 ms
84 bytes from 192.168.23.3 icmp_seq=4 ttl=253 time=18.257 ms
84 bytes from 192.168.23.3 icmp_seq=5 ttl=253 time=18.240 ms
PC1> ping 192.168.12.2
84 bytes from 192.168.12.2 icmp_seq=1 ttl=254 time=9.899 ms
84 bytes from 192.168.12.2 icmp_seq=2 ttl=254 time=9.380 ms
84 bytes from 192.168.12.2 icmp_seq=3 ttl=254 time=9.159 ms
84 bytes from 192.168.12.2 icmp_seq=4 ttl=254 time=9.300 ms
84 bytes from 192.168.12.2 icmp_seq=5 ttl=254 time=9.268 ms
任務(wù)2:實驗拓?fù)?/strong>
任務(wù)2:實驗需求
- 在R1和R3上刪除任務(wù)1的靜態(tài)路由;
- 在路由器R1、R3上配置默認(rèn)路由,使得全網(wǎng)路由可達。
任務(wù)2:實驗步驟
步驟1:刪除R1和R3上的靜態(tài)路由并配置默認(rèn)路由
配置R1:
R1(config)#no ip route 192.168.2.0 255.255.255.0 192.168.12.2
R1(config)#no ip route 192.168.23.0 255.255.255.0 Serial1/0
R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.2
配置R3:
R3(config)#no ip route 192.168.1.0 255.255.255.0 Serial1/0
R3(config)#no ip route 192.168.12.0 255.255.255.0 192.168.23.2
R3(config)#ip route 0.0.0.0 0.0.0.0 192.168.23.2
步驟2:檢查默認(rèn)路由
檢查R1:
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
? ?????i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is 192.168.12.2 to network 0.0.0.0
S*??? 0.0.0.0/0 [1/0] via 192.168.12.2
????? 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.1.0/24 is directly connected, Ethernet0/0
L??????? 192.168.1.254/32 is directly connected, Ethernet0/0
????? 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.12.0/24 is directly connected, Serial1/0
L??????? 192.168.12.1/32 is directly connected, Serial1/0
檢查R3:
R3#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is 192.168.23.2 to network 0.0.0.0
S*??? 0.0.0.0/0 [1/0] via 192.168.23.2
????? 192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.2.0/24 is directly connected, Ethernet0/0
L??????? 192.168.2.254/32 is directly connected, Ethernet0/0
????? 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.23.0/24 is directly connected, Serial1/0
L??????? 192.168.23.3/32 is directly connected, Serial1/0
步驟3:網(wǎng)絡(luò)連通性測試
PC1> ping 192.168.2.1
84 bytes from 192.168.2.1 icmp_seq=1 ttl=61 time=20.698 ms
84 bytes from 192.168.2.1 icmp_seq=2 ttl=61 time=19.478 ms
84 bytes from 192.168.2.1 icmp_seq=3 ttl=61 time=18.593 ms
84 bytes from 192.168.2.1 icmp_seq=4 ttl=61 time=19.404 ms
84 bytes from 192.168.2.1 icmp_seq=5 ttl=61 time=19.616 ms
PC1> ping 192.168.23.3
84 bytes from 192.168.23.3 icmp_seq=1 ttl=253 time=22.048 ms
84 bytes from 192.168.23.3 icmp_seq=2 ttl=253 time=20.271 ms
84 bytes from 192.168.23.3 icmp_seq=3 ttl=253 time=19.362 ms
84 bytes from 192.168.23.3 icmp_seq=4 ttl=253 time=20.110 ms
84 bytes from 192.168.23.3 icmp_seq=5 ttl=253 time=21.321 ms
PC1> ping 192.168.12.2
84 bytes from 192.168.12.2 icmp_seq=1 ttl=254 time=10.201 ms
84 bytes from 192.168.12.2 icmp_seq=2 ttl=254 time=10.220 ms
84 bytes from 192.168.12.2 icmp_seq=3 ttl=254 time=8.304 ms
84 bytes from 192.168.12.2 icmp_seq=4 ttl=254 time=9.170 ms
84 bytes from 192.168.12.2 icmp_seq=5 ttl=254 time=10.084 ms
實驗13:配置EIGRP
實驗?zāi)康?/strong>
- 了解EIGRP的運行原理
- 了解EIGRP自動匯總的原理
- 掌握EIGRP基本的配置方法
- 掌握EIGRP手工匯總的配置方法
實驗任務(wù)
- 任務(wù)1
- 任務(wù)2
- 任務(wù)3
任務(wù)1:實驗拓?fù)?/strong>
任務(wù)1:實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 在R1、R2、R3上配置EIGRP,使得全網(wǎng)路由可達;
- 測試網(wǎng)絡(luò)的連通性。
任務(wù)1:實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
VPCS> set pcname PC1?? //設(shè)置主機名
PC1> ip 192.168.1.1/24 192.168.1.254??? //設(shè)置IP地址與網(wǎng)關(guān)
配置PC2:
VPCS> set pcname PC2
PC2> ip 192.168.2.1/24 192.168.2.254
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface serial1/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface serial1/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface serial1/1
R2(config-if)#ip address 192.168.23.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
配置R3:
Router>enable
Router#configure terminal
Router(config)#hostname R3
R3(config)#no ip domain-lookup
R3(config)#line console 0
R3(config-line)#exec-timeout 0 0
R3(config-line)#logging synchronous
R3(config-line)#exit
R3(config)#interface ethernet0/0
R3(config-if)#ip address 192.168.2.254 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface serial1/0
R3(config-if)#ip address 192.168.23.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#end
R3#
步驟2:檢查設(shè)備接口狀態(tài)
檢查PC1:
PC1> show ip
NAME??????? : PC1[1]
IP/MASK???? : 192.168.1.1/24
GATEWAY???? : 192.168.1.254
DNS???????? :
MAC???????? : 00:50:79:66:68:04
LPORT?????? : 20000
RHOST:PORT? : 127.0.0.1:30000
MTU???????? : 1500
檢查R1:
R1#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.1.254?? YES manual up??????????????????? up?????
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 192.168.12.1??? YES manual up??????????????????? up?? ???
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down? ??
檢查R2:
R2#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 192.168.12.2??? YES manual up??????????????????? up?????
Serial1/1????????????????? 192.168.23.2??? YES manual up??????????????????? up?????
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down
檢查R3:
R3#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.2.254?? YES manual up??????????????????? up?????
Ethernet0/1???????????? ???unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0??????????????? ??192.168.23.3??? YES manual up??????????????????? up?????
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3???????????????? ?unassigned????? YES unset? administratively down down???
檢查PC2:
PC2> show ip
NAME??????? : PC2[1]
IP/MASK???? : 192.168.2.1/24
GATEWAY???? : 192.168.2.254
DNS???????? :
MAC???????? : 00:50:79:66:68:05
LPORT?????? : 20000
RHOST:PORT? : 127.0.0.1:30000
MTU???????? : 1500
步驟3:測試直連網(wǎng)絡(luò)的連通性
測試PC1跟網(wǎng)關(guān)的網(wǎng)絡(luò)連通性:
PC1> ping 192.168.1.254
84 bytes from 192.168.1.254 icmp_seq=1 ttl=255 time=0.359 ms
84 bytes from 192.168.1.254 icmp_seq=2 ttl=255 time=0.459 ms
84 bytes from 192.168.1.254 icmp_seq=3 ttl=255 time=0.463 ms
84 bytes from 192.168.1.254 icmp_seq=4 ttl=255 time=0.403 ms
84 bytes from 192.168.1.254 icmp_seq=5 ttl=255 time=0.417 ms
測試R1跟R2之間的網(wǎng)絡(luò)連通性:
R1#ping 192.168.12.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/9/10 ms
測試R2跟R3之間的網(wǎng)絡(luò)連通性:
R2#ping 192.168.23.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/9/11 ms
測試PC2跟網(wǎng)關(guān)的網(wǎng)絡(luò)連通性:
PC2> ping 192.168.2.254
84 bytes from 192.168.2.254 icmp_seq=1 ttl=255 time=0.469 ms
84 bytes from 192.168.2.254 icmp_seq=2 ttl=255 time=0.484 ms
84 bytes from 192.168.2.254 icmp_seq=3 ttl=255 time=0.518 ms
84 bytes from 192.168.2.254 icmp_seq=4 ttl=255 time=0.400 ms
84 bytes from 192.168.2.254 icmp_seq=5 ttl=255 time=0.405 ms
步驟4:配置EIGRP
配置R1:
R1(config)#router eigrp 100
R1(config-router)#network 192.168.1.0 0.0.0.255
R1(config-router)#network 192.168.12.0 0.0.0.255
R1(config-router)#end
R1#
配置R2:
R2(config)#router eigrp 100
R2(config-router)#network 192.168.12.0 0.0.0.255
R2(config-router)#network 192.168.23.0 0.0.0.255
R2(config-router)#end
R2#
配置R3:
R3(config)#router eigrp 100
R3(config-router)#network 192.168.23.0 0.0.0.255
R3(config-router)#network 192.168.2.0 0.0.0.255
R3(config-router)#end
R3#
步驟5:檢查EIGRP路由
檢查R1:
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
????? 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.1.0/24 is directly connected, Ethernet0/0
L??????? 192.168.1.254/32 is directly connected, Ethernet0/0
D???? 192.168.2.0/24 [90/2707456] via 192.168.12.2, 00:00:55, Serial1/0
????? 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.12.0/24 is directly connected, Serial1/0
L??????? 192.168.12.1/32 is directly connected, Serial1/0
D???? 192.168.23.0/24 [90/2681856] via 192.168.12.2, 00:01:34, Serial1/0
檢查R2:
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
D???? 192.168.1.0/24 [90/2195456] via 192.168.12.1, 00:02:26, Serial1/0
D???? 192.168.2.0/24 [90/2195456] via 192.168.23.3, 00:01:24, Serial1/1
????? 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.12.0/24 is directly connected, Serial1/0
L??????? 192.168.12.2/32 is directly connected, Serial1/0
????? 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.23.0/24 is directly connected, Serial1/1
L??????? 192.168.23.2/32 is directly connected, Serial1/1
檢查R3:
R3#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
D???? 192.168.1.0/24 [90/2707456] via 192.168.23.2, 00:01:55, Serial1/0
????? 192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.2.0/24 is directly connected, Ethernet0/0
L??????? 192.168.2.254/32 is directly connected, Ethernet0/0
D???? 192.168.12.0/24 [90/2681856] via 192.168.23.2, 00:01:55, Serial1/0
????? 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.23.0/24 is directly connected, Serial1/0
L??????? 192.168.23.3/32 is directly connected, Serial1/0
步驟6:測試網(wǎng)絡(luò)的連通性
測試PC1:
PC1> ping 192.168.2.1
84 bytes from 192.168.2.1 icmp_seq=1 ttl=61 time=21.438 ms
84 bytes from 192.168.2.1 icmp_seq=2 ttl=61 time=14.345 ms
84 bytes from 192.168.2.1 icmp_seq=3 ttl=61 time=19.706 ms
84 bytes from 192.168.2.1 icmp_seq=4 ttl=61 time=18.968 ms
84 bytes from 192.168.2.1 icmp_seq=5 ttl=61 time=19.006 ms
PC1> ping 192.168.23.3
84 bytes from 192.168.23.3 icmp_seq=1 ttl=253 time=18.992 ms
84 bytes from 192.168.23.3 icmp_seq=2 ttl=253 time=18.513 ms
84 bytes from 192.168.23.3 icmp_seq=3 ttl=253 time=18.559 ms
84 bytes from 192.168.23.3 icmp_seq=4 ttl=253 time=18.514 ms
84 bytes from 192.168.23.3 icmp_seq=5 ttl=253 time=15.974 ms
PC1> ping 192.168.12.2
84 bytes from 192.168.12.2 icmp_seq=1 ttl=254 time=9.668 ms
84 bytes from 192.168.12.2 icmp_seq=2 ttl=254 time=9.340 ms
84 bytes from 192.168.12.2 icmp_seq=3 ttl=254 time=9.307 ms
84 bytes from 192.168.12.2 icmp_seq=4 ttl=254 time=9.189 ms
84 bytes from 192.168.12.2 icmp_seq=5 ttl=254 time=9.086 ms
任務(wù)2:實驗拓?fù)?/strong>
任務(wù)2:實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 在R1和R3上分別創(chuàng)建Lo1、Lo2、Lo3,IP地址如圖所示,并宣告進EIGRP;
- 在R1、R2、R3上配置EIGRP,打開自動匯總,保證全網(wǎng)路由可達。
任務(wù)2:實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
VPCS> set pcname PC1?? //設(shè)置主機名
PC1> ip 192.168.1.1/24 192.168.1.254??? //設(shè)置IP地址與網(wǎng)關(guān)
配置PC2:
VPCS> set pcname PC2
PC2> ip 192.168.2.1/24 192.168.2.254
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface loopback 1
R1(config-if)#ip address 172.16.1.1 255.255.255.0
R1(config-if)#exit
R1(config)#interface loopback 2
R1(config-if)#ip address 172.16.2.1 255.255.255.0
R1(config-if)#exit
R1(config)#interface loopback 3
R1(config-if)#ip address 172.16.3.1 255.255.255.0
R1(config-if)#exit
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface serial1/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface serial1/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface serial1/1
R2(config-if)#ip address 192.168.23.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
配置R3:
Router>enable
Router#configure terminal
Router(config)#hostname R3
R3(config)#no ip domain-lookup
R3(config)#line console 0
R3(config-line)#exec-timeout 0 0
R3(config-line)#logging synchronous
R3(config-line)#exit
R3(config)#interface loopback 1
R3(config-if)#ip address 172.16.10.1 255.255.255.0
R3(config-if)#exit
R3(config)#interface loopback 2
R3(config-if)#ip address 172.16.20.1 255.255.255.0
R3(config-if)#exit
R3(config)#interface loopback 3
R3(config-if)#ip address 172.16.30.1 255.255.255.0
R3(config-if)#exit
R3(config)#interface ethernet0/0
R3(config-if)#ip address 192.168.2.254 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface serial1/0
R3(config-if)#ip address 192.168.23.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#end
R3#
步驟2:檢查設(shè)備接口狀態(tài)
檢查PC1:
PC1> show ip
NAME??????? : PC1[1]
IP/MASK???? : 192.168.1.1/24
GATEWAY???? : 192.168.1.254
DNS???????? :
MAC???????? : 00:50:79:66:68:04
LPORT?????? : 20000
RHOST:PORT? : 127.0.0.1:30000
MTU???????? : 1500
檢查R1:
R1#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.1.254?? YES manual up??????????????????? up?????
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 192.168.12.1??? YES manual up??????????????????? up?? ???
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down? ??
檢查R2:
R2#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 192.168.12.2??? YES manual up??????????????????? up?????
Serial1/1????????????????? 192.168.23.2??? YES manual up??????????????????? up?????
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down
檢查R3:
R3#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.2.254?? YES manual up??????????????????? up?????
Ethernet0/1???????????? ???unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0??????????????? ??192.168.23.3??? YES manual up??????????????????? up?????
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3???????????????? ?unassigned????? YES unset? administratively down down???
檢查PC2:
PC2> show ip
NAME??????? : PC2[1]
IP/MASK???? : 192.168.2.1/24
GATEWAY???? : 192.168.2.254
DNS???????? :
MAC???????? : 00:50:79:66:68:05
LPORT?????? : 20000
RHOST:PORT? : 127.0.0.1:30000
MTU???????? : 1500
步驟3:測試直連網(wǎng)絡(luò)的連通性
測試PC1跟網(wǎng)關(guān)的網(wǎng)絡(luò)連通性:
PC1> ping 192.168.1.254
84 bytes from 192.168.1.254 icmp_seq=1 ttl=255 time=0.359 ms
84 bytes from 192.168.1.254 icmp_seq=2 ttl=255 time=0.459 ms
84 bytes from 192.168.1.254 icmp_seq=3 ttl=255 time=0.463 ms
84 bytes from 192.168.1.254 icmp_seq=4 ttl=255 time=0.403 ms
84 bytes from 192.168.1.254 icmp_seq=5 ttl=255 time=0.417 ms
測試R1跟R2之間的網(wǎng)絡(luò)連通性:
R1#ping 192.168.12.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/9/10 ms
測試R2跟R3之間的網(wǎng)絡(luò)連通性:
R2#ping 192.168.23.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/9/11 ms
測試PC2跟網(wǎng)關(guān)的網(wǎng)絡(luò)連通性:
PC2> ping 192.168.2.254
84 bytes from 192.168.2.254 icmp_seq=1 ttl=255 time=0.469 ms
84 bytes from 192.168.2.254 icmp_seq=2 ttl=255 time=0.484 ms
84 bytes from 192.168.2.254 icmp_seq=3 ttl=255 time=0.518 ms
84 bytes from 192.168.2.254 icmp_seq=4 ttl=255 time=0.400 ms
84 bytes from 192.168.2.254 icmp_seq=5 ttl=255 time=0.405 ms
步驟4:打開EIGRP自動匯總
配置R1:
R1(config)#router eigrp 100
R1(config-router)#auto-summary
R1(config-router)#network 172.16.1.0 0.0.0.255
R1(config-router)#network 172.16.2.0 0.0.0.255
R1(config-router)#network 172.16.3.0 0.0.0.255
R1(config-router)#network 192.168.1.0 0.0.0.255
R1(config-router)#network 192.168.12.0 0.0.0.255
R1(config-router)#end
R1#
配置R2:
R2(config)#router eigrp 100
R2(config-router)#auto-summary
R2(config-router)#network 192.168.12.0 0.0.0.255
R2(config-router)#network 192.168.23.0 0.0.0.255
R2(config-router)#end
R2#
配置R3:
R3(config)#router eigrp 100
R3(config-router)#auto-summary
R3(config-router)#network 172.16.10.0 0.0.0.255
R3(config-router)#network 172.16.20.0 0.0.0.255
R3(config-router)#network 172.16.30.0 0.0.0.255
R3(config-router)#network 192.168.23.0 0.0.0.255
R3(config-router)#network 192.168.2.0 0.0.0.255
R3(config-router)#end
R3#
步驟5:檢查EIGRP路由
檢查R2:
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
D???? 172.16.0.0/16 [90/2297856] via 192.168.23.3, 00:02:53, Serial1/1
??????????????????? [90/2297856] via 192.168.12.1, 00:02:53, Serial1/0
D???? 192.168.1.0/24 [90/2195456] via 192.168.12.1, 00:19:55, Serial1/0
D???? 192.168.2.0/24 [90/2195456] via 192.168.23.3, 00:18:53, Serial1/1
????? 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.12.0/24 is directly connected, Serial1/0
L??????? 192.168.12.2/32 is directly connected, Serial1/0
????? 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.23.0/24 is directly connected, Serial1/1
L??????? 192.168.23.2/32 is directly connected, Serial1/1
R2的路由表去往172.16.0.0/16是等價負(fù)載的,為什么?
EIGRP在自動匯總打開的情況下,在主類網(wǎng)絡(luò)邊界會執(zhí)行自動匯總,將路由匯總成主類網(wǎng)絡(luò);
R1和R3的Lo1、Lo2、Lo3接口地址都是B類地址,所以R1和R3把它們匯總了B類網(wǎng)絡(luò),即,172.16.0.0/16。
假設(shè)這個時候R2有數(shù)據(jù)包要去往172.16.1.0/24或其它網(wǎng)絡(luò),那么有可能會出現(xiàn)以下情況:
R2#ping 172.16.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
U.U.U
Success rate is 0 percent (0/5)
R2#ping 172.16.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 7/9/11 ms
因為路由是負(fù)載的,所以有可能有的網(wǎng)絡(luò)通,有的網(wǎng)絡(luò)不通。
怎么解決?關(guān)閉自動匯總!
步驟6:關(guān)閉EIGRP自動匯總
注意,12.X版本的IOS自動匯總默認(rèn)打開,15.X版本的IOS自動匯總默認(rèn)關(guān)閉。
配置R1:
R1(config)#router eigrp 100
R1(config-router)#no auto-summary
R1(config-router)#end
R1#
配置R2:
R2(config)#router eigrp 100
R2(config-router)#no auto-summary
R2(config-router)#end
R2#
配置R3:
R3(config)#router eigrp 100
R3(config-router)#no auto-summary
R3(config-router)#end
R3#
關(guān)閉自動匯總之后,R2的路由表看到的就是Loopback口的明細(xì)路由而不是匯總路由了。
檢查R2:
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
????? 172.16.0.0/24 is subnetted, 6 subnets
D??????? 172.16.1.0 [90/2297856] via 192.168.12.1, 00:01:01, Serial1/0
D??????? 172.16.2.0 [90/2297856] via 192.168.12.1, 00:01:01, Serial1/0
D??????? 172.16.3.0 [90/2297856] via 192.168.12.1, 00:01:01, Serial1/0
D??????? 172.16.10.0 [90/2297856] via 192.168.23.3, 00:00:07, Serial1/1
D??????? 172.16.20.0 [90/2297856] via 192.168.23.3, 00:00:07, Serial1/1
D??????? 172.16.30.0 [90/2297856] via 192.168.23.3, 00:00:07, Serial1/1
D???? 192.168.1.0/24 [90/2195456] via 192.168.12.1, 00:34:55, Serial1/0
D???? 192.168.2.0/24 [90/2195456] via 192.168.23.3, 00:33:53, Serial1/1
????? 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.12.0/24 is directly connected, Serial1/0
L??????? 192.168.12.2/32 is directly connected, Serial1/0
????? 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.23.0/24 is directly connected, Serial1/1
L??????? 192.168.23.2/32 is directly connected, Serial1/1
當(dāng)然,也不會出現(xiàn)有的網(wǎng)絡(luò)通,有的網(wǎng)絡(luò)不通的情況了。
R2#ping 172.16.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/9/10 ms
R2#ping 172.16.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/9/10 ms
R2#ping 172.16.3.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 10/10/10 ms
R2#ping 172.16.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 10/10/10 ms
R2#ping 172.16.20.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.20.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 10/10/10 ms
R2#ping 172.16.30.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.30.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/9/10 ms
任務(wù)3:需求拓?fù)?/strong>
任務(wù)3:實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 在R1、R2、R3上配置EIGRP,保證全網(wǎng)路由可達;
- 在R1上創(chuàng)建Lo1、Lo2、Lo3,IP地址如圖所示,并宣告進EIGRP;
- 在R1上對Loopback口路由進行匯總,確保R2和R3能收到匯總路由;
任務(wù)3:實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
VPCS> set pcname PC1?? //設(shè)置主機名
PC1> ip 192.168.1.1/24 192.168.1.254??? //設(shè)置IP地址與網(wǎng)關(guān)
配置PC2:
VPCS> set pcname PC2
PC2> ip 192.168.2.1/24 192.168.2.254
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface loopback 1
R1(config-if)#ip address 172.16.1.1 255.255.255.0
R1(config-if)#exit
R1(config)#interface loopback 2
R1(config-if)#ip address 172.16.2.1 255.255.255.0
R1(config-if)#exit
R1(config)#interface loopback 3
R1(config-if)#ip address 172.16.3.1 255.255.255.0
R1(config-if)#exit
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface serial1/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface serial1/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface serial1/1
R2(config-if)#ip address 192.168.23.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
配置R3:
Router>enable
Router#configure terminal
Router(config)#hostname R3
R3(config)#no ip domain-lookup
R3(config)#line console 0
R3(config-line)#exec-timeout 0 0
R3(config-line)#logging synchronous
R3(config-line)#exit
R3(config)#interface ethernet0/0
R3(config-if)#ip address 192.168.2.254 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface serial1/0
R3(config-if)#ip address 192.168.23.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#end
R3#
步驟2:檢查設(shè)備接口狀態(tài)
檢查PC1:
PC1> show ip
NAME??????? : PC1[1]
IP/MASK???? : 192.168.1.1/24
GATEWAY???? : 192.168.1.254
DNS???????? :
MAC???????? : 00:50:79:66:68:04
LPORT?????? : 20000
RHOST:PORT? : 127.0.0.1:30000
MTU???????? : 1500
檢查R1:
R1#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.1.254?? YES manual up??????????????????? up?????
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 192.168.12.1??? YES manual up??????????????????? up?????
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down???
檢查R2:
R2#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/1??????????? ????unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0?????????????? ???192.168.12.2??? YES manual up??????????????????? up?????
Serial1/1????????????????? 192.168.23.2??? YES manual up??????????????????? up?????
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3??????????????? ??unassigned????? YES unset? administratively down down
檢查R3:
R3#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.2.254?? YES manual up??????????????????? up? ????
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down ???
Serial1/0????????????????? 192.168.23.3??? YES manual up??????????????????? up?????
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2????????????????? unassigned????? YES unset? administratively down down? ??
Serial1/3????????????????? unassigned????? YES unset? administratively down down?
檢查PC2:
PC2> show ip
NAME??????? : PC2[1]
IP/MASK???? : 192.168.2.1/24
GATEWAY???? : 192.168.2.254
DNS???????? :
MAC???????? : 00:50:79:66:68:05
LPORT?????? : 20000
RHOST:PORT? : 127.0.0.1:30000
MTU???????? : 1500
步驟3:測試直連網(wǎng)絡(luò)的連通性
測試PC1跟網(wǎng)關(guān)的網(wǎng)絡(luò)連通性:
PC1> ping 192.168.1.254
84 bytes from 192.168.1.254 icmp_seq=1 ttl=255 time=0.359 ms
84 bytes from 192.168.1.254 icmp_seq=2 ttl=255 time=0.459 ms
84 bytes from 192.168.1.254 icmp_seq=3 ttl=255 time=0.463 ms
84 bytes from 192.168.1.254 icmp_seq=4 ttl=255 time=0.403 ms
84 bytes from 192.168.1.254 icmp_seq=5 ttl=255 time=0.417 ms
測試R1跟R2之間的網(wǎng)絡(luò)連通性:
R1#ping 192.168.12.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/9/10 ms
測試R2跟R3之間的網(wǎng)絡(luò)連通性:
R2#ping 192.168.23.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/9/11 ms
測試PC2跟網(wǎng)關(guān)的網(wǎng)絡(luò)連通性:
PC2> ping 192.168.2.254
84 bytes from 192.168.2.254 icmp_seq=1 ttl=255 time=0.469 ms
84 bytes from 192.168.2.254 icmp_seq=2 ttl=255 time=0.484 ms
84 bytes from 192.168.2.254 icmp_seq=3 ttl=255 time=0.518 ms
84 bytes from 192.168.2.254 icmp_seq=4 ttl=255 time=0.400 ms
84 bytes from 192.168.2.254 icmp_seq=5 ttl=255 time=0.405 ms
步驟4:配置EIGRP
配置R1:
R1(config)#router eigrp 100
R1(config-router)#network 172.16.1.0 0.0.0.255
R1(config-router)#network 172.16.2.0 0.0.0.255
R1(config-router)#network 172.16.3.0 0.0.0.255
R1(config-router)#network 192.168.1.0 0.0.0.255
R1(config-router)#network 192.168.12.0 0.0.0.255
R1(config-router)#end
R1#
配置R2:
R2(config)#router eigrp 100
R2(config-router)#network 192.168.12.0 0.0.0.255
R2(config-router)#network 192.168.23.0 0.0.0.255
R2(config-router)#end
R2#
配置R3:
R3(config)#router eigrp 100
R3(config-router)#network 192.168.23.0 0.0.0.255
R3(config-router)#network 192.168.2.0 0.0.0.255
R3(config-router)#end
R3#
步驟5:配置EIGRP手工匯總
配置R1:
R1(config)#interface serial 1/0
R1(config-if)#ip summary-address eigrp 100 172.16.0.0 255.255.0.0
R1(config-if)#end
R1#
步驟6:檢查EIGRP手工匯總
檢查R1:
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
????? 172.16.0.0/16 is variably subnetted, 7 subnets, 3 masks
D??????? 172.16.0.0/16 is a summary, 00:01:38, Null0
C??????? 172.16.1.0/24 is directly connected, Loopback1
L???? ???172.16.1.1/32 is directly connected, Loopback1
C??????? 172.16.2.0/24 is directly connected, Loopback2
L??????? 172.16.2.1/32 is directly connected, Loopback2
C??????? 172.16.3.0/24 is directly connected, Loopback3
L??????? 172.16.3.1/32 is directly connected, Loopback3
????? 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.1.0/24 is directly connected, Ethernet0/0
L??????? 192.168.1.254/32 is directly connected, Ethernet0/0
D???? 192.168.2.0/24 [90/2707456] via 192.168.12.2, 00:49:54, Serial1/0
????? 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.12.0/24 is directly connected, Serial1/0
L??????? 192.168.12.1/32 is directly connected, Serial1/0
D???? 192.168.23.0/24 [90/2681856] via 192.168.12.2, 00:50:33, Serial1/0
R1做完EIGRP手工匯總之后,本地會產(chǎn)生一條指向Null0的匯總路由,目的是防止環(huán)路。
檢查R2:
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
D???? 172.16.0.0/16 [90/2297856] via 192.168.12.1, 00:02:57, Serial1/0
D???? 192.168.1.0/24 [90/2195456] via 192.168.12.1, 00:52:14, Serial1/0
D???? 192.168.2.0/24 [90/2195456] via 192.168.23.3, 00:51:12, Serial1/1
????? 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.12.0/24 is directly connected, Serial1/0
L??????? 192.168.12.2/32 is directly connected, Serial1/0
????? 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.23.0/24 is directly connected, Serial1/1
L??????? 192.168.23.2/32 is directly connected, Serial1/1
R1收到了匯總路由。
檢查R3:
R3#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
????? 172.16.0.0/16 is subnetted, 1 subnets
D??????? 172.16.0.0 [90/2809856] via 192.168.23.2, 00:03:26, Serial1/0
D???? 192.168.1.0/24 [90/2707456] via 192.168.23.2, 00:51:49, Serial1/0
????? 192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.2.0/24 is directly connected, Ethernet0/0
L??????? 192.168.2.254/32 is directly connected, Ethernet0/0
D???? 192.168.12.0/24 [90/2681856] via 192.168.23.2, 00:51:49, Serial1/0
????? 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.23.0/24 is directly connected, Serial1/0
L??????? 192.168.23.3/32 is directly connected, Serial1/0
R3也收到了匯總路由。
實驗14:配置OSPF
實驗?zāi)康?/strong>
- 了解OSPF的運行原理
- 掌握OSPF的配置方法
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 分別在R1、R2、R3上創(chuàng)建Loopback0接口,IP地址分別是1.1.1.1/32、2.2.2/32、3.3.3.3/32,Loopback0地址作為OSPF的Router-ID;
- 根據(jù)實驗拓?fù)鋱D的區(qū)域劃分,在R1、R2、R3上配置OSPF,使得全網(wǎng)路由可達。
實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
VPCS> set pcname PC1?? //設(shè)置主機名
PC1> ip 192.168.1.1/24 192.168.1.254??? //設(shè)置IP地址與網(wǎng)關(guān)
配置PC2:
VPCS> set pcname PC2
PC2> ip 192.168.2.1/24 192.168.2.254
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface loopback0
R1(config-if)#ip address 1.1.1.1 255.255.255.255
R1(config-if)#exit
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface serial1/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface loopback0
R2(config-if)#ip address 2.2.2.2 255.255.255.255
R2(config-if)#exit
R2(config)#interface serial1/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface serial1/1
R2(config-if)#ip address 192.168.23.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
配置R3:
Router>enable
Router#configure terminal
Router(config)#hostname R3
R3(config)#no ip domain-lookup
R3(config)#line console 0
R3(config-line)#exec-timeout 0 0
R3(config-line)#logging synchronous
R3(config-line)#exit
R3(config)#interface loopback0
R3(config-if)#ip address 3.3.3.3 255.255.255.255
R3(config-if)#exit
R3(config)#interface ethernet0/0
R3(config-if)#ip address 192.168.2.254 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface serial1/0
R3(config-if)#ip address 192.168.23.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#end
R3#
步驟2:檢查設(shè)備接口狀態(tài)
檢查PC1:
PC1> show ip
NAME??????? : PC1[1]
IP/MASK???? : 192.168.1.1/24
GATEWAY???? : 192.168.1.254
DNS???????? :
MAC???????? : 00:50:79:66:68:04
LPORT?????? : 20000
RHOST:PORT? : 127.0.0.1:30000
MTU???????? : 1500
檢查R1:
R1#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.1.254?? YES manual up??????????????????? up?????
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 192.168.12.1??? YES manual up??????????????????? up?????
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down???
Loopback0????????????????? 1.1.1.1???????? YES manual up??????????????????? up????? ??
檢查R2:
R2#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 192.168.12.2??? YES manual up??????????????????? up?????
Serial1/1????????????????? 192.168.23.2??? YES manual up??????????????????? up?????
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down
Loopback0????????????????? 2.2.2.2???????? YES manual up??????????????????? up?????
檢查R3:
R3#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? 192.168.2.254?? YES manual up?? ?????????????????up?????
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 192.168.23.3??? YES manual up??????????????????? up?????
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down???
Loopback0????????????????? 3.3.3.3???????? YES manual up??????????????????? up?????
檢查PC2:
PC2> show ip
NAME??????? : PC2[1]
IP/MASK???? : 192.168.2.1/24
GATEWAY???? : 192.168.2.254
DNS???????? :
MAC???????? : 00:50:79:66:68:05
LPORT?????? : 20000
RHOST:PORT? : 127.0.0.1:30000
MTU???????? : 1500
步驟3:測試直連網(wǎng)絡(luò)的連通性
測試PC1跟網(wǎng)關(guān)的網(wǎng)絡(luò)連通性:
PC1> ping 192.168.1.254
84 bytes from 192.168.1.254 icmp_seq=1 ttl=255 time=0.359 ms
84 bytes from 192.168.1.254 icmp_seq=2 ttl=255 time=0.459 ms
84 bytes from 192.168.1.254 icmp_seq=3 ttl=255 time=0.463 ms
84 bytes from 192.168.1.254 icmp_seq=4 ttl=255 time=0.403 ms
84 bytes from 192.168.1.254 icmp_seq=5 ttl=255 time=0.417 ms
測試R1跟R2之間的網(wǎng)絡(luò)連通性:
R1#ping 192.168.12.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/9/10 ms
測試R2跟R3之間的網(wǎng)絡(luò)連通性:
R2#ping 192.168.23.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/9/11 ms
測試PC2跟網(wǎng)關(guān)的網(wǎng)絡(luò)連通性:
PC2> ping 192.168.2.254
84 bytes from 192.168.2.254 icmp_seq=1 ttl=255 time=0.469 ms
84 bytes from 192.168.2.254 icmp_seq=2 ttl=255 time=0.484 ms
84 bytes from 192.168.2.254 icmp_seq=3 ttl=255 time=0.518 ms
84 bytes from 192.168.2.254 icmp_seq=4 ttl=255 time=0.400 ms
- ytes from 192.168.2.254 icmp_seq=5 ttl=255 time=0.405 ms
步驟4:配置OSPF
配置R1:
R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 192.168.1.0 0.0.0.255 area 0
R1(config-router)#network 192.168.12.0 0.0.0.255 area 0
R1(config-router)#end
R1#
配置R2:
R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 192.168.12.0 0.0.0.255 area 0
R2(config-router)#network 192.168.23.0 0.0.0.255 area 1
R2(config-router)#end
R2#
配置R3:
R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 192.168.23.0 0.0.0.255 area 1
R3(config-router)#network 192.168.2.0 0.0.0.255 area 1
R3(config-router)#end
R3#
實驗檢查
步驟1:檢查OSPF鄰居
檢查R1:
R1#show ip ospf neighbor
Neighbor ID???? Pri?? State?????????? Dead Time?? Address???????? Interface
2.2.2.2?????????? 0?? FULL/? -??????? 00:00:31??? 192.168.12.2??? Serial1/0
Full是完全鄰接狀態(tài),是正常的狀態(tài)。
檢查R2:
R2#show ip ospf neighbor
Neighbor ID???? Pri?? State?????????? Dead Time?? Address???????? Interface
1.1.1.1?????????? 0?? FULL/? -??????? 00:00:31??? 192.168.12.1??? Serial1/0
3.3.3.3?????????? 0?? FULL/? -??????? 00:00:39??? 192.168.23.3??? Serial1/1
檢查R3:
R3#show ip ospf neighbor
Neighbor ID???? Pri?? State?????????? Dead Time?? Address???????? Interface
-
-
-
- ??????????0?? FULL/? -??????? 00:00:33??? 192.168.23.2??? Serial1/0
-
-
步驟2:檢查OSPF路由
檢查R1:
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
????? 1.0.0.0/32 is subnetted, 1 subnets
C??????? 1.1.1.1 is directly connected, Loopback0
????? 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.1.0/24 is directly connected, Ethernet0/0
L??????? 192.168.1.254/32 is directly connected, Ethernet0/0
O IA? 192.168.2.0/24 [110/138] via 192.168.12.2, 00:04:48, Serial1/0
????? 192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.12.0/24 is directly connected, Serial1/0
L??????? 192.168.12.1/32 is directly connected, Serial1/0
O IA? 192.168.23.0/24 [110/128] via 192.168.12.2, 00:06:10, Serial1/0
R1有兩條O IA的路由,O IA表示OSPF區(qū)域間的路由;
因為R1所有接口都是屬于Area 0,192.168.2.0/24和192.168.23.0/24都是屬于Area 1,所以通過R2跨區(qū)域傳遞給R1之后,就形成了O IA路由。
檢查R2:
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
????? 2.0.0.0/32 is subnetted, 1 subnets
C??????? 2.2.2.2 is directly connected, Loopback0
O???? 192.168.1.0/24 [110/74] via 192.168.12.1, 00:09:55, Serial1/0
O???? 192.168.2.0/24 [110/74] via 192.168.23.3, 00:08:24, Serial1/1
? ????192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.12.0/24 is directly connected, Serial1/0
L??????? 192.168.12.2/32 is directly connected, Serial1/0
????? 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.23.0/24 is directly connected, Serial1/1
L??????? 192.168.23.2/32 is directly connected, Serial1/1
因為R1既有接口屬于Area 0,也有接口屬于Area 1;
所以R1的路由表看到的都是O路由,O表示OSPF區(qū)域內(nèi)的路由。
實驗15:配置標(biāo)準(zhǔn)ACL
實驗?zāi)康?/strong>
-
- 理解標(biāo)準(zhǔn)ACL的應(yīng)用
- 掌握標(biāo)準(zhǔn)ACL的配置
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 配置靜態(tài)路由,使得全網(wǎng)路由可達;
- 在R3上部署ACL,只允許192.168.1.0/24和192.168.2.0/24網(wǎng)段的用戶訪問PC3。
實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
Router>enable
Router#configure terminal
Router(config)#hostname PC1
PC1(config)#no ip routing
PC1(config)#ip default-gateway 192.168.1.254
PC1(config)#interface ethernet0/0
PC1(config-if)#ip address 192.168.1.1 255.255.255.0
PC1(config-if)#no shutdown
PC1(config-if)#end
PC1#
配置PC2:
Router>enable
Router#configure terminal
Router(config)#hostname PC2
PC2(config)#no ip routing
PC2(config)#ip default-gateway 192.168.2.254
PC2(config)#interface ethernet0/0
PC2(config-if)#ip address 192.168.2.1 255.255.255.0
PC2(config-if)#no shutdown
PC2(config-if)#end
PC2#
配置PC3:
Router>enable
Router#configure terminal
Router(config)#hostname PC3
PC3(config)#no ip routing
PC3(config)#ip default-gateway 192.168.3.254
PC3(config)#interface ethernet0/0
PC3(config-if)#ip address 192.168.3.1 255.255.255.0
PC3(config-if)#no shutdown
PC3(config-if)#end
PC3#
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface serial1/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface serial1/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface serial1/1
R2(config-if)#ip address 192.168.23.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface ethernet0/0
R2(config-if)#ip address 192.168.2.254 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
配置R3:
Router>enable
Router#configure terminal
Router(config)#hostname R3
R3(config)#no ip domain-lookup
R3(config)#line console 0
R3(config-line)#exec-timeout 0 0
R3(config-line)#logging synchronous
R3(config-line)#exit
R3(config)#interface ethernet0/0
R3(config-if)#ip address 192.168.3.254 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface serial1/0
R3(config-if)#ip address 192.168.23.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#end
R3#
步驟2:配置靜態(tài)路由
配置R1:
R1(config)#ip route 192.168.2.0 255.255.255.0 192.168.12.2
R1(config)#ip route 192.168.3.0 255.255.255.0 192.168.12.2
R1(config)#ip route 192.168.23.0 255.255.255.0 192.168.12.2
配置R2:
R2(config)#ip route 192.168.1.0 255.255.255.0 serial1/0
R2(config)#ip route 192.168.3.0 255.255.255.0 serial1/1
配置R3:
R3(config)#ip route 192.168.1.0 255.255.255.0 192.168.23.2
R3(config)#ip route 192.168.2.0 255.255.255.0 192.168.23.2
R3(config)#ip route 192.168.12.0 255.255.255.0 192.168.23.2
這個時候任何一個網(wǎng)段都能訪問PC3。
測試PC1訪問PC3:
PC1#ping 192.168.3.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 19/20/22 ms
測試PC2訪問PC3:
PC2#ping 192.168.3.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 10/10/11 ms
測試R1訪問PC3:
R1#ping 192.168.3.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/19/22 ms
步驟3:配置標(biāo)準(zhǔn)ACL
配置R3
R3(config)#access-list 1 permit 192.168.1.0 0.0.0.255
R3(config)#access-list 1 permit 192.168.2.0 0.0.0.255
R3(config)#interface serial1/0
R3(config-if)#ip access-group 1 in
R3(config-if)#end
R3#
這個時候除了192.168.1.0/24和192.168.2.0/24網(wǎng)段,其他網(wǎng)段就訪問不了了。
測試PC1訪問PC3:
PC1#ping 192.168.3.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 19/20/22 ms
測試PC2訪問PC3:
PC2#ping 192.168.3.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 10/10/11 ms
測試R1訪問PC3:
R1#ping 192.168.3.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
U.U.U
Success rate is 0 percent (0/5)
被ACL拒絕了。
實驗16:配置擴展ACL
實驗?zāi)康?/strong>
- 理解擴展ACL的應(yīng)用
- 掌握擴展ACL的配置
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 配置EIGRP,使得全網(wǎng)路由可達;
- 在R3上部署ACL,只允許192.168.1.0/24網(wǎng)段的用戶Ping PC3;
- 在R3上部署ACL,只允許192.168.2.0/24網(wǎng)段的用戶Telnet PC3。
實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
Router>enable
Router#configure terminal
Router(config)#hostname PC1
PC1(config)#no ip routing
PC1(config)#ip default-gateway 192.168.1.254
PC1(config)#interface ethernet0/0
PC1(config-if)#ip address 192.168.1.1 255.255.255.0
PC1(config-if)#no shutdown
PC1(config-if)#end
PC1#
配置PC2:
Router>enable
Router#configure terminal
Router(config)#hostname PC2
PC2(config)#no ip routing
PC2(config)#ip default-gateway 192.168.2.254
PC2(config)#interface ethernet0/0
PC2(config-if)#ip address 192.168.2.1 255.255.255.0
PC2(config-if)#no shutdown
PC2(config-if)#end
PC2#
配置PC3:
Router>enable
Router#configure terminal
Router(config)#hostname PC3
PC3(config)#no ip routing
PC3(config)#line vty 0 4
PC3(config-line)#password xmws
PC3(config-line)#login
PC3(config-line)#transport input telnet
PC3(config-line)#exit
PC3(config)#ip default-gateway 192.168.3.254
PC3(config)#interface ethernet0/0
PC3(config-if)#ip address 192.168.3.1 255.255.255.0
PC3(config-if)#no shutdown
PC3(config-if)#end
PC3#
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface serial1/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface serial1/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface serial1/1
R2(config-if)#ip address 192.168.23.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface ethernet0/0
R2(config-if)#ip address 192.168.2.254 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
配置R3:
Router>enable
Router#configure terminal
Router(config)#hostname R3
R3(config)#no ip domain-lookup
R3(config)#line console 0
R3(config-line)#exec-timeout 0 0
R3(config-line)#logging synchronous
R3(config-line)#exit
R3(config)#interface ethernet0/0
R3(config-if)#ip address 192.168.3.254 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface serial1/0
R3(config-if)#ip address 192.168.23.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#end
R3#
步驟2:配置靜態(tài)路由
配置R1:
R1(config)#ip route 192.168.2.0 255.255.255.0 192.168.12.2
R1(config)#ip route 192.168.3.0 255.255.255.0 192.168.12.2
R1(config)#ip route 192.168.23.0 255.255.255.0 192.168.12.2
配置R2:
R2(config)#ip route 192.168.1.0 255.255.255.0 serial1/0
R2(config)#ip route 192.168.3.0 255.255.255.0 serial1/1
配置R3:
R3(config)#ip route 192.168.1.0 255.255.255.0 192.168.23.2
R3(config)#ip route 192.168.2.0 255.255.255.0 192.168.23.2
R3(config)#ip route 192.168.12.0 255.255.255.0 192.168.23.2
這個時候任何一個網(wǎng)段都能訪問PC3。
測試PC1 ping PC3:
PC1#ping 192.168.3.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 19/20/22 ms
測試PC1 telnet PC3:
PC1#telnet 192.168.3.1
Trying 192.168.3.1 ... Open
User Access Verification
Password:
PC3>
測試PC2 ping PC3:
PC2#ping 192.168.3.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 10/10/11 ms
測試PC2 telnet PC3:
PC1#telnet 192.168.3.1
Trying 192.168.3.1 ... Open
User Access Verification
Password:
PC3>
步驟3:配置擴展ACL
配置R3:
R3(config)#access-list 101 permit icmp 192.168.1.0 0.0.0.255 host 192.168.3.1
R3(config)#access-list 101 permit tcp 192.168.2.0 0.0.0.255 host 192.168.3.1 eq 23
R3(config)#interface serial 1/0
R3(config-if)#ip access-group 101 in
R3(config-if)#end
R3#
這個時候只有PC1能Ping PC3,PC2能Telnet PC3。
測試PC1 ping PC3:
PC1#ping 192.168.3.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 19/20/22 ms
測試PC1 telnet PC3:
PC1#telnet 192.168.3.1
Trying 192.168.3.1 ...
% Destination unreachable; gateway or host down
PC1#
測試PC2 ping PC3:
PC2#ping 192.168.3.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
U.U.U
Success rate is 0 percent (0/5)
測試PC2 telnet PC3:
PC1#telnet 192.168.3.1
Trying 192.168.3.1 ... Open
User Access Verification
Password:
PC3>
實驗17:配置靜態(tài)NAT
實驗?zāi)康?/strong>
- 理解靜態(tài)NAT的轉(zhuǎn)換原理
- 掌握靜態(tài)NAT的配置方法
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 在R2上創(chuàng)建Loopback0接口,IP地址是9.6.7/32,模擬公網(wǎng)上的一臺服務(wù)器;
- 在R1上配置靜態(tài)NAT,PC1訪問服務(wù)器使用12.1.1.11轉(zhuǎn)換源地址;
- 在R1上配置靜態(tài)NAT,PC2訪問服務(wù)器使用12.1.1.12轉(zhuǎn)換源地址。
實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
Router>enable
Router#configure terminal
Router(config)#hostname PC1
PC1(config)#no ip routing
PC1(config)#ip default-gateway 192.168.1.254
PC1(config)#interface ethernet0/0
PC1(config-if)#ip address 192.168.1.1 255.255.255.0
PC1(config-if)#no shutdown
PC1(config-if)#end
PC1#
配置PC2:
Router>enable
Router#configure terminal
Router(config)#hostname PC2
PC2(config)#no ip routing
PC2(config)#ip default-gateway 192.168.1.254
PC2(config)#interface ethernet0/0
PC2(config-if)#ip address 192.168.1.2 255.255.255.0
PC2(config-if)#no shutdown
PC2(config-if)#end
PC2#
配置SW1:
Switch>ena
Switch#conf t
Switch(config)#no ip domain-lookup
Switch(config)#line console 0
Switch(config-line)# logging s
Switch(config-line)# exec-t 0 0
Switch(config-line)# exit
Switch(config)#hostname SW1
SW1(config)#end
SW1#
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface ethernet0/1
R1(config-if)#ip address 12.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface loopback0
R2(config-if)#ip address 9.2.6.7 255.255.255.255
R2(config-if)#exit
R2(config)#interface ethernet0/0
R2(config-if)#ip address 12.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
步驟2:配置靜態(tài)NAT
配置R1:
R1(config)#ip nat inside source static 192.168.1.1 12.1.1.11?? //配置靜態(tài)轉(zhuǎn)換
R1(config)#ip nat inside source static 192.168.1.2 12.1.1.12?? //配置靜態(tài)轉(zhuǎn)換
R1(config)#interface ethernet 0/0
R1(config-if)#ip nat inside?? //指定inside接口
R1(config-if)#exit
R1(config)#interface ethernet 0/1
R1(config-if)#ip nat outside?? //指定outside接口
R1(config-if)#exit
R1(config)#ip route 0.0.0.0 0.0.0.0 12.1.1.2?? //配置到達公網(wǎng)的默認(rèn)路由
R1(config)#end
R1#
檢查R1的NAT表項:
R1#show ip nat translations
Pro Inside global????? Inside local?????? Outside local????? Outside global
--- 12.1.1.11????????? 192.168.1.1??????? ---??????????????? ---
--- 12.1.1.12????????? 192.168.1.2??????? ---??????????????? ---
R1的NAT映射表創(chuàng)建了兩個靜態(tài)NAT條目。
測試PC1訪問服務(wù)器:
PC1#ping 9.2.6.7
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 9.2.6.7, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
測試PC2訪問服務(wù)器:
PC2#ping 9.2.6.7
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 9.2.6.7, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
檢查R1的NAT表項:
R1#sh ip nat translations
Pro Inside global????? Inside local?????? Outside local???? ?Outside global
icmp 12.1.1.11:4?????? 192.168.1.1:4????? 9.2.6.7:4????????? 9.2.6.7:4
--- 12.1.1.11????????? 192.168.1.1??????? ---??????????????? ---
icmp 12.1.1.12:2?????? 192.168.1.2:2????? 9.2.6.7:2????????? 9.2.6.7:2
--- 12.1.1.12????????? 192.168.1.2??????? ---??????????????? ---
實驗18:配置動態(tài)NAT
實驗?zāi)康?/strong>
- 理解動態(tài)NAT的轉(zhuǎn)換原理
- 掌握動態(tài)NAT的配置方法
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 在R2上創(chuàng)建Loopback0接口,IP地址是9.6.7/32,模擬公網(wǎng)上的一臺服務(wù)器;
- 在R1上配置動態(tài)NAT,地址池范圍為12.1.1.11~12.1.1.20,使得PC1和PC2能夠訪問公網(wǎng)服務(wù)器。
實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
Router>enable
Router#configure terminal
Router(config)#hostname PC1
PC1(config)#no ip routing
PC1(config)#ip default-gateway 192.168.1.254
PC1(config)#interface ethernet0/0
PC1(config-if)#ip address 192.168.1.1 255.255.255.0
PC1(config-if)#no shutdown
PC1(config-if)#end
PC1#
配置PC2:
Router>enable
Router#configure terminal
Router(config)#hostname PC2
PC2(config)#no ip routing
PC2(config)#ip default-gateway 192.168.1.254
PC2(config)#interface ethernet0/0
PC2(config-if)#ip address 192.168.1.2 255.255.255.0
PC2(config-if)#no shutdown
PC2(config-if)#end
PC2#
配置SW1:
Switch>ena
Switch#conf t
Switch(config)#no ip domain-lookup
Switch(config)#line console 0
Switch(config-line)# logging s
Switch(config-line)# exec-t 0 0
Switch(config-line)# exit
Switch(config)#hostname SW1
SW1(config)#end
SW1#
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface ethernet0/1
R1(config-if)#ip address 12.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface loopback0
R2(config-if)#ip address 9.2.6.7 255.255.255.255
R2(config-if)#exit
R2(config)#interface ethernet0/0
R2(config-if)#ip address 12.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
步驟2:配置動態(tài)NAT
配置R1:
R1(config)#ip nat pool xmws 12.1.1.11 12.1.1.20 netmask 255.255.255.0?? //創(chuàng)建地址池
R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255?? //通過ACL定義哪些子網(wǎng)能做NAT
R1(config)#ip nat inside source list 1 pool xmws?? //關(guān)聯(lián)ALC和地址池
R1(config)#interface ethernet 0/0
R1(config-if)#ip nat inside?? //指定inside接口
R1(config-if)#exit
R1(config)#interface ethernet 0/1
R1(config-if)#ip nat outside?? //指定outside接口
R1(config-if)#exit
R1(config)#ip route 0.0.0.0 0.0.0.0 12.1.1.2?? //配置到達公網(wǎng)的默認(rèn)路由
測試PC1訪問服務(wù)器:
PC1#ping 9.2.6.7
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 9.2.6.7, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
測試PC2訪問服務(wù)器:
PC2#ping 9.2.6.7
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 9.2.6.7, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
檢查R1的NAT表項:
R1#show ip nat translations
Pro Inside global????? Inside local?????? Outside local????? Outside global
icmp 12.1.1.12:6?????? 192.168.1.1:6????? 9.2.6.7:6????????? 9.2.6.7:6
--- 12.1.1.12????????? 192.168.1.1??????? ---??????????????? ---
icmp 12.1.1.13:4?????? 192.168.1.2:4????? 9.2.6.7:4????????? 9.2.6.7:4
--- 12.1.1.13????????? 192.168.1.2??????? ---??????????????? ---
實驗19:配置PAT
實驗?zāi)康?/strong>
- 理解PAT的轉(zhuǎn)換原理
- 掌握PAT的配置方法
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 在R2上創(chuàng)建Loopback0接口,IP地址是9.6.7/32,模擬公網(wǎng)上的一臺服務(wù)器;
- 在R1上配置PAT,使得PC1和PC2能夠復(fù)用E0/1接口地址訪問公網(wǎng)服務(wù)器。
實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
Router>enable
Router#configure terminal
Router(config)#hostname PC1
PC1(config)#no ip routing
PC1(config)#ip default-gateway 192.168.1.254
PC1(config)#interface ethernet0/0
PC1(config-if)#ip address 192.168.1.1 255.255.255.0
PC1(config-if)#no shutdown
PC1(config-if)#end
PC1#
配置PC2:
Router>enable
Router#configure terminal
Router(config)#hostname PC2
PC2(config)#no ip routing
PC2(config)#ip default-gateway 192.168.1.254
PC2(config)#interface ethernet0/0
PC2(config-if)#ip address 192.168.1.2 255.255.255.0
PC2(config-if)#no shutdown
PC2(config-if)#end
PC2#
配置SW1:
Switch>ena
Switch#conf t
Switch(config)#no ip domain-lookup
Switch(config)#line console 0
Switch(config-line)# logging s
Switch(config-line)# exec-t 0 0
Switch(config-line)# exit
Switch(config)#hostname SW1
SW1(config)#end
SW1#
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface ethernet0/1
R1(config-if)#ip address 12.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface loopback0
R2(config-if)#ip address 9.2.6.7 255.255.255.255
R2(config-if)#exit
R2(config)#interface ethernet0/0
R2(config-if)#ip address 12.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
步驟2:配置PAT
配置R1:
R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255?? //定義ACL
R1(config)#ip nat inside source list 1 interface ethernet 0/1 overload?? //關(guān)聯(lián)ACL和outside接口
R1(config)#interface ethernet 0/0
R1(config-if)#ip nat inside?? //指定inside接口
R1(config-if)#exit
R1(config)#interface ethernet 0/1
R1(config-if)#ip nat outside?? //指定outside接口
R1(config-if)#exit
R1(config)#ip route 0.0.0.0 0.0.0.0 12.1.1.2?? //配置到達公網(wǎng)的默認(rèn)路由
測試PC1訪問服務(wù)器:
PC1#ping 9.2.6.7
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 9.2.6.7, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
測試PC2訪問服務(wù)器:
PC2#ping 9.2.6.7
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 9.2.6.7, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
檢查R1的NAT表項:
R1#show ip nat translations
Pro Inside global????? Inside local?????? Outside local????? Outside global
icmp 12.1.1.1:7??????? 192.168.1.1:7?? ???9.2.6.7:7????????? 9.2.6.7:7
icmp 12.1.1.1:5??????? 192.168.1.2:5????? 9.2.6.7:5????????? 9.2.6.7:5
Inside global都是12.1.1.1,通過端口號區(qū)分不同的主機。
實驗20:配置靜態(tài)PAT
實驗?zāi)康?/strong>
- 理解靜態(tài)PAT的轉(zhuǎn)換原理
- 掌握靜態(tài)PAT的配置方法
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 在R2上創(chuàng)建Loopback0接口,IP地址是9.6.7/32,模擬公網(wǎng)上的一臺服務(wù)器;
- 在R1上配置靜態(tài)PAT,使得Internet用戶能夠訪問PC1的Telnet服務(wù);
- 在R1上配置靜態(tài)PAT,使得Internet用戶能夠訪問PC2的Web服務(wù)。
實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
Router>enable
Router#configure terminal
Router(config)#hostname PC1
PC1(config)#line vty 0 4?? //進入VTY
PC1(config-line)#password xmws?? //設(shè)置VTY密碼
PC1(config-line)#login?? //啟用密碼
PC1(config-line)#transport input telnet?? //允許Telnet遠(yuǎn)程登錄
PC1(config-line)#exit
PC1(config)#no ip routing
PC1(config)#ip default-gateway 192.168.1.254
PC1(config)#interface ethernet0/0
PC1(config-if)#ip address 192.168.1.1 255.255.255.0
PC1(config-if)#no shutdown
PC1(config-if)#end
PC1#
配置PC2:
Router>enable
Router#configure terminal
Router(config)#hostname PC2
PC2(config)#no ip routing
PC2(config)#ip http server?? //開啟HTTP服務(wù)
PC2(config)#ip default-gateway 192.168.1.254
PC2(config)#interface ethernet0/0
PC2(config-if)#ip address 192.168.1.2 255.255.255.0
PC2(config-if)#no shutdown
PC2(config-if)#end
PC2#
配置SW1:
Switch>ena
Switch#conf t
Switch(config)#no ip domain-lookup
Switch(config)#line console 0
Switch(config-line)# logging s
Switch(config-line)# exec-t 0 0
Switch(config-line)# exit
Switch(config)#hostname SW1
SW1(config)#end
SW1#
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface ethernet0/1
R1(config-if)#ip address 12.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface loopback0
R2(config-if)#ip address 9.2.6.7 255.255.255.255
R2(config-if)#exit
R2(config)#interface ethernet0/0
R2(config-if)#ip address 12.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
步驟2:配置動態(tài)NAT
配置R1:
R1(config)#ip nat inside source static tcp 192.168.1.1 23 12.1.1.1 23?? //創(chuàng)建靜態(tài)映射
R1(config)#ip nat inside source static tcp 192.168.1.2 80 12.1.1.1 80?? //創(chuàng)建靜態(tài)映射
R1(config)#interface ethernet 0/0
R1(config-if)#ip nat inside?? //指定inside接口
R1(config-if)#exit
R1(config)#interface ethernet 0/1
R1(config-if)#ip nat outside?? //指定outside接口
R1(config-if)#exit
R1(config)#ip route 0.0.0.0 0.0.0.0 12.1.1.2?? //定義到達公網(wǎng)的默認(rèn)路由
檢查R1的NAT表項:
R1#show ip nat translations
Pro Inside global????? Inside local?????? Outside local????? Outside global
tcp 12.1.1.1:23??????? 192.168.1.1:23???? ---??????????????? ---
tcp 12.1.1.1:80??????? 192.168.1.2:80???? ---??????????????? ---
因為是靜態(tài)PAT,所以即使沒有流量,NAT轉(zhuǎn)換表也有條目。
在R2上測試Telnet服務(wù):
R2#telnet 12.1.1.1
Trying 12.1.1.1 ... Open
User Access Verification
Password:
PC1>
PC1的Telnet服務(wù)發(fā)布成功。
在R2上測試Web服務(wù):
R2#telnet 12.1.1.1 80
Trying 12.1.1.1, 80 ... Open
PC2的Web服務(wù)發(fā)布成功。
檢查R1的NAT表項:
R1#show ip nat translations
Pro Inside global????? Inside local?????? Outside local????? Outside global
tcp 12.1.1.1:23??????? 192.168.1.1:23???? 12.1.1.2:64490???? 12.1.1.2:64490
tcp 12.1.1.1:23??????? 192.168.1.1:23???? ---??????????????? ---
tcp 12.1.1.1:80??????? 192.168.1.2:80???? 12.1.1.2:36455???? 12.1.1.2:36455
tcp 12.1.1.1:80??????? 192.168.1.2:80???? ---??????????????? ---
有流量觸發(fā)之后,NAT轉(zhuǎn)換表多出兩個動態(tài)條目。
實驗21:配置PAP單向認(rèn)證
實驗?zāi)康?/strong>
- 理解PAP認(rèn)證的原理
- 掌握PAP認(rèn)證的配置
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 在R1和R2之間做PAP單向認(rèn)證,R1是認(rèn)證方,R2是被認(rèn)證方。
實驗步驟
步驟1:設(shè)備的基本配置
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface serial1/0
R1(config-if)#ip address 12.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface serial1/0
R2(config-if)#ip address 12.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
步驟2:配置PAP認(rèn)證
配置R1:
R1(config)#interface serial 1/0
R1(config-if)#encapsulation ppp?? //封裝PPP
R1(config-if)#ppp authentication pap?? //啟用PAP認(rèn)證
R1(config-if)#exit
R1(config)#username xmws password wisdom?? //創(chuàng)建用戶名和密碼
R1(config)#end
R1#
配置R2:
R2(config)#interface serial 1/0
R2(config-if)#encapsulation ppp?? //封裝PPP
R2(config-if)#ppp pap sent-username xmws password wisdom?? //PAP發(fā)送的用戶名和密碼
R2(config-if)#end
R2#
步驟3:檢查PAP認(rèn)證
檢查R1:
R1#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 12.1.1.1??????? YES manual up??????????????????? up?????
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3 ?????????????????unassigned????? YES unset? administratively down down
檢查R2:
R2#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 12.1.1.2??????? YES manual up??????????????????? up?????
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down
實驗22:配置PAP雙向認(rèn)證
實驗?zāi)康?/strong>
- 理解PAP認(rèn)證的原理
- 掌握PAP認(rèn)證的配置
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 在R1和R2之間做PAP的雙向認(rèn)證。
實驗步驟
步驟1:設(shè)備的基本配置
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface serial1/0
R1(config-if)#ip address 12.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface serial1/0
R2(config-if)#ip address 12.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
步驟2:配置PAP認(rèn)證
配置R1:
R1(config)#interface serial 1/0
R1(config-if)#encapsulation ppp?? //封裝PPP
R1(config-if)#ppp authentication pap?? //啟用PAP認(rèn)證
R1(config-if)#ppp pap sent-username R1 password xmws?? //PAP發(fā)送的用戶名和密碼
R1(config-if)#exit
R1(config)#username R2 password xmws?? //創(chuàng)建用戶名和密碼
R1(config)#end
R1#
配置R2:
R2(config)#interface serial 1/0
R2(config-if)#encapsulation ppp?? //封裝PPP
R2(config-if)#ppp authentication pap?? //啟用PAP認(rèn)證
R2(config-if)#ppp pap sent-username R2 password xmws?? //PAP發(fā)送的用戶名和密碼
R2(config-if)#exit
R2(config)#username R1 password xmws?? //創(chuàng)建用戶名和密碼
R2(config)#end
R2#
步驟3:檢查PAP認(rèn)證
檢查R1:
R1#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down ???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 12.1.1.1??????? YES manual up??????????????????? up??? ??
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down?? ?
檢查R2:
R2#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 12.1.1.2??????? YES manual up??????????????????? up?????
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down
實驗23:配置CHAP單向認(rèn)證
實驗?zāi)康?/strong>
- 理解CHAP認(rèn)證的原理
- 掌握CHAP認(rèn)證的配置
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 在R1和R2之間做CHAP單向認(rèn)證,R1是認(rèn)證方,R2是被認(rèn)證方。
實驗步驟
步驟1:設(shè)備的基本配置
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface serial1/0
R1(config-if)#ip address 12.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface serial1/0
R2(config-if)#ip address 12.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
步驟2:配置CHAP認(rèn)證
配置R1:
R1(config)#interface serial 1/0
R1(config-if)#encapsulation ppp?? //封裝PPP
R1(config-if)#ppp authentication chap?? //啟用CHAP認(rèn)證
R1(config-if)#exit
R1(config)#username xmws password wisdom?? //創(chuàng)建用戶名和密碼
R1(config)#end
R1#
配置R2:
R2(config)#interface serial 1/0
R2(config-if)#encapsulation ppp?? //封裝PPP
R2(config-if)#ppp chap hostname xmws?? //CHAP認(rèn)證的用戶名
R2(config-if)#ppp chap password wisdom?? //CHAP認(rèn)證的密碼
R2(config-if)#end
R2#
步驟3:檢查:CHAP認(rèn)證
檢查R1:
R1#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/1??? ????????????unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0?????? ???????????12.1.1.1??????? YES manual up??????????????????? up?????
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3??????? ??????????unassigned????? YES unset? administratively down down???
檢查R2:
R2#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 12.1.1.2??????? YES manual up??????????????????? up?????
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down
實驗24:配置CHAP雙向認(rèn)證
實驗?zāi)康?/strong>
- 理解CHAP認(rèn)證的原理
- 掌握CHAP認(rèn)證的配置
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 在R1和R2之間做CHAP的雙向認(rèn)證。
實驗步驟
步驟1:設(shè)備的基本配置
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface serial1/0
R1(config-if)#ip address 12.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface serial1/0
R2(config-if)#ip address 12.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
步驟2:配置CHAP認(rèn)證
配置R1:
R1(config)#interface serial 1/0
R1(config-if)#encapsulation ppp?? //封裝PPP
R1(config-if)#ppp authentication chap?? //啟用CHAP認(rèn)證
R1(config-if)#exit
R1(config)#username R2 password xmws?? //創(chuàng)建用戶名和密碼
R1(config)#end
R1#
配置R2:
R2(config)#interface serial 1/0
R2(config-if)#encapsulation ppp?? //封裝PPP
R2(config-if)#ppp authentication chap?? //啟用CHAP認(rèn)證
R2(config-if)#exit
R2(config)#username R1 password xmws?? //創(chuàng)建用戶名和密碼
R2(config-if)#end
R2#
步驟3:檢查CHAP認(rèn)證
檢查R1:
R1#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? unassigned?? ???YES unset? administratively down down???
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned??? ??YES unset? administratively down down???
Serial1/0????????????????? 12.1.1.1??????? YES manual up??????????????????? up?????
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2????????????????? unassigned???? ?YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down???
檢查R2:
R2#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/1??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/2??????????????? unassigned????? YES unset? administratively down down???
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? 12.1.1.2??????? YES manual up??????????????????? up?????
Serial1/1????????????????? unassigned????? YES unset? administratively down down???
Serial1/2 ?????????????????unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down
實驗25:配置PPPoE
實驗?zāi)康?/strong>
- 理解PPPoE的原理
- 掌握PPPoE的配置
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- R1是PPPoE服務(wù)器,R2是PPPoE客戶端,R2去R1認(rèn)證并獲得IP地址。
實驗步驟
步驟1:設(shè)備的基本配置
配置PC1:
VPCS> set pcname PC1?? //設(shè)置主機名
PC1> ip 192.168.1.1/24 192.168.1.254?? //設(shè)置IP地址與默認(rèn)網(wǎng)關(guān)
配置PC2:
VPCS> set pcname PC2?? //設(shè)置主機名
PC2> ip 192.168.2.1/24 192.168.2.254?? //設(shè)置IP地址與默認(rèn)網(wǎng)關(guān)
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface Eth0/1
R2(config-if)#ip address 192.168.1.254 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface Eth0/2
R2(config-if)#ip address 192.168.2.254 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
步驟2:配置PPPoE
配置R1:
R1(config)#username xmws password wisdom
R1(config)#bba-group pppoe ToR2
R1(config-bba-group)#virtual-template 1
R1(config-bba-group)#exit
R1(config)#interface ethernet0/0
R1(config-if)#pppoe enable group ToR2
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface virtual-template 1
R1(config-if)#ip address 12.1.1.1 255.255.255.252
R1(config-if)#ip mtu 1492
R1(config-if)#peer default ip address pool PoR2
R1(config-if)#ppp authentication chap
R1(config-if)#exit
R1(config)#ip local pool PoR2 12.1.1.2
R1(config)#end
R1#
配置R2:
R2(config)#interface ethernet0/0
R2(config-if)#pppoe enable
R2(config-if)#pppoe-client dial-pool-number 1
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface dialer 1??
R2(config-if)#ip mtu 1492
R2(config-if)#dialer pool 1
R2(config-if)#ip address negotiated
R2(config-if)#encapsulation ppp
R2(config-if)#ppp ipcp route default
R2(config-if)#ppp chap hostname xmws
R2(config-if)#ppp chap password wisdom
R2(config-if)#end
R2#
步驟3:檢查PPPoE
檢查R2:
R2#show ip interface brief
Interface????????????????? IP-Address????? OK? Method Status??????????????? Protocol
Ethernet0/0??????????????? unassigned????? YES unset? up??????????????????? up?????
Ethernet0/1??????????????? 192.168.1.254?? YES manual up??????????????????? up?????
Ethernet0/2??????????????? 192.168.2.254?? YES manual up??????????????????? up??? ??
Ethernet0/3??????????????? unassigned????? YES unset? administratively down down???
Serial1/0????????????????? unassigned????? YES unset? administratively down down???
Serial1/1????????????????? unassigned????? YES unset? administratively down down?? ?
Serial1/2????????????????? unassigned????? YES unset? administratively down down???
Serial1/3????????????????? unassigned????? YES unset? administratively down down???
Dialer1??????????????????? 12.1.1.2??????? YES IPCP?? up??????????????????? up?????
Virtual-Access1??????????? unassigned????? YES unset? up??????????????????? up?????
Virtual-Access2??????????? unassigned????? YES unset? up??????????????????? up?
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
?????? a - application route
?????? + - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is 12.1.1.1 to network 0.0.0.0
S*??? 0.0.0.0/0 [1/0] via 12.1.1.1
????? 12.0.0.0/32 is subnetted, 2 subnets
C??????? 12.1.1.1 is directly connected, Dialer1
C??????? 12.1.1.2 is directly connected, Dialer1
????? 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.1.0/24 is directly connected, Ethernet0/1
L??????? 192.168.1.254/32 is directly connected, Ethernet0/1
????? 192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C??????? 192.168.2.0/24 is directly connected, Ethernet0/2
L??????? 192.168.2.254/32 is directly connected, Ethernet0/2
R2#show interfaces dialer 1
Dialer1 is up, line protocol is up (spoofing)
? Hardware is Unknown
? Internet address is 12.1.1.2/32
? MTU 1492 bytes, BW 56 Kbit/sec, DLY 20000 usec,
???? reliability 255/255, txload 1/255, rxload 1/255
? Encapsulation PPP, LCP Closed, loopback not set
? Keepalive set (10 sec)
? DTR is pulsed for 1 seconds on reset
? Interface is bound to Vi2
? Last input never, output never, output hang never
? Last clearing of "show interface" counters 00:20:57
? Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
? Queueing strategy: fifo
? Output queue: 0/40 (size/max)
? 5 minute input rate 0 bits/sec, 0 packets/sec
? 5 minute output rate 0 bits/sec, 0 packets/sec
???? 6 packets input, 84 bytes
???? 250 packets output, 3500 bytes
Bound to:
Virtual-Access2 is up, line protocol is up
? Hardware is Virtual Access interface
? MTU 1492 bytes, BW 56 Kbit/sec, DLY 20000 usec,
???? reliability 255/255, txload 1/255, rxload 1/255
?--More--
實驗26:配置IPv6地址與路由
實驗?zāi)康?/strong>
- 掌握IPv6地址的配置方法
- 掌握IPv6靜態(tài)路由的配置方法
- 掌握IPv6默認(rèn)路由的配置方法???????
實驗拓?fù)?/strong>
實驗需求
- 根據(jù)實驗拓?fù)鋱D,完成設(shè)備的基本配置;
- 在R2上配置IPv6靜態(tài)路由,使得R2能夠訪問R1的Loopback0;
- 在R1上配置IPv6默認(rèn)路由,使得R1能夠訪問R2的Loopback0。
實驗步驟
步驟1:設(shè)備的基本配置
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface loopback 0
R1(config-if)#ipv6 address 2001:9267:1:1::1/64
R1(config-if)#exit
R1(config)#interface ethernet0/0
R1(config-if)#ipv6 address 2001:9267:12::1/64
R1(config-if)#no shutdown
R1(config-if)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface loopback 0
R2(config-if)#ipv6 address 2001:9267:2:2::2/64
R2(config-if)#exit
R2(config)#interface ethernet0/0
R2(config-if)#ipv6 address 2001:9267:12::2/64
R2(config-if)#no shutdown
R2(config-if)#end
R2#
步驟2:配置IPv6靜態(tài)路由
配置R1:
R1(config)#ipv6 route ::/0 2001:9267:12::2
R1(config)#end
R1#
配置R2:
R2(config)#ipv6 route 2001:9267:1:1::/64 2001:9267:12::1
R2(config)#end
R2#
步驟3:檢查IPv6靜態(tài)路由
檢查R1:
R1#show ipv6 route
IPv6 Routing Table - default - 6 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
?????? B - BGP, HA - Home Agent, MR - Mobile Router, R - RIP
?????? H - NHRP, I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea
?????? IS - ISIS summary, D - EIGRP, EX - EIGRP external, NM - NEMO
?????? ND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - Redirect
?????? RL - RPL, O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1
?????? OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
?????? la - LISP alt, lr - LISP site-registrations, ld - LISP dyn-eid
?????? lA - LISP away, a - Application
S?? ::/0 [1/0]
???? via 2001:9267:12::2
C?? 2001:9267:1:1::/64 [0/0]
???? via Loopback0, directly connected
L?? 2001:9267:1:1::1/128 [0/0]
???? via Loopback0, receive
C?? 2001:9267:12::/64 [0/0]
???? via Ethernet0/0, directly connected
L?? 2001:9267:12::1/128 [0/0]
???? via Ethernet0/0, receive
L?? FF00::/8 [0/0]
???? via Null0, receive
檢查R2:
R2#show ipv6 route
IPv6 Routing Table - default - 6 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
?????? B - BGP, HA - Home Agent, MR - Mobile Router, R - RIP
?????? H - NHRP, I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea
?????? IS - ISIS summary, D - EIGRP, EX - EIGRP external, NM - NEMO
?????? ND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - Redirect
?????? RL - RPL, O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1
?????? OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
?????? la - LISP alt, lr - LISP site-registrations, ld - LISP dyn-eid
?????? lA - LISP away, a - Application
S?? 2001:9267:1:1::/64 [1/0]
???? via 2001:9267:12::1
C?? 2001:9267:2:2::/64 [0/0]
???? via Loopback0, directly connected
L?? 2001:9267:2:2::2/128 [0/0]
???? via Loopback0, receive
C?? 2001:9267:12::/64 [0/0]
???? via Ethernet0/0, directly connected
L?? 2001:9267:12::2/128 [0/0]
???? via Ethernet0/0, receive
L?? FF00::/8 [0/0]
???? via Null0, receive
步驟3:測試IPv6網(wǎng)絡(luò)的連通性
測試R1:
R1#ping 2001:9267:2:2::2 source loopback 0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:9267:2:2::2, timeout is 2 seconds:
Packet sent with a source address of 2001:9267:1:1::1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms