第一篇:cisco學(xué)習(xí)心得
1.Cisco banner 設(shè)定
hostname(config)# banner ?
exec:在登入成功后顯示的訊息
login:在登入輸入帳號密碼時候顯示的訊息
motd:在以上(exrc、login的任何地方)顯示的訊息 清除banner訊息
hostname(config)# no banner [exec / login / motd]
2.HDR=報頭、FCS=報尾、協(xié)議數(shù)據(jù)單元(PDU)、網(wǎng)絡(luò)操作系統(tǒng)(NOS)
3.TCP/IP 協(xié)議棧: 應(yīng)用層 |傳輸層|INTERNET層| 網(wǎng)絡(luò)接入層
OSI 模型:應(yīng)用層、表示層、會話層|傳輸層| 網(wǎng)絡(luò)層 | 數(shù)據(jù)鏈路層、物理層
: 應(yīng)用層 | 數(shù)據(jù)流層
上層為下層指引方向的,下層是為上層提供更好的服務(wù)
4.DHCP用于自動為主機(jī)分配IP地址及設(shè)置TCP/IP協(xié)議棧配置參數(shù),如子網(wǎng)掩碼默認(rèn)路由和域名系統(tǒng)(DNS)服務(wù)器。
5.DNS是一種用于將名稱轉(zhuǎn)換為IP地址的機(jī)制。
6.傳輸層中的流量控制是一種讓通信主機(jī)夠每次傳輸多少數(shù)據(jù)進(jìn)行協(xié)商的機(jī)制??煽啃蕴峁┝艘环N確保每個分組都被成功遞送的機(jī)制
傳輸控制協(xié)議(TCP):TCP是面向鏈接的、可靠的協(xié)議。TCP負(fù)責(zé)將消息劃分成數(shù)據(jù)段。
用戶數(shù)據(jù)報協(xié)議(UDP):是無鏈接的、不確認(rèn)協(xié)議。
TCP是一種傳輸協(xié)議,IP是一種網(wǎng)絡(luò)層協(xié)議。
FTP是一種可靠的、面向鏈接的服務(wù) TFTP: 是一種使用UDP 的應(yīng)用程序。
7.TCP 應(yīng)用層: FTP(21驗證身份、20傳數(shù)據(jù))、TELNET(23)、SMTP(25)DNS(53)傳輸層所對應(yīng)用層的協(xié)議及端口
UDP 應(yīng)用層: TFTP(69)、SNMP(161)RIP(520)傳輸層所對應(yīng)用層的協(xié)議及端口 注:1024以下的端口號是周知端口; 1024以上的端口號是動態(tài)分配的。DNS協(xié)議同時用TCP UDP這兩個協(xié)議。
8.建立TCP鏈接: 三次握手!
9.網(wǎng)絡(luò)操作系統(tǒng)(NOS)包括NETWARE、IP、ISO,顯然,需要有獨立于NOS 的第2層地址,因此開發(fā)了Mac地址。
10.地址解析協(xié)議(ARP),能夠?qū)P地址映射到物理地址。(ICND 1 中寫ARP是 雙機(jī)系同網(wǎng)段)ARP廣播已知的信息(目標(biāo)設(shè)備的IP地址及自己的IP地址)。以太網(wǎng)網(wǎng)段中(同網(wǎng)段)的所有設(shè)備都將收到該廣播,目標(biāo)設(shè)備通過閱讀ARP請求分組發(fā)現(xiàn)請求的是自己的MAC地址后,通過ARP應(yīng)答提供其MAC地址。(ARP緩存表或 ARP表);默認(rèn)保存表中條目時間為300秒。
當(dāng)主機(jī)要將數(shù)據(jù)傳輸給同一個網(wǎng)絡(luò)中(同網(wǎng)段)的其他主機(jī)時,它將首先搜索ARP表看其中有沒有相應(yīng)的條目,如果有,則使用它;如果無,將使用ARP來獲悉這樣的條目。
11.IEEE(電氣和電子工程師協(xié)會)ETHERNET 802.3,是基于載波偵聽多路訪問/沖突檢測的。邏輯鏈路控制(LLC):向上鏈接到網(wǎng)絡(luò)層,參與了封裝過程
MAC 子層 :向下鏈接到物理層,數(shù)據(jù)鏈路層唯一地標(biāo)設(shè)備。
NIC的地址是MAC地址,這通常被稱為固化地址(BIA)
查看MAC地址表,命令: show mac-address-table
12.禁止非SSH鏈接,在線路配置模式下 : transport input ssh 例子:
line vty 0 4 xx
transport input ssh
13.配置端口安全:最常用的對端口安全的理解就是可根據(jù)MAC地址來對網(wǎng)絡(luò)流量的控制和管理,比如MAC地址與具體的端口綁定,限制具體端口通過的MAC地址的數(shù)量,或者在具體的端口不允許某些MAC地址的幀量通過。
注:要啟用端口安全功能,必須首先使用命令 switchport mode access 將端口模式設(shè)置為接入。
配置端口安全實操:
interface fa0/5
switchport mode access
switchport port-security mac-address XX-XX-XX-XX(配置MAC地址)
switchport port-security maximum 1(允許通過MAC地址數(shù))switchport port-security mac-address sticky(允許端口動態(tài)配置所有地址)自己還是未好明白!
switchport port-security violation shutdown(發(fā)現(xiàn)與上述配置,如何處理)
14.顯示接口聽端口安全設(shè)置:show prot-secuity interface(XX)――》接口
顯示所有端口的安全MAC地址 :show port-security address
15.自動協(xié)商可能導(dǎo)致不可預(yù)測的結(jié)果。如果交換機(jī)端口被設(shè)置為自動協(xié)商,當(dāng)其鏈接的設(shè)備不支持自動協(xié)商時,交換機(jī)端口默認(rèn)將采用半雙工模式。如果連接設(shè)備一端采用半雙工,而另一端采用全雙工模式,進(jìn)而導(dǎo)致半雙工端口出現(xiàn)沖突錯誤。
16.WLAN也采用載波偵聽多路訪問/沖突避免(CSMA/CD,不是CSMA/CA,這個是集線器所用的。)WLAN使用的幀格式與有線以太網(wǎng)LAN不同。WLAN要求在幀的第2層報頭中添加額外的信息。
無線電波的傳輸受下述因素的影響
反射:RF波遇到物體(金屬或玻璃表面)后反彈回來
散射:RF波遇到不規(guī)則表面(如粗糙的表面)后沿很多方向反射 吸收:RF波被物體(如墻壁)吸收。
通過無線電波傳輸數(shù)據(jù)時遵循如下規(guī)則:
一、數(shù)據(jù)率越高,覆蓋范圍越小,因為接收方只有信號較強且信噪比(SNR)較高的情況下才能取信息。
二、傳輸功率越大,覆蓋范圍將越大。要將覆蓋范圍加倍,需要將功率增大4倍。
三、數(shù)據(jù)率越高需要的帶寬越大。通過使用更高的頻率或更復(fù)雜的調(diào)制方法可提高帶寬。
四、頻率越高,其衰減和吸收率將越高,因此傳輸距離越短。這種問題可通過使用功率更大的天線來解決!
17.有3種不需要牌照的頻段:900MHz、2.4GHz、5.7GHz 雖然使用這些頻段不需要執(zhí)照,但也可能受當(dāng)?shù)赜嘘P(guān)傳輸范圍的法規(guī)的管制,如發(fā)射器功率,天線增益(它提高有效功率)以及發(fā)射耗損、電纜損耗和天線增益的和。無線LAN使用半雙工通信,因此基本吞吐量只有數(shù)據(jù)率的一半。
18.由于這兩臺主機(jī)位于同一個子網(wǎng)中,因此源終端系統(tǒng)將使用地址解析協(xié)議(ARP)將目標(biāo)IP地址綁定到目標(biāo)MAC地址。如果目標(biāo)主機(jī)不在當(dāng)前子網(wǎng)中,則必須將分組轉(zhuǎn)發(fā)給默認(rèn)網(wǎng)關(guān)(子網(wǎng)中的路由器)的MAC地址以便將其傳輸?shù)侥繕?biāo)網(wǎng)絡(luò)
19.命令:show interface(XX)――》接口 有以下呢幾種情況:
一、正常:line is up , protocol is up
二、連接問題:line is up ,protocol is down
三、接口問題:line is down, protocol is down
四、禁用 : is administerxxxxx down, line protocol is down 前面部分是載波檢測,后面部分是存活消息
20.顯示ARP緩存:show ip arp
21.在有些情況下,ISP為連接到internet提供靜態(tài)地址; 而在另外一些情況下,地址是使用DHCP提供。
22.如果目標(biāo)網(wǎng)絡(luò)是直連的,則路由器已經(jīng)知道使用那個接口來轉(zhuǎn)發(fā)分組;如果目標(biāo)網(wǎng)絡(luò)不是直連的,路由器必須獲悉用于轉(zhuǎn)發(fā)分組的最佳路由。
一、手式輸入路由選擇信息
二、通過路由路中運行的動態(tài)路由選擇進(jìn)程收集路由選擇信息。
23.配置靜態(tài)路由:
router(config)#ip route 目標(biāo)路由IP地址 子網(wǎng)掩碼 下一跳路由IP地址(或出接口)
24.配置默認(rèn)路由:
router(config)#ip route 0.0.0.0.0.0.0.0 下一跳路由IP地址
25.查看靜態(tài)路由配置 : show ip route
26.配置RIP 實操:router rip(選擇將RIP用作路由選擇協(xié)議)
version 2(啟動 RIP v2)
network XXXXXXXXX(指定一個直連網(wǎng)絡(luò),若直連多個網(wǎng)絡(luò)要做多幾次,又要每個路由都要設(shè)??!)
查看RIP配置: show ip protocols / show ip route(后者功能強大D)。其中 R OR C ,分別指 C 表示網(wǎng)絡(luò)是路由器接口直接相連的,R表示路由是通過路由選擇協(xié)議RIP獲取的。
排除RIP配置故障:顯示當(dāng)前發(fā)送和接收的RIP路由選擇更新debug ip rip,要求閉所有的調(diào)試,可使用命令 no debug all
27.cisco 發(fā)現(xiàn)協(xié)議(CDP)是一種信息收集工具(專用),默認(rèn)啟動,也可以在每個端口(接口)上分別啟用/禁用CDP。查看CDP:show cdp
防止其他支持CDP的設(shè)備獲取設(shè)備信息:no cdp run 要在特定接口上禁用CDP,可使用命令 no cdp enable 要在接口上重新啟用 CDP,cdp enable 查看CDP鄰居信息,show cdp neighbors
28.交換技術(shù):(局域網(wǎng)內(nèi)):VLAN、VTP、TRUNK、STP 交換機(jī)要同其它網(wǎng)絡(luò)或其它子網(wǎng)進(jìn)行通信,需要設(shè)有默認(rèn)路由。
VLAN表包括:源MAC、目標(biāo)MAC、VLAN相對應(yīng)的端口
交換機(jī)查找對象流程:
一、主機(jī)查找ARP表查對象
二、將ARP廣播—》交換機(jī)(記錄端口)
三、轉(zhuǎn)發(fā)ARP廣播
四、找到相應(yīng)對象(記錄端口)
ARP(地址解析協(xié)議)應(yīng)該是第二層 ARP表是動態(tài)的,每隔300S更新。ARP表是主機(jī)存有的,可用ARP –A 命令查詢。ARP表中有如下內(nèi)容:IP地址、相對應(yīng)MAC、靜/動狀態(tài)。
ARP傳輸:有三種情況。
一、主機(jī)群在集線器中
由主機(jī)群發(fā)起ARP廣播尋查,對象收到ARP廣播后會應(yīng)表示確認(rèn)身份。
二、主機(jī)群在交換機(jī)中(同一網(wǎng)段中)
由主機(jī)發(fā)起ARP廣播尋查,ARP廣播到交換機(jī)中(此時交換機(jī)記錄發(fā)送ARP主機(jī)的IP、MAC、端口號到MAC表中),交換機(jī)收到信息后,查詢自己的MAC表,是否有目標(biāo)對象資料??!假設(shè):無資料!交換機(jī)將幀(第2層幀=ARP廣播)從除“源”端口外的所有端口發(fā)送出去(應(yīng)該就是泛洪),目標(biāo)主機(jī)收到ARP廣播后,馬上反發(fā)ARP廣播作回應(yīng)!(不是目標(biāo)主機(jī)的就將ARP廣播刪去)。此時交換機(jī)收到目標(biāo)主機(jī)的ARP廣播,(交換機(jī)就記錄發(fā)送ARP主機(jī)的IP、MAC、端口號到MAC表中),然后交換機(jī)讀取ARP應(yīng)答幀中的源MAC地址獲悉目標(biāo)的端口映射。然后源主機(jī)就可以對目標(biāo)主機(jī)發(fā)幀!
三、主機(jī)群在路由器(不同網(wǎng)段中),前提:源主機(jī)已知目標(biāo)主機(jī)不在同一網(wǎng)段中!
由X主機(jī)發(fā)起ARP廣播尋查,ARP廣播到路由器(默認(rèn)網(wǎng)關(guān))中,路由器不會將其發(fā)到其它網(wǎng)段,并把ARP廣播請求發(fā)到CPU進(jìn)行處理(記錄發(fā)送ARP主機(jī)的IP、MAC、無端口號到其ARP表(應(yīng)該是叫路由表)),然后對源主機(jī)發(fā)送回應(yīng)(發(fā)送回應(yīng)內(nèi)容:路由器上接收該ARP廣播接口的IP、MAC)。2.X主機(jī)收到回應(yīng)后,記錄相關(guān)資料(路由器上接收該ARP廣播接口的IP、MAC)。此時就建立起X主機(jī)到路由器(接收ARP廣播的接口)的通道。
3.建立通道后,X主機(jī)就向路由器發(fā)幀,收到幀后,路由器發(fā)現(xiàn)其目標(biāo)MAC地址是自己的,因此對其進(jìn)行處理。在第3層,路由器發(fā)目標(biāo)IP地址不是自己的,因此將分組送到路由選擇表中查找目標(biāo)IP地址。(案例:此路由器與目標(biāo)網(wǎng)絡(luò)直接連接)
4.路由器將分組(此時的分組內(nèi)容有所改變,目標(biāo)IP地址、源IP地址都不變,源MAC地址就變成路由器發(fā)出該分組的接口MAC地址,目標(biāo)MAC地址未知)從目標(biāo)接口發(fā)送出去,5.目標(biāo)主機(jī)(Y主機(jī))收到ARP廣播后,就回應(yīng)路由器。。
注:到最后所傳輸?shù)膸瑑?nèi)容為(目標(biāo)IP地址、源IP地址都不變,源MAC地址就變成路由器發(fā)出該分組的接口MAC地址,目標(biāo)MAC地址)
在設(shè)備接口設(shè)置,盡量避免選“AUTO”,可能導(dǎo)致設(shè)備不兼容。
CCNA視頻教學(xué)心得!
因特網(wǎng)因可以在需要時才連接,費用相對比起其它WAN技術(shù)相對較低;IETF 分布 公網(wǎng)IP。人人都可以上,安全性相對較低!有些公司所要求的安求相對較高(所以不用INTERNET),用其它專用連接方式(成日用)。現(xiàn)在流行的技術(shù)。。VPN(間五中用)(屬于二次計算==連通后再加密。)。解決費用問題。
核心(是以咩角度睇,有小的核心,有電信核心層)
服務(wù)器一定要單獨接核心交換機(jī)上,原因:保證它第一時間轉(zhuǎn)發(fā)數(shù)據(jù)!
交換機(jī)(是一種轉(zhuǎn)發(fā)數(shù)據(jù)的設(shè)備)可以級聯(lián),路由器盡量不用級聯(lián)!!因為路由每過一個數(shù)據(jù)是通過路由表學(xué)習(xí)與計算的,級聯(lián)就意味著路由運行兩次,好緩慢。
在連接外網(wǎng)的路由器若接不同網(wǎng)絡(luò),最好以一個路由接一種網(wǎng)絡(luò),則需多個路由(例如接因特網(wǎng)、ATM)!亦可以在同一個路由上安裝多個模塊,每個模塊接不同網(wǎng)絡(luò)。這樣做法路由相對會慢(路由器要計算),更嚴(yán)重甚至?xí)罊C(jī)。要重啟。。(體外話:買一個模塊的價錢與買一臺路由器的價錢差不多),核心層(三層交換機(jī)(二層以上就叫多層交換機(jī))),每個接口都可以配IP地址)連接路由器,由路由器再連接外網(wǎng)的。而分布層是和二層交換機(jī)??!路由器是訪問層的設(shè)備,不是核心層設(shè)備!
OSI:上層為下層指引方向的,下層是為上層提供更好的服務(wù)
會話層:建立程序會話的建立、保持、終止。例子:登錄郵箱或論壇中:登錄輸入用戶名及密碼(建立)、刪該網(wǎng)頁后重新登錄不用輸入用戶名及密碼(保持)、推出(終止)
傳輸層:TCP 傳輸控制協(xié)議(可靠連接=和對方發(fā)生數(shù)據(jù)交換之前,必須和對方建立起一種連接關(guān)系),提高可靠性,會降低速度!UDP 用戶數(shù)據(jù)報協(xié)議(不可靠連接=傳輸數(shù)據(jù)前不和對方建立起連接,直接發(fā)送出去!不理對方收五收得到數(shù)據(jù)),UDP的可靠性來源于應(yīng)用層!另外作用可以用黎:傳輸層對包進(jìn)行重排!
包括最大傳輸單元,以太網(wǎng)的為1500!傳輸層將數(shù)據(jù)以MTU容量分成若干份傳輸!分大小以及每個數(shù)據(jù)打上標(biāo)簽(用黎重新排列)
網(wǎng)絡(luò)層:無廣播
1.提供點對點包的傳輸,不會廣播地傳輸,可以用多播。而廣播是為尋找目的?。?.提供邏輯地址(IP),ARP―――》MAC 3.定義路由的實現(xiàn)和路由學(xué)習(xí)。4.可以分割數(shù)據(jù)包的大小
數(shù)據(jù)鏈路層:是最復(fù)雜的!包括很多不同數(shù)據(jù)鏈路層==》提供不同的物理鏈路(線路)及接口類型
1.首先檢查電信號是否一致!(例子:兩端是否一起活動?還是只得一端活動?兩端都不行?)2.對所傳輸?shù)臄?shù)據(jù)進(jìn)行封裝檢測(是否同一種數(shù)據(jù)格式)=仲裁 3.802.3(點對點的以太網(wǎng)一種形式),以太網(wǎng)在局域網(wǎng)以廣播形式,以CSMA/CD,802.3只是做一個用作鏈路封裝,不是一個協(xié)議、以太網(wǎng)。由IEEE制定的。
802.3又叫CSMA/CD。廣域的數(shù)據(jù)要轉(zhuǎn)換為局域網(wǎng)數(shù)據(jù),不能直接轉(zhuǎn)成CSMA/CD(CSMA/CD是以太網(wǎng)的一個協(xié)議),廣域的數(shù)據(jù)=》802.3=》CSMA/CD
例子:反復(fù)封裝 反復(fù)解封裝?。?/p>
CSMA/CD 802.3(路由接口處封裝)幀中繼封裝 幀中繼卸裝 802.3(路由接口處封裝)CSMA/CD A機(jī)=====(子網(wǎng))===========路由======網(wǎng)絡(luò)云======路由===========(子網(wǎng))=====B機(jī)
數(shù)據(jù)鏈路層由四個部分組成:
1.仲裁(保證數(shù)據(jù)在傳輸?shù)倪^程中,封裝的一致性),一連通就馬上發(fā)仲裁包!2.尋址 MAC。其中ARP既是網(wǎng)絡(luò)層,也是鏈路層。ARP發(fā)起廣播,廣播找MAC;3.差錯檢測。不等于差錯恢復(fù)??!只有重新傳遞才可以恢復(fù)錯誤(由傳輸層控制重發(fā))。4.幀標(biāo)志。對數(shù)據(jù)幀進(jìn)行劃分。
數(shù)據(jù)鏈路層各組件: MAC=802.3 1.MAC 介質(zhì)訪問控制 又包括:
一、介質(zhì)訪問控制。(就是仲裁)
二、MAC 地址
2.LLC(邏輯鏈路控制)802.2
一、LLC1(SNP、SNMP)
二、LLC2 = HDLC
物理層:就是一些電氣接口、電氣標(biāo)準(zhǔn)!以太網(wǎng)是物理層,也就是說CSMA/CD也是物理層的。802.3 聯(lián)系物理層和數(shù)據(jù)鏈路層的紐帶!起聯(lián)系作用。
傳輸層:段(PDU)網(wǎng)絡(luò)層:包(PDU)數(shù)據(jù)鏈路層:幀(PDU)物理層:比特(PDU)
第二篇:CISCO技術(shù)大總結(jié)
技術(shù)一
一、命令狀態(tài)
1.router>
路由器處于用戶命令狀態(tài),這時用戶可以看路由器的連接狀態(tài),訪問其它網(wǎng)絡(luò)和主機(jī),但不能看到和更改路由器的設(shè)置內(nèi)容。
2.router#
在router>提示符下鍵入enable,路由器進(jìn)入特權(quán)命令狀態(tài)router#,這時不但可以執(zhí)行所有的用戶命令,還可以看到和更改路由器的設(shè)置內(nèi)容。
3.router(config)#
在router#提示符下鍵入configure terminal,出現(xiàn)提示符router(config)#,此時路由器處于全局設(shè)置狀態(tài),這時可以設(shè)置路由器的全局參數(shù)。
4.router(config-if)#;router(config-line)#;router(config-router)#;?
路由器處于局部設(shè)置狀態(tài),這時可以設(shè)置路由器某個局部的參數(shù)。
5.>
路由器處于RXBOOT狀態(tài),在開機(jī)后60秒內(nèi)按ctrl-break可進(jìn)入此狀態(tài),這時路由器不能完成正常的功能,只能進(jìn)行軟件升級和手工引導(dǎo)。
6.設(shè)置對話狀態(tài)
這是一臺新路由器開機(jī)時自動進(jìn)入的狀態(tài),在特權(quán)命令狀態(tài)使用SETUP命令也可進(jìn)入此狀態(tài),這時可通過對話方式對路由器進(jìn)行設(shè)置。
二、設(shè)置對話過程
1.顯示提示信息
2.全局參數(shù)的設(shè)置
3.接口參數(shù)的設(shè)置
4.顯示結(jié)果
利用設(shè)置對話過程可以避免手工輸入命令的煩瑣,但它還不能完全代替手工設(shè)置,一些特殊的設(shè)置還必須通過手工輸入的方式完成。
進(jìn)入設(shè)置對話過程后,路由器首先會顯示一些提示信息:
---System Configuration Dialog---
At any point you may enter a question mark '?' for help.Use ctrl-c to abort configuration dialog at any prompt.Default settings are in square brackets '[]'.這是告訴你在設(shè)置對話過程中的任何地方都可以鍵入“?”得到系統(tǒng)的幫助,按ctrl-c可以退出設(shè)置過程,缺省設(shè)置將顯示在‘[]’中。然后路由器會問是否進(jìn)入設(shè)置對話:
Would you like to enter the inITial configuration dialog? [yes]:
如果按y或回車,路由器就會進(jìn)入設(shè)置對話過程。首先你可以看到各端口當(dāng)前的狀況:
First, would you like to see the current interface summary? [yes]:
Any interface listed wITh OK? value “NO” does not have a valid configuration Interface IP-Address OK? Method Status Protocol Ethernet0 unassigned NO unset up up Serial0 unassigned NO unset up up ??? ??? ? ?? ? ?
然后,路由器就開始全局參數(shù)的設(shè)置:
Configuring global parameters:
1.設(shè)置路由器名:
Enter host name [Router]:
2.設(shè)置進(jìn)入特權(quán)狀態(tài)的密文(secret),此密文在設(shè)置以后不會以明文方式顯示:
The enable secret is a one-way cryptographic secret used instead of the enable password when IT exists.Enter enable secret: cisco
3.設(shè)置進(jìn)入特權(quán)狀態(tài)的密碼(password),此密碼只在沒有密文時起作用,并且在設(shè)置以后會以明文方式顯示:
The enable password is used when there is no enable secret
and when using older software and some boot images.Enter enable password: pass
4.設(shè)置虛擬終端訪問時的密碼:
Enter virtual terminal password: cisco
5.詢問是否要設(shè)置路由器支持的各種網(wǎng)絡(luò)協(xié)議:
Configure SNMP Network Management? [yes]:
Configure DECnet? [no]:
Configure AppleTalk? [no]:
Configure IPX? [no]:
Configure IP? [yes]:
Configure IGRP routing? [yes]:
Configure RIP routing? [no]:
???
6.如果配置的是撥號訪問服務(wù)器,系統(tǒng)還會設(shè)置異步口的參數(shù):
Configure Async lines? [yes]:
1)設(shè)置線路的最高速度:
Async line speed [9600]:
2)是否使用硬件流控:
Configure for HW flow control? [yes]:
3)是否設(shè)置modem:
Configure for modems? [yes/no]: yes
4)是否使用默認(rèn)的modem命令:
Configure for default chat script? [yes]:
5)是否設(shè)置異步口的PPP參數(shù):
Configure for Dial-in IP SLIP/PPP Access? [no]: yes
6)是否使用動態(tài)IP地址:
Configure for Dynamic IP addresses? [yes]: 7)是否使用缺省IP地址:
Configure Default IP addresses? [no]: yes
8)是否使用TCP頭壓縮:
Configure for TCP Header Compression? [yes]: 9)是否在異步口上使用路由表更新:
Configure for routing updates on async links? [no]: y 10)是否設(shè)置異步口上的其它協(xié)議。
接下來,系統(tǒng)會對每個接口進(jìn)行參數(shù)的設(shè)置。
1.Configuring interface Ethernet0: 1)是否使用此接口:
Is this interface in use? [yes]:
2)是否設(shè)置此接口的IP參數(shù):
Configure IP on this interface? [yes]: 3)設(shè)置接口的IP地址:
IP address for this interface: 192.168.162.2
4)設(shè)置接口的IP子網(wǎng)掩碼:
Number of bITs in subnet field [0]:
Class C network is 192.168.162.0, 0 subnet bITs;mask is /24
在設(shè)置完所有接口的參數(shù)后,系統(tǒng)會把整個設(shè)置對話過程的結(jié)果顯示出來:
The following configuration command script was created: hostname Router
enable secret 5 $1$W5Oh$p6J7tIgRMBOIKVXVG53Uh1 enable password pass
????
請注意在enable secret后面顯示的是亂碼,而enable password后面顯示的是設(shè)置的內(nèi)容。
顯示結(jié)束后,系統(tǒng)會問是否使用這個設(shè)置:
Use this configuration? [yes/no]: yes
如果回答yes,系統(tǒng)就會把設(shè)置的結(jié)果存入路由器的NVRAM中,然后結(jié)束設(shè)置對話過程,使路由器開始正常的工作。
三、常用命令
1.幫助
在IOS操作中,無論任何狀態(tài)和位置,都可以鍵入“?”得到系統(tǒng)的幫助。
2.改變命令狀態(tài)
任務(wù) 命令
進(jìn)入特權(quán)命令狀態(tài) enable 退出特權(quán)命令狀態(tài) disable
進(jìn)入設(shè)置對話狀態(tài) setup
進(jìn)入全局設(shè)置狀態(tài) config terminal 退出全局設(shè)置狀態(tài) end
進(jìn)入端口設(shè)置狀態(tài) interface type slot/number
進(jìn)入子端口設(shè)置狀態(tài) interface type number.subinterface [point-to-point | multipoint] 進(jìn)入線路設(shè)置狀態(tài) line type slot/number 進(jìn)入路由設(shè)置狀態(tài) router protocol 退出局部設(shè)置狀態(tài) exIT 3.顯示命令
任務(wù) 命令
查看版本及引導(dǎo)信息 show version 查看運行設(shè)置 show running-config 查看開機(jī)設(shè)置 show startup-config
顯示端口信息 show interface type slot/number 顯示路由信息 show ip router 4.拷貝命令
用于IOS及CONFIG的備份和升級
5.網(wǎng)絡(luò)命令
任務(wù) 命令
登錄遠(yuǎn)程主機(jī) telnet hostname|IP address 網(wǎng)絡(luò)偵測 ping hostname|IP address 路由跟蹤 trace hostname|IP address
6.基本設(shè)置命令
任務(wù)命令
全局設(shè)置 config terminal
設(shè)置訪問用戶及密碼 username username password password 設(shè)置特權(quán)密碼 enable secret password 設(shè)置路由器名 hostname name
設(shè)置靜態(tài)路由 ip route destination subnet-mask next-hop 啟動IP路由 ip routing 啟動IPX路由 ipx routing
端口設(shè)置 interface type slot/number
設(shè)置IP地址 ip address address subnet-mask 設(shè)置IPX網(wǎng)絡(luò) ipx network network 激活端口 no shutdown
物理線路設(shè)置 line type number
啟動登錄進(jìn)程 login [local|tacacs server] 設(shè)置登錄密碼 password password
四、配置IP尋址
1.IP地址分類
IP地址分為網(wǎng)絡(luò)地址和主機(jī)地址二個部分,A類地址前8位為網(wǎng)絡(luò)地址,后24位為主機(jī)地址,B類地址16位為網(wǎng)絡(luò)地址,后16位為主機(jī)地址,C類地址前24位為網(wǎng)絡(luò)地址,后8位為主機(jī)地址,網(wǎng)絡(luò)地址范圍如下表所示:
種類 網(wǎng)絡(luò)地址范圍
A
1.0.0.0 到126.0.0.0有效 0.0.0.0 和127.0.0.0保留
B 128.1.0.0到191.254.0.0有效 128.0.0.0和191.255.0.0保留
C 192.0.1.0 到223.255.254.0有效 192.0.0.0和223.255.255.0保留
D 224.0.0.0到239.255.255.255用于多點廣播
E 240.0.0.0到255.255.255.254保留 255.255.255.255用于廣播
2.分配接口IP地址
任務(wù) 命令
接口設(shè)置 interface type slot/number
為接口設(shè)置IP地址 ip address ip-address mask
掩瑪(mask)用于識別IP地址中的網(wǎng)絡(luò)地址位數(shù),IP地址(ip-address)和掩碼(mask)相與即得到網(wǎng)絡(luò)地址。
3.使用可變長的子網(wǎng)掩碼
通過使用可變長的子網(wǎng)掩碼可以讓位于不同接口的同一網(wǎng)絡(luò)編號的網(wǎng)絡(luò)使用不同的掩碼,這樣可以節(jié)省IP地址,充分利用有效的IP地址空間。
如下圖所示:
Router1和Router2的E0端口均使用了C類地址192.1.0.0作為網(wǎng)絡(luò)地址,Router1的E0的網(wǎng)絡(luò)地址為192.1.0.128,掩碼為255.255.255.192, Router2的E0的網(wǎng)絡(luò)地址為192.1.0.64,掩碼為255.255.255.192,這樣就將一個C類網(wǎng)絡(luò)地址分配給了二個網(wǎng),既劃分了二個子網(wǎng),起到了節(jié)約地址的作用。
4.使用網(wǎng)絡(luò)地址翻譯(NAT)
NAT(Network Address Translation)起到將內(nèi)部私有地址翻譯成外部合法的全局地址的功能,它使得不具有合法IP地址的用戶可以通過NAT訪問到外部Internet.當(dāng)建立內(nèi)部網(wǎng)的時候,建議使用以下地址組用于主機(jī),這些地址是由Network Working Group(RFC 1918)保留用于私有網(wǎng)絡(luò)地址分配的.l Class A:10.1.1.1 to 10.254.254.254
l Class B:172.16.1.1 to 172.31.254.254
l Class C:192.168.1.1 to 192.168.254.254
命令描述如下:
任務(wù) 命令
定義一個標(biāo)準(zhǔn)訪問列表 access-list Access-list-number permIT source [source-wildcard]
定義一個全局地址池 ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length} [type rotary]
建立動態(tài)地址翻譯 ip nat inside source {list {Access-list-number | name} pool name [overload] | static local-ip global-ip}
指定內(nèi)部和外部端口 ip nat {inside | outside}
如下圖所示,路由器的Ethernet 0端口為inside端口,即此端口連接內(nèi)部網(wǎng)絡(luò),并且此端口所連接的網(wǎng)絡(luò)應(yīng)該被翻譯,Serial 0端口為outside端口,其擁有合法IP地址(由NIC或服務(wù)提供商所分配的合法的IP地址),來自網(wǎng)絡(luò)10.1.1.0/24的主機(jī)將從IP地址池c2501中選擇一個地址作為自己的合法地址,經(jīng)由Serial 0口訪問Internet。命令ip nat inside source list 2 pool c2501 overload中的參數(shù)overload,將允許多個內(nèi)部地址使用相同的全局地址(一個合法IP地址,它是由NIC或服務(wù)提供商所分配的地址)。命令ip nat pool c2501 202.96.38.1 202.96.38.62 netmask 255.255.255.192定義了全局地址的范圍。
設(shè)置如下:
ip nat pool c2501 202.96.38.1 202.96.38.62 netmask 255.255.255.192
interface Ethernet 0
ip address 10.1.1.1 255.255.255.0
ip nat inside!
interface Serial 0
ip address 202.200.10.5 255.255.255.252
ip nat outside!
ip route 0.0.0.0 0.0.0.0 Serial 0
Access-list 2 permIT 10.0.0.0 0.0.0.255
!Dynamic NAT!
ip nat inside source list 2 pool c2501 overload
line console 0
exec-timeout 0 0!
line vty 0 4
end
技術(shù)二
五、配置靜態(tài)路由
通過配置靜態(tài)路由,用戶可以人為地指定對某一網(wǎng)絡(luò)訪問時所要經(jīng)過的路徑,在網(wǎng)絡(luò)結(jié)構(gòu)比較簡單,且一般到達(dá)某一網(wǎng)絡(luò)所經(jīng)過的路徑唯一的情況下采用靜態(tài)路由。
任務(wù) 命令
建立靜態(tài)路由 ip route prefix mask {address | interface} [distance] [tag tag] [permanent] Prefix :所要到達(dá)的目的網(wǎng)絡(luò)
mask :子網(wǎng)掩碼
address :下一個跳的IP地址,即相鄰路由器的端口地址。
interface :本地網(wǎng)絡(luò)接口
distance :管理距離(可選)
tag tag :tag值(可選)
permanent :指定此路由即使該端口關(guān)掉也不被移掉。
以下在Router1上設(shè)置了訪問192.1.0.64/26這個網(wǎng)下一跳地址為192.200.10.6,即當(dāng)有目的地址屬于192.1.0.64/26的網(wǎng)絡(luò)范圍的數(shù)據(jù)報,應(yīng)將其路由到地址為192.200.10.6的相鄰路由器。在Router3上設(shè)置了訪問192.1.0.128/26及192.200.10.4/30這二個網(wǎng)下一跳地址為192.1.0.65。由于在Router1上端口Serial 0地址為192.200.10.5,192.200.10.4/30這個網(wǎng)屬于直連的網(wǎng),已經(jīng)存在訪問192.200.10.4/30的路徑,所以不需要在Router1上添加靜態(tài)路由。
Router1:
ip route 192.1.0.64 255.255.255.192 192.200.10.6
Router3:
ip route 192.1.0.128 255.255.255.192 192.1.0.65
ip route 192.200.10.4 255.255.255.252 192.1.0.65
同時由于路由器Router3除了與路由器Router2相連外,不再與其他路由器相連,所以也可以為它賦予一條默認(rèn)路由以代替以上的二條靜態(tài)路由,ip route 0.0.0.0 0.0.0.0 192.1.0.65
即只要沒有在路由表里找到去特定目的地址的路徑,則數(shù)據(jù)均被路由到地址為192.1.0.65的相鄰路由器。
一、HDLC
HDLC是CISCO路由器使用的缺省協(xié)議,一臺新路由器在未指定封裝協(xié)議時默認(rèn)使用HDLC封裝。
1.有關(guān)命令
端口設(shè)置
任務(wù) 命令
設(shè)置HDLC封裝 encapsulation hdlc
設(shè)置DCE端線路速度 clockrate speed
復(fù)位一個硬件接口 clear interface serial unIT
顯示接口狀態(tài) show interfaces serial [unIT] 1
注:1.以下給出一個顯示Cisco同步串口狀態(tài)的例子.Router#show interface serial 0
Serial 0 is up, line protocol is up
Hardware is MCI Serial
Internet address is 150.136.190.203, subnet mask is 255.255.255.0
MTU 1500 bytes, BW 1544 KbIT, DLY 20000 usec, rely 255/255, load 1/255
Encapsulation HDLC, looPBack not set, keepalive set(10 sec)
Last input 0:00:07, output 0:00:00, output hang never
Output queue 0/40, 0 drops;input queue 0/75, 0 drops
Five minute input rate 0 bITs/sec, 0 packets/sec
Five minute output rate 0 bITs/sec, 0 packets/sec
16263 packets input, 1347238 bytes, 0 no buffer
Received 13983 broadcasts, 0 runts, 0 giants
input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 2 abort 22146 packets output, 2383680 bytes, 0 underruns
0 output errors, 0 collisions, 2 interface resets, 0 restarts 1 carrier transITions
2.舉例
設(shè)置如下:
Router1:
interface Serial0
ip address 192.200.10.1 255.255.255.0 clockrate 1000000
Router2:
interface Serial0
ip address 192.200.10.2 255.255.255.0!
3.舉例使用E1線路實現(xiàn)多個64K專線連接.相關(guān)命令: 任務(wù) 命令
進(jìn)入controller配置模式 controller {t1 | e1} number 選擇幀類型 framing {crc4 | no-crc4}
選擇line-code類型 linecode {ami | b8zs | hdb3}
建立邏輯通道組與時隙的映射 channel-group number timeslots range1 顯示controllers接口狀態(tài) show controllers e1 [slot/port]2
注: 1.當(dāng)鏈路為T1時,channel-group編號為0-23, Timeslot范圍1-24;當(dāng)鏈路為E1時, channel-group編號為0-30, Timeslot范圍1-31.2.使用show controllers e1觀察controller狀態(tài),以下為幀類型為crc4時controllers正常的狀態(tài).Router# show controllers e1
e1 0/0 is up.Applique type is Channelized E1unbalanced
Framing is CRC4, Line Code is HDB3 No alarms detected.Data in current interval(725 seconds elapsed):
0 Line Code Violations, 0 Path Code Violations
0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins
0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs
Total Data(last 24 hours)0 Line Code Violations, 0 Path Code Violations,0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins,0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs
以下例子為E1連接3條64K專線, 幀類型為NO-CRC4,非平衡鏈路,路由器具體設(shè)置如下:
shanxi#wri t
Building configuration...Current configuration:!
version 11.2
no service udp-small-servers no service tcp-small-servers!
hostname shanxi!
enable secret 5 $1$XN08$Ttr8nfLoP9.2RgZhcBzkk/ enable password shanxi!
ip subnet-zero!
controller E1 0 framing NO-CRC4
channel-group 0 timeslots 1 channel-group 1 timeslots 2 channel-group 2 timeslots 3!
interface Ethernet0
ip address 133.118.40.1 255.255.0.0 media-type 10BASET!
interface Ethernet1 no ip address shutdown!
interface Serial0:0
ip address 202.119.96.1 255.255.255.252 no ip mroute-cache!
interface Serial0:1
ip address 202.119.96.5 255.255.255.252 no ip mroute-cache!
interface Serial0:2
ip address 202.119.96.9 255.255.255.252 no ip mroute-cache!
no ip classless
ip route 133.210.40.0 255.255.255.0 Serial0:0 ip route 133.210.41.0 255.255.255.0 Serial0:1 ip route 133.210.42.0 255.255.255.0 Serial0:2!
line con 0 line aux 0
line vty 0 4
password shanxi login!end
二、PPP
PPP(Point-to-Point Protocol)是SLIP(Serial Line IP protocol)的繼承者,它提供了跨過同步和異步電路實現(xiàn)路由器到路由器(router-to-router)和主機(jī)到網(wǎng)絡(luò)(host-to-network)的連接。
CHAP(Challenge Handshake Authentication Protocol)和PAP(Password Authentication Protocol)(PAP)通常被用于在PPP封裝的串行線路上提供安全性認(rèn)證。使用CHAP和PAP認(rèn)證,每個路由器通過名字來識別,可以防止未經(jīng)授權(quán)的訪問。
CHAP和PAP在RFC 1334上有詳細(xì)的說明。
1.有關(guān)命令
端口設(shè)置
任務(wù) 命令
設(shè)置PPP封裝 encapsulation ppp1
設(shè)置認(rèn)證方法 ppp authentication {chap | chap pap | pap chap | pap} [if-needed] [list-name | default] [callin]
指定口令 username name password secret
設(shè)置DCE端線路速度 clockrate speed
注:
1、要使用CHAP/PAP必須使用PPP封裝。在與非Cisco路由器連接時,一般采用PPP封裝,其它廠家路由器一般不支持Cisco的HDLC封裝協(xié)議。
2.舉例
路由器Router1和Router2的S0口均封裝PPP協(xié)議,采用CHAP做認(rèn)證,在Router1中應(yīng)建立一個用戶,以對端路由器主機(jī)名作為用戶名,即用戶名應(yīng)為router2。同時在Router2中應(yīng)建立一個用戶,以對端路由器主機(jī)名作為用戶名,即用戶名應(yīng)為router1。所建的這兩用戶的password必須相同。
設(shè)置如下:
Router1:
hostname router1
username router2 password xxx
interface Serial0
ip address 192.200.10.1 255.255.255.0
clockrate 1000000
ppp authentication chap!
Router2:
hostname router2
username router1 password xxx
interface Serial0
ip address 192.200.10.2 255.255.255.0 ppp authentication chap!
二、x.25
1.X25技術(shù)
X.25規(guī)范對應(yīng)OSI三層,X.25的第三層描述了分組的格式及分組交換的過程。X.25的第二層由LAPB(Link Access Procedure, Balanced)實現(xiàn),它定義了用于DTE/DCE連接的幀格式。X.25的第一層定義了電氣和物理端口特性。
X.25網(wǎng)絡(luò)設(shè)備分為數(shù)據(jù)終端設(shè)備(DTE)、數(shù)據(jù)電路終端設(shè)備(DCE)及分組交換設(shè)備(PSE)。DTE是X.25的末端系統(tǒng),如終端、計算機(jī)或網(wǎng)絡(luò)主機(jī),一般位于用戶端,Cisco路由器就是DTE設(shè)備。DCE設(shè)備是專用通信設(shè)備,如調(diào)制解調(diào)器和分組交換機(jī)。PSE是公共網(wǎng)絡(luò)的主干交換機(jī)。
X.25定義了數(shù)據(jù)通訊的電話網(wǎng)絡(luò),每個分配給用戶的x.25 端口都具有一個x.121地址,當(dāng)用戶申請到的是SVC(交換虛電路)時,x.25一端的用戶在訪問另一端的用戶時,首先將呼叫對方x.121地址,然后接收到呼叫的一端可以接受或拒絕,如果接受請求,于是連接建立實現(xiàn)數(shù)據(jù)傳輸,當(dāng)沒有數(shù)據(jù)傳輸時掛斷連接,整個呼叫過程就類似我們撥打普通電話一樣,其不同的是x.25可以實現(xiàn)一點對多點的連接。其中x.121地址、htc均必須與x.25服務(wù)提供商分配的參數(shù)相同。X.25 PVC(永久虛電路),沒有呼叫的過程,類似DDN專線。
2.有關(guān)命令:
任務(wù) 命令
設(shè)置X.25封裝 encapsulation x25 [dce]
設(shè)置X.121地址 x25 address x.121-address
設(shè)置遠(yuǎn)方站點的地址映射 x25 map protocol address [protocol2 address2[...[protocol9 address9]]] x121-address [option]
設(shè)置最大的雙向虛電路數(shù) x25 htc citcuIT-number1
設(shè)置一次連接可同時建立的虛電路數(shù) x25 nVC count2
設(shè)置x25在清除空閑虛電路前的等待周期 x25 idle minutes
重新啟動x25,或清一個svc,啟動一個pvc相關(guān)參數(shù) clear x25 {serial number | cmns-interface mac-address} [VC-number] 3
清x25虛電路 clear x25-VC
顯示接口及x25相關(guān)信息 show interfaces serial show x25 interface show x25 map show x25 VC
注:
1、虛電路號從1到4095,Cisco路由器默認(rèn)為1024,國內(nèi)一般分配為16。
2、虛電路計數(shù)從1到8,缺省為1。
3、在改變了x.25各層的相關(guān)參數(shù)后,應(yīng)重新啟動x25(使用clear x25 {serial number | cmns-interface mac-address} [vc-number]或clear x25-VC命令),否則新設(shè)置的參數(shù)可能不能生效。同時應(yīng)對照服務(wù)提供商對于x.25交換機(jī)端口的設(shè)置來配置路由器的相關(guān)參數(shù),若出現(xiàn)參數(shù)不匹配則可能會導(dǎo)致連接失敗或其它意外情況。
3.實例:
3.1.在以下實例中每二個路由器間均通過sVC實現(xiàn)連接。
路由器設(shè)置如下:
Router1:
interface Serial0
encapsulation x25
ip address 192.200.10.1 255.255.255.0
x25 address 110101
x25 htc 16
x25 nVC 2
x25 map ip 192.200.10.2 110102 broadcast
x25 map ip 192.200.10.3 110103 broadcast!
Router2:
interface Serial0
encapsulation x25
ip address 192.200.10.2 255.255.255.0
x25 address 110102
x25 htc 16
x25 nVC 2
x25 map ip 192.200.10.1 110101 broadcast
x25 map ip 192.200.10.3 110103 broadcast!
Router:
interface Serial0
encapsulation x25
ip address 192.200.10.3 255.255.255.0
x25 address 110103
x25 htc 16
x25 nVC 2
x25 map ip 192.200.10.1 110101 broadcast
x25 map ip 192.200.10.2 110102 broadcast!
相關(guān)調(diào)試命令:
clear x25-VC
show interfaces serial
show x25 map
show x25 route
show x25 VC
3.2.在以下實例中路由器router1和router2均通過svc與router連接,但router1和router2不通過sVC直接連接,此三個路由器的串口運行RIP路由協(xié)議,使用了子接口的概念。由于使用子接口,router1和router2均學(xué)習(xí)到了訪問對方局域
網(wǎng)的路徑,若不使用子接口,router1和router2將學(xué)不到到對方局域網(wǎng)的路由。
子接口(Subinterface)是一個物理接口上的多個虛接口,可以用于在同一個物理接口上連接多個網(wǎng)。我們知道為了避免路由循環(huán),路由器支持splIT horizon法則,它只允許路由更新被分配到路由器的其它接口,而不會再分配路由更新回到此路由被接收的接口。
無論如何,在廣域網(wǎng)環(huán)境使用基于連接的接口(象 X.25和Frame Relay),同一接口通過虛電路(VC)連接多臺遠(yuǎn)端路由器時,從同一接口來的路由更新信息不可以再被發(fā)回到相同的接口,除非強制使用分開的物理接口連接不同的路由器。Cisco提供子接口(subinterface)作為分開的接口對待。你可以將路由器邏輯地連接到相同物理接口的不同子接口, 這樣來自不同子接口的路由更新就可以被分配到其他子接口,同時又滿足splIT horizon法則。
Router1:
interface Serial0
encapsulation x25
ip address 192.200.10.1 255.255.255.0
x25 address 110101
x25 htc 16
x25 nVC 2
x25 map ip 192.200.10.3 110103 broadcast!
router rip
network 192.200.10.0!
Router2:
interface Serial0
encapsulation x25
ip address 192.200.11.2 255.255.255.0
x25 address 110102
x25 htc 16
x25 nVC 2
x25 map ip 192.200.11.3 110103 broadcast!
router rip
network 192.200.11.0!
Router:
interface Serial0
encapsulation x25
x25 address 110103
x25 htc 16
x25 nVC 2!
interface Serial0.1 point-to-point
ip address 192.200.10.3 255.255.255.0 x25 map ip 192.200.10.1 110101 broadcast!
interface Serial0.2 point-to-point
ip address 192.200.11.3 255.255.255.0 x25 map ip 192.200.11.2 110102 broadcast!
router rip
network 192.200.10.0 network 192.200.11.0!
幀中繼是一種高性能的WAN協(xié)議,它運行在OSI參考模型的物理層和數(shù)據(jù)鏈路層。它是一種數(shù)據(jù)包交換技術(shù),是X.25的簡化版本。它省略了X.25的一些強健功能,如提供窗口技術(shù)和數(shù)據(jù)重發(fā)技術(shù),而是依靠高層協(xié)議提供糾錯功能,這是因為幀中繼工作在更好的WAN設(shè)備上,這些設(shè)備較之X.25的WAN設(shè)備具有更可靠的連接服務(wù)和更高的可靠性,它嚴(yán)格地對應(yīng)于OSI參考模型的最低二層,而X.25還提供第三層的服務(wù),所以,幀中繼比X.25具有更高的性能和更有效的傳輸效率。
幀中繼廣域網(wǎng)的設(shè)備分為數(shù)據(jù)終端設(shè)備(DTE)和數(shù)據(jù)電路終端設(shè)備(DCE),Cisco路由器作為 DTE設(shè)備。
幀中繼技術(shù)提供面向連接的數(shù)據(jù)鏈路層的通信,在每對設(shè)備之間都存在一條定義好的通信鏈路,且該鏈路有一個鏈路識別碼。這種服務(wù)通過幀中繼虛電路實現(xiàn),每個幀中繼虛電路都以數(shù)據(jù)鏈路識別碼(DLCI)標(biāo)識自己。DLCI的值一般由幀中繼服務(wù)提供商指定。幀中繼即支持PVC也支持SVC。
幀中繼本地管理接口(LMI)是對基本的幀中繼標(biāo)準(zhǔn)的擴(kuò)展。它是路由器和幀中繼交換機(jī)之間信令標(biāo)準(zhǔn),提供幀中繼管理機(jī)制。它提供了許多管理復(fù)雜互聯(lián)網(wǎng)絡(luò)的特性,其中包括全局尋址、虛電路狀態(tài)消息和多目發(fā)送等功能。
2.有關(guān)命令:
端口設(shè)置
任務(wù) 命令
設(shè)置Frame Relay封裝 encapsulation frame-relay[ietf] 1
設(shè)置Frame Relay LMI類型 frame-relay lmi-type {ansi | cisco | q933a}2
設(shè)置子接口 interface interface-type interface-number.subinterface-number [multipoint|point-to-point]
映射協(xié)議地址與DLCI frame-relay map protocol protocol-address dlci [broadcast]3
設(shè)置FR DLCI編號 frame-relay interface-dlci dlci [broadcast]
注:1.若使Cisco路由器與其它廠家路由設(shè)備相連,則使用Internet工程任務(wù)組(IETF)規(guī)定的幀中繼封裝格式。
2.從Cisco IOS版本11.2開始,軟件支持本地管理接口(LMI)“自動感覺”,“自動感覺”使接口能確定交換機(jī)支持的LMI類型,用戶可以不明確配置LMI接口類型。
3.broadcast選項允許在幀中繼網(wǎng)絡(luò)上傳輸路由廣播信息。
3.幀中繼point to point配置實例:
Router1:
interface serial 0
encapsulation frame-relay!
interface serial 0.1 point-to-point ip address 172.16.1.1 255.255.255.0 frame-reply interface-dlci 105!
interface serial 0.2 point-to-point ip address 172.16.2.1 255.255.255.0 frame-reply interface-dlci 102!
interface serial 0.3 point-to-point ip address 172.16.4.1 255.255.255.0 frame-reply interface-dlci 104!
Router2:
interface serial 0
encapsulation frame-relay!
interface serial 0.1 point-to-point ip address 172.16.2.2 255.255.255.0 frame-reply interface-dlci 201!
interface serial 0.2 point-to-point ip address 172.16.3.1 255.255.255.0 frame-reply interface-dlci 203!
相關(guān)調(diào)試命令:
show frame-relay lmi show frame-relay map show frame-relay pVC show frame-relay route show interfaces serial go top
4.幀中繼 Multipoint 配置實例: Router1:
interface serial 0
encapsulation frame-reply!
interface serial 0.1 multipoint
ip address 172.16.1.2 255.255.255.0
frame-reply map ip 172.16.1.1 201 broadcast frame-reply map ip 172.16.1.3 301 broadcast frame-reply map ip 172.16.1.4 401 broadcast!
Router2:
interface serial 0
encapsulation frame-reply!
interface serial 0.1 multipoint
ip address 172.16.1.1 255.255.255.0
frame-reply map ip 172.16.1.2 102 broadcast frame-reply map ip 172.16.1.3 102 broadcast frame-reply map ip 172.16.1.4 102 broadcast
技術(shù)4 路由協(xié)議:
一、RIP協(xié)議
RIP(Routing information Protocol)是應(yīng)用較早、使用較普遍的內(nèi)部網(wǎng)關(guān)協(xié)議(Interior Gateway Protocol,簡稱IGP),適用于小型同類網(wǎng)絡(luò),是典型的距離向量(distance-vector)協(xié)議。文檔見RFC1058、RFC1723。
RIP通過廣播UDP報文來交換路由信息,每30秒發(fā)送一次路由信息更新。RIP提供跳躍計數(shù)(hop count)作為尺度來衡量路由距離,跳躍計數(shù)是一個包到達(dá)目標(biāo)所必須經(jīng)過的路由器的數(shù)目。如果到相同目標(biāo)有二個不等速或不同帶寬的路由器,但跳躍計數(shù)相同,則RIP認(rèn)為兩個路由是等距離的。RIP最多支持的跳數(shù)為15,即在源和目的網(wǎng)間所要經(jīng)過的最多路由器的數(shù)目為15,跳數(shù)16表示不可達(dá)。
1.有關(guān)命令
任務(wù) 命令
指定使用RIP協(xié)議 router rip
指定RIP版本 version {1|2}1
指定與該路由器相連的網(wǎng)絡(luò) network network
注:1.Cisco的RIP版本2支持驗證、密鑰管理、路由匯總、無類域間路由(CIDR)和變長子網(wǎng)掩碼(VLSMs)
2.舉例
Router1:
router rip
version 2
network 192.200.10.0 network 192.20.10.0!
相關(guān)調(diào)試命令:
show ip protocol show ip route
二、IGRP協(xié)議
IGRP(Interior Gateway Routing Protocol)是一種動態(tài)距離向量路由協(xié)議,它由Cisco公司八十年代中期設(shè)計。使用組合用戶配置尺度,包括延遲、帶寬、可靠性和負(fù)載。
缺省情況下,IGRP每90秒發(fā)送一次路由更新廣播,在3個更?芷諛?即270秒),沒有從路由中的第一個路由器接收到更新,則宣布路由不可訪問。在7個更?芷詡?30秒后,Cisco IOS 軟件從路由表中清除路由。
1.有關(guān)命令
任務(wù) 命令
指定使用RIP協(xié)議 router igrp autonomous-system1
指定與該路由器相連的網(wǎng)絡(luò) network network
指定與該路由器相鄰的節(jié)點地址 neighbor ip-address
注:
1、autonomous-system可以隨意建立,并非實際意義上的autonomous-system,但運行IGRP的路由器要想交換路由更新信息其autonomous-system需相同。
2.舉例
Router1:
router igrp 200
network 192.200.10.0
network 192.20.10.0!
三、OSPF協(xié)議
OSPF(Open Shortest Path First)是一個內(nèi)部網(wǎng)關(guān)協(xié)議(Interior Gateway Protocol,簡稱IGP),用于在單一自治系統(tǒng)(autonomous system,AS)內(nèi)決策路由。與RIP相對,OSPF是鏈路狀態(tài)路有協(xié)議,而RIP是距離向量路由協(xié)議。
鏈路是路由器接口的另一種說法,因此OSPF也稱為接口狀態(tài)路由協(xié)議。OSPF通過路由器之間通告網(wǎng)絡(luò)接口的狀態(tài)來建立鏈路狀態(tài)數(shù)據(jù)庫,生成最短路徑樹,每個OSPF路由器使用這些最短路徑構(gòu)造路由表。
文檔見RFC2178。
1.有關(guān)命令
全局設(shè)置
任務(wù) 命令
指定使用OSPF協(xié)議 router ospf process-id1
指定與該路由器相連的網(wǎng)絡(luò) network address wildcard-mask area area-id2
指定與該路由器相鄰的節(jié)點地址 neighbor ip-address
注:
1、OSPF路由進(jìn)程process-id必須指定范圍在1-65535,多個OSPF進(jìn)程可以在同一個路由器上配置,但最好不這樣做。多個OSPF進(jìn)程需要多個OSPF數(shù)據(jù)庫的副本,必須運行多個最短路徑算法的副本。process-id只在路由器內(nèi)部起作用,不同路由器的process-id可以不同。
2、wildcard-mask 是子網(wǎng)掩碼的反碼, 網(wǎng)絡(luò)區(qū)域ID area-id在0-4294967295內(nèi)的十進(jìn)制數(shù),也可以是帶有IP地址格式的x.x.x.x。當(dāng)網(wǎng)絡(luò)區(qū)域ID為0或0.0.0.0時為主干域。不同網(wǎng)絡(luò)區(qū)域的路由器通過主干域?qū)W習(xí)路由信息。
2.基本配置舉例:
Router1:
interface ethernet 0
ip address 192.1.0.129 255.255.255.192!
interface serial 0
ip address 192.200.10.5 255.255.255.252!
router ospf 100
network 192.200.10.4 0.0.0.3 area 0
network 192.1.0.128 0.0.0.63 area 1!
Router2:
interface ethernet 0
ip address 192.1.0.65 255.255.255.192!
interface serial 0
ip address 192.200.10.6 255.255.255.252!
router ospf 200
network 192.200.10.4 0.0.0.3 area 0
network 192.1.0.64 0.0.0.63 area 2!
Router3:
interface ethernet 0
ip address 192.1.0.130 255.255.255.192!
router ospf 300
network 192.1.0.128 0.0.0.63 area 1!
Router4:
interface ethernet 0
ip address 192.1.0.66 255.255.255.192!
router ospf 400
network 192.1.0.64 0.0.0.63 area 1!
相關(guān)調(diào)試命令:
debug ip ospf events debug ip ospf packet show ip ospf
show ip ospf databASE show ip ospf interface show ip ospf neighbor show ip route
3.使用身份驗證
為了安全的原因,我們可以在相同OSPF區(qū)域的路由器上啟用身份驗證的功能,只有經(jīng)過身份驗證的同一區(qū)域的路由器才能互相通告路由信息。
在默認(rèn)情況下OSPF不使用區(qū)域驗證。通過兩種方法可啟用身份驗證功能,純文本身份驗證和消息摘要(md5)身份驗證。純文本身份驗證傳送的身份驗證口令為純文本,它會被網(wǎng)絡(luò)探測器確定,所以不安全,不建議使用。而消息摘要(md5)身份驗證在傳輸身份驗證口令前,要對口令進(jìn)行加密,所以一般建議使用此種方法進(jìn)行身份驗證。
使用身份驗證時,區(qū)域內(nèi)所有的路由器接口必須使用相同的身份驗證方法。為起用身份驗證,必須在路由器接口配置模式下,為區(qū)域的每個路由器接口配置口令。
任務(wù) 命令
指定身份驗證 area area-id authentication [message-digest]
使用純文本身份驗證 ip ospf authentication-key password
使用消息摘要(md5)身份驗證 ip ospf message-digest-key keyid md5 key
以下列舉兩種驗證設(shè)置的示例,示例的網(wǎng)絡(luò)分布及地址分配環(huán)境與以上基本配置舉例相同,只是在Router1和Router2的區(qū)域0上使用了身份驗證的功能。:
例1.使用純文本身份驗證
Router1:
interface ethernet 0
ip address 192.1.0.129 255.255.255.192!
interface serial 0
ip address 192.200.10.5 255.255.255.252
ip ospf authentication-key cisco!
router ospf 100
network 192.200.10.4 0.0.0.3 area 0
network 192.1.0.128 0.0.0.63 area 1
area 0 authentication!
Router2:
interface ethernet 0
ip address 192.1.0.65 255.255.255.192!
interface serial 0
ip address 192.200.10.6 255.255.255.252
ip ospf authentication-key cisco!
router ospf 200
network 192.200.10.4 0.0.0.3 area 0 network 192.1.0.64 0.0.0.63 area 2 area 0 authentication!
例2.消息摘要(md5)身份驗證:
Router1:
interface ethernet 0
ip address 192.1.0.129 255.255.255.192!
interface serial 0
ip address 192.200.10.5 255.255.255.252 ip ospf message-digest-key 1 md5 cisco!
router ospf 100
network 192.200.10.4 0.0.0.3 area 0 network 192.1.0.128 0.0.0.63 area 1 area 0 authentication message-digest!
Router2:
interface ethernet 0
ip address 192.1.0.65 255.255.255.192!
interface serial 0
ip address 192.200.10.6 255.255.255.252 ip ospf message-digest-key 1 md5 cisco!
router ospf 200
network 192.200.10.4 0.0.0.3 area 0 network 192.1.0.64 0.0.0.63 area 2 area 0 authentication message-digest!
相關(guān)調(diào)試命令:
debug ip ospf adj debug ip ospf events
四、重新分配路由
在實際工作中,我們會遇到使用多個IP路由協(xié)議的網(wǎng)絡(luò)。為了使整個網(wǎng)絡(luò)正常地工作,必須在多個路由協(xié)議之間進(jìn)行成功的路由再分配。
以下列舉了OSPF與RIP之間重新分配路由的設(shè)置范例:
Router1的Serial 0端口和Router2的Serial 0端口運行OSPF,在Router1的Ethernet 0端口運行RIP 2,Router3運行RIP2,Router2有指向Router4的192.168.2.0/24網(wǎng)的靜態(tài)路由,Router4使用默認(rèn)靜態(tài)路由。需要在Router1和Router3之間重新分配OSPF和RIP路由,在Router2上重新分配靜態(tài)路由和直連的路由。
范例所涉及的命令
任務(wù) 命令
重新分配直連的路由 redistribute connected
重新分配靜態(tài)路由 redistribute static
重新分配ospf路由 redistribute ospf process-id metric metric-value
重新分配rip路由 redistribute rip metric metric-value
Router1:
interface ethernet 0
ip address 192.168.1.1 255.255.255.0!
interface serial 0
ip address 192.200.10.5 255.255.255.252!
router ospf 100
redistribute rip metric 10
network 192.200.10.4 0.0.0.3 area 0!
router rip
version 2
redistribute ospf 100 metric 1
network 192.168.1.0!
Router2:
interface looPBack 1
ip address 192.168.3.2 255.255.255.0!
interface ethernet 0
ip address 192.168.0.2 255.255.255.0!
interface serial 0
ip address 192.200.10.6 255.255.255.252!
router ospf 200
redistribute connected subnet
redistribute static subnet
network 192.200.10.4 0.0.0.3 area 0!
ip route 192.168.2.0 255.255.255.0 192.168.0.1!
Router3:
interface ethernet 0
ip address 192.168.1.2 255.255.255.0!
router rip version 2
network 192.168.1.0!
Router4:
interface ethernet 0
ip address 192.168.0.1 255.255.255.0!
interface ethernet 1
ip address 192.168.2.1 255.255.255.0!
ip route 0.0.0.0 0.0.0.0 192.168.0.2!
五、IPX協(xié)議設(shè)置
IPX協(xié)議與IP協(xié)議是兩種不同的網(wǎng)絡(luò)層協(xié)議,它們的路由協(xié)議也不一樣,IPX的路由協(xié)議不象IP的路由協(xié)議那樣豐富,所以設(shè)置起來比較簡單。但I(xiàn)PX協(xié)議在以太網(wǎng)上運行時必須指定封裝形式。
1. 有關(guān)命令
啟動IPX路由 ipx routing
設(shè)置IPX網(wǎng)絡(luò)及以太網(wǎng)封裝形式 ipx network network [encapsulation encapsulation-type]1
指定路由協(xié)議,默認(rèn)為RIP ipx router {eigrp autonomous-system-number | nlsp [tag] | rip}
注:1.NETwork 范圍是1 到FFFFFFFD.IPX封裝類型列表
接口類型 封裝類型 IPX幀類型
Ethernet novell-ether(默認(rèn))arpa sap snap Ethernet_802.3 Ethernet_II Ethernet_802.2 Ethernet_Snap
Token Ring sap(默認(rèn))snap Token-Ring Token-Ring_Snap
FDDI snap(默認(rèn))sap novell-fddi Fddi_Snap Fddi_802.2 Fddi_Raw
舉例:
在此例中,WAN的IPX網(wǎng)絡(luò)為3a00,Router1所連接的局域網(wǎng)IPX網(wǎng)絡(luò)號為2a00,在此局域網(wǎng)有一臺Novell服務(wù)器,IPX網(wǎng)絡(luò)號也是2a00, 路由器接口的IPX網(wǎng)絡(luò)號必須與在同一網(wǎng)絡(luò)的Novell服務(wù)器上設(shè)置的IPX網(wǎng)絡(luò)號相同。路由器通過監(jiān)聽SAP來建立已知的服務(wù)及自己的網(wǎng)絡(luò)地址表,并每60秒發(fā)送一次自己的SAP表。
Router1:
ipx routing
interface ethernet 0
ipx network 2a00 encapsulation sap!
interface serial 0 ipx network 3a00!
ipx router eigrp 10 network 3a00 network 2a00!
Router2: ipx routing
interface ethernet 0
ipx network 2b00 encapsulation sap!
interface serial 0 ipx network 3a00!
ipx router eigrp 10 network 2b00 network 3a00!
相關(guān)調(diào)試命令:
debug ipx packet debug ipx routing debug ipx sap debug ipx spoof debug ipx spx
show ipx eigrp interfaces show ipx eigrp neighbors show ipx eigrp topology show ipx interface show ipx route show ipx servers show ipx spx-spoof
服務(wù)質(zhì)量及訪問控制
一、協(xié)議優(yōu)先級設(shè)置
1.有關(guān)命令
任務(wù) 命令
設(shè)置優(yōu)先級表項目 priorITy-list list-number protocol protocol
{high | medium | normal | low} queue-keyword keyword-value
使用指定的優(yōu)先級表 priorITy-group list-number
2.舉例
Router1:
priorITy-list 1 protocol ip high tcp telnet
priorITy-list 1 protocol ip low tcp ftp
priorITy-list 1 default normal
interface serial 0
priorITy-group 1
custom-queue-list 1
三、訪問控制
1.有關(guān)命令
任務(wù) 命令
設(shè)置訪問表項目 Access-list list {permIT | deny} address mask
設(shè)置隊列表中隊列的大小 queue-list list-number queue queue-number byte-count byte-count-number
使用指定的訪問表 ip Access-group list {in | out}
2.舉例
Router1:
Access-list 1 deny 192.1.3.0 0.0.0.255
Access-list 1 permIT any
interface serial 0
ip Access-group 1 in
{high | medium | normal | low} queue-keyword keyword-value
使用指定的優(yōu)先級表 priorITy-group list-number
2.舉例
Router1:
priorITy-list 1 protocol ip high tcp telnet priorITy-list 1 protocol ip low tcp ftp priorITy-list 1 default normal interface serial 0
priorITy-group 1
二、隊列定制
1.有關(guān)命令
任務(wù) 命令
設(shè)置隊列表中包含協(xié)議 queue-list list-number protocol protocol-name queue-number queue-keyword keyword-value
設(shè)置隊列表中隊列的大小 queue-list list-number queue queue-number byte-count byte-count-number
使用指定的隊列表 custom-queue-list list
2.舉例
Router1:
queue-list 1 protocol ip 0 tcp telnet
queue-list 1 protocol ip 1 tcp 004km.cnmand alias!
#vtp
set vtp domain hne
set vtp mode server
set vtp v2 disable
set vtp pruning disable
set vtp pruneeligible 2-1000
clear vtp pruneeligible 1001-1005
set vlan 1 name default type ethernet mtu 1500 said 100001 state active
set vlan 777 name rgw type ethernet mtu 1500 said 100777 state active
set vlan 888 name qbw type ethernet mtu 1500 said 100888 state active
set vlan 1002 name fddi-default type fddi mtu 1500 said 101002 state active
set vlan 1004 name fddinet-default type fddinet mtu 1500 said 101004 state active bridge 0x0 stp ieee
set vlan 1005 name trnet-default type trbrf mtu 1500 said 101005 state active bridge 0x0 stp ibm
set vlan 1003 name token-ring-default type trcrf mtu 1500 said 101003 state active parent 0 ring 0x0 mode srb aremaxhop 7 stemaxhop 7!
#set boot command
set boot config-register 0x102
set boot system flash bootflash:cat5000-sup3.4-3-1a.bin!
#module 1 : 2-port 1000BASELX Supervisor set module name 1 set vlan 1 1/1-2
set port enable 1/1-2!
#module 2 : empty!
#module 3 : 24-port 10/100BASETX Ethernet set module name 3 set module enable 3 set vlan 1 3/1-22 set vlan 777 3/23 set vlan 888 3/24
set trunk 3/1 on isl 1-1005 #module 4 empty!
#module 5 empty!
#module 6 : 1-port Route SwITch set module name 6
set port level 6/1 normal set port trap 6/1 disable set port name 6/1 set cdp enable 6/1 set cdp interval 6/1 60 set trunk 6/1 on isl 1-1005!
#module 7 : 24-port 10/100BASETX Ethernet set module name 7 set module enable 7 set vlan 1 7/1-22 set vlan 888 7/23-24
set trunk 7/1 on isl 1-1005 set trunk 7/2 on isl 1-1005!
#module 8 empty!
#module 9 empty!
#module 10 : 12-port 100BASEFX MM Ethernet set module name 10 set module enable 10 set vlan 1 10/1-12
set port channel 10/1-4 off set port channel 10/5-8 off set port channel 10/9-12 off set port channel 10/1-2 on set port channel 10/3-4 on set port channel 10/5-6 on set port channel 10/7-8 on set port channel 10/9-10 on set port channel 10/11-12 on #module 11 empty!
#module 12 empty!
#module 13 empty!
#swITch port analyzer
!set span 1 1/1 both inpkts disable set span disable!#cam
set cam agingtime 1-2,777,888,1003,1005 300 end
5500C>(enable)
WS-X5302路由模塊設(shè)置:
Router#wri t
Building configuration...Current configuration:!
version 11.2
no service password-encryption no service udp-small-servers no service tcp-small-servers!
hostname Router!
enable secret 5 $1$w1kK$AJK69fGOD7BqKhKcSNBf6.!
ip subnet-zero!
interface Vlan1
ip address 10.230.2.56 255.255.255.0!
interface Vlan777
ip address 10.230.3.56 255.255.255.0!
interface Vlan888
ip address 10.230.4.56 255.255.255.0!
no ip classless!
line con 0
line aux 0
line vty 0 4
password router
login!
end
Router#
3.1.例二:
交換設(shè)備仍選用Catalyst5500交換機(jī)1臺,安裝WS-X5530-E3管理引擎,多塊WS-X5225R在交換機(jī)內(nèi)劃有3個虛擬網(wǎng),分別名為default、qbw、rgw,通過Cisco3640路由器實現(xiàn)虛擬網(wǎng)間路由。交換機(jī)設(shè)置與例一類似。
路由器Cisco3640,配有一塊NM-1FE-TX模塊,此模塊帶有一個快速以太網(wǎng)接口可以支持ISL。Cisco3640快速以太網(wǎng)接口與交換機(jī)上的某一支持ISL的端口實現(xiàn)連接,如交換機(jī)第3槽第1個接口(3/1口)。
Router#wri t
Building configuration...Current configuration:!
version 11.2
no service password-encryption
no service udp-small-servers
no service tcp-small-servers!
hostname Router!
enable secret 5 $1$w1kK$AJK69fGOD7BqKhKcSNBf6.!
ip subnet-zero!
interface FastEthernet1/0!
interface FastEthernet1/0.1
encapsulation isl 1
ip address 10.230.2.56 255.255.255.0!
interface FastEthernet1/0.2
encapsulation isl 777
ip address 10.230.3.56 255.255.255.0!
interface FastEthernet1/0.3 encapsulation isl 888
ip address 10.230.4.56 255.255.255.0!
no ip classless!
line con 0 line aux 0 line vty 0 4
password router login!end Router#
參考:
1、Cisco路由器口令恢復(fù)
當(dāng)Cisco路由器的口令被錯誤修改或忘記時,可以按如下步驟進(jìn)行操作:
1.開機(jī)時按使進(jìn)入ROM監(jiān)控狀態(tài)
2.按o 命令讀取配置寄存器的原始值
> o 一般值為0x2102
3.作如下設(shè)置,使忽略NVRAM引導(dǎo)
>o/r0x**4* Cisco2500系列命令
rommon 1 >confreg 0x**4* Cisco2600、1600系列命令
一般正常值為0x2102 4.重新啟動路由器
>I
rommon 2 >reset
5.在“Setup”模式,對所有問題回答No 6.進(jìn)入特權(quán)模式
Router>enable 7.下載NVRAM
Router>configure memory
8.恢復(fù)原始配置寄存器值并激活所有端口
“hostname”#configure terminal
“hostname”(config)#config-register 0x“value”
“hostname”(config)#interface xx “hostname”(config)#no shutdown 9.查詢并記錄丟失的口令
“hostname”#show configuration(show startup-config)10.修改口令
“hostname”#configure terminal “hostname”(config)line console 0 “hostname”(config-line)#login
“hostname”(config-line)#password xxxxxxxxx “hostname”(config-line)#
“hostname”(config-line)#wrITe memory(copy running-config startup-config)
2、IP地址分配
地址類 網(wǎng)絡(luò)主機(jī) 網(wǎng)絡(luò)地址范圍 標(biāo)準(zhǔn)二進(jìn)制掩碼
A N.H.H.H 1-126 1111 1111 0000 0000 0000 0000 0000 0000 B N.N.H.H 128-191 1111 1111 1111 1111 0000 0000 0000 0000 C N.N.N.H 192-223 1111 1111 1111 1111 1111 1111 0000 0000
子網(wǎng)位個數(shù) 子網(wǎng)掩碼 子網(wǎng)數(shù) 主機(jī)數(shù)
B類地址 255.255.192.0 2 16382 3 255.255.224.0 6 8198 4 255.255.240.0 14 4894 5 255.255.248.0 30 2846 6 255.255.252.0 62 1822 7 255.255.254.0 126 518 8 255.255.255.0 254 254 9 255.255.255.128 518 126 10 255.255.255.192 1822 62 11 255.255.255.224 2846 30 12 255.255.255.240 4894 14 13 255.255.255.248 8198 6 14 255.255.255.252 16382 2 C類地址 255.255.255.192 2 62 3 255.255.255.224 6 30 4 255.255.255.240 14 14 5 255.255.255.248 30 6 6 255.255.255.252 62 2
第三篇:Cisco校園網(wǎng)設(shè)計方案
Cisco校園網(wǎng)設(shè)計方案
一、學(xué)校需求分析
隨著計算機(jī)、通信和多媒體技術(shù)的發(fā)展,使得網(wǎng)絡(luò)上的應(yīng)用更加豐富。同時在多媒體教育和管理等方面的 需求,對校園網(wǎng)絡(luò)也提出進(jìn)一步的要求。因此需要一個高速的、具有先進(jìn)性的、可擴(kuò)展的校園計算機(jī)網(wǎng)絡(luò)以適應(yīng)當(dāng)前網(wǎng)絡(luò)技術(shù)發(fā)展的趨勢并滿足學(xué)校各方面應(yīng)用的需 要。信息技術(shù)的普及教育已經(jīng)越來越受到人們關(guān)注。學(xué)校領(lǐng)導(dǎo)、廣大師生們已經(jīng)充分認(rèn)識到這一點,學(xué)校未來的教育方法和手段,將是構(gòu)筑在教育信息化發(fā)展戰(zhàn)略之 上,通過加大信息網(wǎng)絡(luò)教育的投入,開展網(wǎng)絡(luò)化教學(xué),開展教育信息服務(wù)和遠(yuǎn)程教育服務(wù)等將成為未來建設(shè)的具體內(nèi)容。
調(diào)研情況
學(xué)校有幾棟建筑需納入局域網(wǎng),其中原有計算機(jī)教室將并入整個校園網(wǎng)絡(luò)。根據(jù)校方要求,總的信息點將達(dá)到 3000個左右。信息節(jié)點的分布比較分散。將涉及到圖書館、實驗樓、教學(xué)樓、宿舍樓、食堂等。主控室可設(shè)在教學(xué)樓的一層,圖書館、實驗樓和教學(xué)樓為信息點密集區(qū)。
需求功能
校園網(wǎng)最終必須是一個集計算機(jī)網(wǎng)絡(luò)技術(shù)、多項信息管理、辦公自動化和信息發(fā)布等功能于一體的綜合信息平臺,并能夠有效促進(jìn)現(xiàn)有的管理體制和管理方法,提高學(xué)校辦公質(zhì)量和效率,以促進(jìn)學(xué)校整體教學(xué)水平的提高。
二.設(shè)計特點
根據(jù)校園網(wǎng)絡(luò)項目,我們應(yīng)該充分考慮學(xué)校的實際情況,注重設(shè)備選型的性能價格比,采用成熟可靠的技術(shù),為學(xué)校設(shè)計成一個技術(shù)先進(jìn)、靈活可用、性能優(yōu)秀、可升級擴(kuò)展的校園網(wǎng)絡(luò)??紤]到學(xué)校的中長期發(fā)展規(guī)劃,在網(wǎng)絡(luò)結(jié)構(gòu)、網(wǎng)絡(luò)應(yīng)用、網(wǎng)絡(luò)管理、系統(tǒng)性能以及遠(yuǎn)程教學(xué)等各個方面能夠適應(yīng)未來的發(fā)展,最大程度地保 護(hù)學(xué)校的投資。學(xué)校借助校園網(wǎng)的建設(shè),可充分利用豐富的網(wǎng)上應(yīng)用系統(tǒng)及教學(xué)資源,發(fā)揮網(wǎng)絡(luò)資源共享、信息快捷、無地理限制等優(yōu)勢,真正把現(xiàn)代化管理、教育 技術(shù)融入學(xué)校的日常教育與辦公管理當(dāng)中。學(xué)校校園網(wǎng)具體功能和特點如下:
技術(shù)先進(jìn)
· 采用千兆以太網(wǎng)技術(shù),具有高帶寬1000Mbps 速率的主干,100Mbps 到桌面,運行目前的各種應(yīng)用系統(tǒng)綽綽有余,還可輕松應(yīng)付將來一段時間內(nèi)的應(yīng)用要求,且易于升級和擴(kuò)展,最大限度的保護(hù)用戶投資;
· 網(wǎng)絡(luò)設(shè)備選型為國際知名產(chǎn)品,性能穩(wěn)定可靠、技術(shù)先進(jìn)、產(chǎn)品系列全及完善的服務(wù)保證;
· 采用支持網(wǎng)絡(luò)管理的交換設(shè)備,足不出戶即可管理配置整個網(wǎng)絡(luò)。
網(wǎng)絡(luò)互聯(lián):
· 提供國際互聯(lián)網(wǎng)ISDN 專線接入(或DDN),實現(xiàn)與各公共網(wǎng)的連接;
· 可擴(kuò)容的遠(yuǎn)程撥號接入/撥出,共享資源、發(fā)布信息等。應(yīng)用系統(tǒng)及教學(xué)資源豐富;
· 有綜合網(wǎng)絡(luò)辦公系統(tǒng)及各個應(yīng)用管理系統(tǒng),實現(xiàn)辦公自動化,管理信息化;
· 有以WEB數(shù)據(jù)庫為中心的綜合信息平臺,可進(jìn)行消息發(fā)布,招生廣告、形象宣傳、課業(yè)輔導(dǎo)、教案參考展示、資料查詢、郵件服務(wù)及遠(yuǎn)程教學(xué)等。
三.校園網(wǎng)布局結(jié)構(gòu)
校園比較大,建筑樓群多、布局比較分散。因此在設(shè)計校園網(wǎng)主干結(jié)構(gòu)時既要考慮到目前實際應(yīng)用有所側(cè)重,又要兼顧未來的發(fā)展需求。主干網(wǎng)以中控室為中心,設(shè)幾個主干交換節(jié)點,包括中控室、實驗樓、圖書館、教學(xué)樓、宿舍樓。中心交換機(jī)和主干交換機(jī)采用千兆光纖交換機(jī)。中控室至圖書館、校園網(wǎng)的主干即中控室與 教學(xué)樓、實驗樓、圖書館、宿舍樓之間全部采用8芯室外光纜;樓內(nèi)選用進(jìn)口6芯室內(nèi)光纜和5類線。
根據(jù)學(xué)校的實際應(yīng)用,配服務(wù)器7臺,用途如下:
① 主服務(wù)器2臺:裝有Solaris操作系統(tǒng),負(fù)責(zé)整個校園網(wǎng)的管理,教育資源管理等。其中一臺服務(wù)器裝有DNS服務(wù),負(fù)責(zé)整個校園網(wǎng)中各個域名的解析。另一臺服務(wù)器裝有電子郵件系統(tǒng),負(fù)責(zé)整個校園網(wǎng)中各個用戶的郵件管理。
②WWW服務(wù)器1臺:裝有Linux操作系統(tǒng),負(fù)責(zé)遠(yuǎn)程服務(wù)管理及WEB站點的管理。WEB服務(wù)器采用現(xiàn)在比較流行的APACHE服務(wù)器,用PHP語言進(jìn)行開發(fā),連接MYSQL數(shù)據(jù)庫,形成了完整的動態(tài)網(wǎng)站。
③電子閱覽服務(wù)器1臺:多媒體資料的閱覽、查詢及文件管理等;
④教師備課服務(wù)器1臺:教師備課、課件制作、資料查詢等文件管理以及Proxy服務(wù)等。
⑤光盤服務(wù)器1臺:負(fù)責(zé)多媒體光盤及視頻點播服務(wù)。
⑥圖書管理服務(wù)器1臺:負(fù)責(zé)圖書資料管理。
在充分考慮學(xué)校未來的應(yīng)用,整個校園的信息節(jié)點設(shè)計為3000個左右。交換機(jī)總數(shù)約 50臺左右,其中主干交換機(jī)5臺,配有千兆光纖接口。原有計算機(jī)機(jī)房通過各自的交換機(jī)接入最近的主交換節(jié)點,并配成多媒體教學(xué)網(wǎng)。INTERNET接入采 用路由器接ISDN方案,也可選用DDN專線??杀WC多用戶群的數(shù)據(jù)瀏覽和下載。
四.網(wǎng)絡(luò)拓?fù)鋱D
第四篇:cisco 路由器 EZvpn 總結(jié)
實驗拓?fù)鋱D:
PC2192.168.150.2/24分支機(jī)構(gòu)PC1192.168.100.0/24E0/3:.1R1192.168.100.2/24192.168.1.0/24E0/0:.1公司總部192.168.150.0/24192.168.2.0/24E0/3:.1E0/1:.2E0/0:.1E0/1:.2192.168.200.0/24E0/3:.1PC3R2R3192.168.200.2/24
實現(xiàn)目標(biāo)
分支機(jī)構(gòu)為不固定IP地址,分支機(jī)構(gòu)和公司總部實現(xiàn)VPN互聯(lián)。分支機(jī)構(gòu)能夠獲取公司總部的網(wǎng)絡(luò)資源。
基本配置:
EZvpn network-extension 模式 R1基本配置: R1# R1#show run
Building configuration...Current configuration : 1010 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R1!boot-start-marker boot-end-marker!noaaa new-model memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3!?。。。。。。。。。nterface Ethernet0/0 ip address 192.168.1.1 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex!interface Ethernet0/1 noip address shutdown half-duplex!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.100.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex!ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.1.2!ipnat inside source list 1 interface Ethernet0/0 overload!access-list 1 permit any!!control-plane!?。。?!line con 0 exec-timeout 0 0 line aux 0 linevty 0 4 login!end
R1#
R2的基本配置: R2# R2#show run
Building configuration...Current configuration : 825 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R2!boot-start-marker boot-end-marker!noaaa new-model memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3?。。。。。。。。。?!interface Ethernet0/0 ip address 192.168.2.1 255.255.255.0 half-duplex!interface Ethernet0/1 ip address 192.168.1.2 255.255.255.0 half-duplex!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.150.1 255.255.255.0 half-duplex!ip http server noip http secure-server!ip forward-protocol nd!!
!control-plane?。。。?!line con 0 exec-timeout 0 0 line aux 0 linevty 0 4 login!end R2#
R3的基本配置: R3# *Mar 1 00:13:56.891: %SYS-5-CONFIG_I: Configured from console by console R3# R3#show run Building configuration...Current configuration : 1010 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R3!boot-start-marker boot-end-marker!noaaa new-model memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3!?。。。。。。。。?!interface Ethernet0/0 noip address shutdown half-duplex!interface Ethernet0/1 ip address 192.168.2.2 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.200.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex!ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.2.1!ipnat inside source list 1 interface Ethernet0/1 overload!access-list 1 permit any!!control-plane!?。。?!line con 0 exec-timeout 0 0 line aux 0 linevty 0 4 login!end
聯(lián)通性測試: 在R1上測試:
在R3上測試:
在PC1上測試
在PC2上測試
在PC3上測試
設(shè)定公司總部R3為Ezvpn Server,則R3上配置如下 R3# R3#show run
Building configuration...Current configuration : 1505 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R3!boot-start-marker boot-end-marker!aaa new-model!aaa authorization network ezvpnauthor local!aaa session-id common memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3?。。。。。。。?!
!cryptoisakmp policy 1 authentication pre-share group 2!cryptoisakmp client configuration group group1 key cisco!cryptoipsec transform-set mysetesp-des esp-md5-hmac!crypto dynamic-map dymap 1 set transform-set myset reverse-route!crypto map vpnmapisakmp authorization list ezvpnauthor crypto map vpnmap client configuration address respond crypto map vpnmap 1 ipsec-isakmp dynamic dymap??!
interface Ethernet0/0 noip address shutdown half-duplex!interface Ethernet0/1 ip address 192.168.2.2 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex crypto map vpnmap!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.200.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex!
ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.2.1!ipnat inside source list 1 interface Ethernet0/1 overload!access-list 1 permit any!!control-plane?。。。?!
line con 0 exec-timeout 0 0 line aux 0 linevty 0 4!End
公司分部R1為remote角色,在Ezvpn Remote 上面配置 R1# R1#sho run
Building configuration...Current configuration : 1244 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R1!boot-start-marker boot-end-marker!noaaa new-model memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3!?。。。。。。。。?!!
cryptoipsec client ezvpn client1 connect auto group group1 key cisco mode network-extension peer 192.168.2.2 xauthuserid mode interactive??!!interface Ethernet0/0 ip address 192.168.1.1 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex cryptoipsec client ezvpn client1!interface Ethernet0/1 noip address shutdown half-duplex!
interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.100.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex cryptoipsec client ezvpn client1 inside!ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.1.2!ipnat inside source list 1 interface Ethernet0/0 overload!access-list 1 permit any!
!control-plane!?。。。ine con 0 exec-timeout 0 0 line aux 0 linevty 0 4 login!end
R1#
查看R1的vpn狀態(tài)
在PC1上測試
我們發(fā)現(xiàn),vpn隧道雖然建立起來了,但是,外網(wǎng)和總部內(nèi)網(wǎng)都ping不通了。這是由于PC1的數(shù)據(jù)都經(jīng)由隧道了,包括訪問公網(wǎng)的數(shù)據(jù)包,都被導(dǎo)入隧道中。我們將隧道進(jìn)行分離,讓訪問公網(wǎng)的數(shù)據(jù)能正常被NAT成R1的公網(wǎng)地址。
R3#
show run Building configuration...Current configuration : 1568 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R3!boot-start-marker boot-end-marker!aaa new-model!aaa authorization network ezvpnauthor local!aaa session-id common memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3?。。。。。。。?!
!cryptoisakmp policy 1 authentication pre-share group 2!cryptoisakmp client configuration group group1 key cisco acl 100!cryptoipsec transform-set mysetesp-des esp-md5-hmac!crypto dynamic-map dymap 1 set transform-set myset reverse-route!crypto map vpnmapisakmp authorization list ezvpnauthor crypto map vpnmap client configuration address respond crypto map vpnmap 1 ipsec-isakmp dynamic dymap!!
!interface Ethernet0/0 noip address shutdown half-duplex!interface Ethernet0/1 ip address 192.168.2.2 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex crypto map vpnmap!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.200.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex!ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.2.1!ipnat inside source list 1 interface Ethernet0/1 overload!access-list 1 permit any access-list 100 permit ip 192.168.200.0 0.0.0.255 any!!control-plane?。。?!
!line con 0 exec-timeout 0 0 line aux 0 linevty 0 4!end
R3#
在R1上重建VPN
在R1上查看Vpn狀態(tài),我們發(fā)現(xiàn),隧道被成功分離,只有去往192.168.200.0/24的數(shù)據(jù)才會經(jīng)由隧道。
這個時候,我們在PC1上進(jìn)行測試
發(fā)現(xiàn),可以正常訪問公網(wǎng),但是還不能訪問vpn對端內(nèi)網(wǎng),怎么回事呢?我們查看R3的NAT表。
在R3上面查看NAT表
發(fā)現(xiàn),R3內(nèi)網(wǎng)192.168.200.2機(jī)器icmp reply 全部被NAT成R3的公網(wǎng)接口192.168.2.2地址了。
在R3上修正NAT問題 R3# R3#show run Building configuration...Current configuration : 1678 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R3!boot-start-marker boot-end-marker!aaa new-model!aaa authorization network ezvpnauthor local!aaa session-id common memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3!?。。。。。。?!
!cryptoisakmp policy 1 authentication pre-share group 2!cryptoisakmp client configuration group group1 key cisco acl 100!cryptoipsec transform-set mysetesp-des esp-md5-hmac!crypto dynamic-map dymap 1 set transform-set myset reverse-route!crypto map vpnmapisakmp authorization list ezvpnauthor crypto map vpnmap client configuration address respond crypto map vpnmap 1 ipsec-isakmp dynamic dymap!!
!interface Ethernet0/0 noip address shutdown half-duplex!interface Ethernet0/1 ip address 192.168.2.2 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex crypto map vpnmap!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.200.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex!ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.2.1!ipnat inside source list 111 interface Ethernet0/1 overload!access-list 1 permit any access-list 100 permit ip 192.168.200.0 0.0.0.255 any access-list 111 deny
ip 192.168.200.0 0.0.0.255 192.168.100.0 0.0.0.255 access-list 111 permit ip any any!!control-plane!?。?/p>
??!line con 0 exec-timeout 0 0 line aux 0 linevty 0 4!end
R3#
我們通過ACL,先限制源地址192.168.200.0去往192.168.100.0地址進(jìn)行NAT轉(zhuǎn)換,然后允許其它流量轉(zhuǎn)換。在PC1上重新測試
在PC3上進(jìn)行測試
OK,VPN實現(xiàn)成功,總部和分支機(jī)構(gòu)內(nèi)部訪問外網(wǎng)和對端網(wǎng)絡(luò)都正常。
Ezvpn Client模式 R3上配置 R3# R3#show run
Building configuration...Current configuration : 1811 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R3!boot-start-marker boot-end-marker!aaa new-model!aaa authorization network ezvpnauthor local!aaa session-id common memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3?。。。。。。。?!
!cryptoisakmp policy 1 authentication pre-share group 2!cryptoisakmp client configuration group group1 key cisco poolezvpnpool acl 100!cryptoipsec transform-set set1 esp-des esp-md5-hmac!crypto dynamic-map dymap 1 set transform-set set1 reverse-route!crypto map vpnmapisakmp authorization list ezvpnauthor crypto map vpnmap client configuration address respond crypto map vpnmap 1 ipsec-isakmp dynamic dymap!
!interface Ethernet0/0 noip address shutdown half-duplex!interface Ethernet0/1 ip address 192.168.2.2 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex crypto map vpnmap!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.200.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex!ip local pool ezvpnpool 10.10.10.1 10.10.10.100 ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.2.1!ipnat inside source list 111 interface Ethernet0/1 overload!access-list 1 permit any access-list 100 permit ip 192.168.200.0 0.0.0.255 any access-list 111 deny
ip 192.168.200.0 0.0.0.255 10.10.10.0 0.0.0.255 access-list 111 deny
ip 192.168.200.0 0.0.0.255 192.168.100.0 0.0.0.255 access-list 111 permit ip any any!!control-plane!!
?。。?line con 0 exec-timeout 0 0 line aux 0 linevty 0 4!end
R3#
R1上的配置 R1#show run
Building configuration...Current configuration : 1396 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R1!boot-start-marker boot-end-marker!noaaa new-model memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3?。。。。。。。。。?!!
cryptoipsec client ezvpn client1 connect auto group group1 key cisco mode client peer 192.168.2.2 xauthuserid mode interactive cryptoipsec client ezvpn client connect auto mode network-extension xauthuserid mode interactive??!!interface Loopback0 ip address 10.10.10.1 255.255.255.255!interface Ethernet0/0 ip address 192.168.1.1 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex cryptoipsec client ezvpn client1!interface Ethernet0/1 noip address shutdown half-duplex!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.100.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex cryptoipsec client ezvpn client1 inside!ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.1.2!ipnat inside source list 1 interface Ethernet0/0 overload!access-list 1 permit any!!control-plane?。。。?!line con 0 exec-timeout 0 0 line aux 0 linevty 0 4 login!end
R1#
在R1上查看vpn狀態(tài)
我們看到,當(dāng)R1為client模式的時候,它將獲取地址池中的一個地址,為10.10.10.7,所有vpn流量,都會用這個地址進(jìn)行nat轉(zhuǎn)換。我們看R1上的show ipnat translation
在R1上測試網(wǎng)絡(luò)連通性
在R3上測試聯(lián)通性
由于R1內(nèi)部機(jī)器地址都會被NAT成10.10.10.7,所以,對于R3內(nèi)部用戶來說是不可訪問的。
配置xauth認(rèn)證 R3的配置 R3# R3#show run
Building configuration...Current configuration : 1941 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R3!boot-start-marker boot-end-marker!aaa new-model!aaa authentication login ezvpnlogin local aaa authorization network ezvpnauthor local!aaa session-id common memory-sizeiomem 5!
ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3?。。。。。?!!username cisco password 0 cisco!
!!cryptoisakmp policy 1 authentication pre-share group 2!cryptoisakmp client configuration group group1 key cisco poolezvpnpool acl 100!cryptoipsec transform-set set1 esp-des esp-md5-hmac!crypto dynamic-map dymap 1 set transform-set set1 reverse-route!crypto map vpnmap client authentication list ezvpnlogin crypto map vpnmapisakmp authorization list ezvpnauthor crypto map vpnmap client configuration address respond crypto map vpnmap 1 ipsec-isakmp dynamic dymap!!interface Ethernet0/0 noip address shutdown half-duplex!interface Ethernet0/1 ip address 192.168.2.2 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex crypto map vpnmap!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.200.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex!ip local pool ezvpnpool 10.10.10.1 10.10.10.100 ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.2.1!ipnat inside source list 111 interface Ethernet0/1 overload!access-list 1 permit any access-list 100 permit ip 192.168.200.0 0.0.0.255 any access-list 111 deny
ip 192.168.200.0 0.0.0.255 10.10.10.0 0.0.0.255 access-list 111 deny
ip 192.168.200.0 0.0.0.255 192.168.100.0 0.0.0.255 access-list 111 permit ip any any!!control-plane?。。。?!line con 0 exec-timeout 0 0 line aux 0 linevty 0 4!end
R3#
R1上的過程
提示輸入crypto ipsec client ezvpnxauth,并輸入用戶名和密碼,VPN則認(rèn)證成功。另外,cisco VPN Clint 支持Ezvpn client模式。
新建連接信息如下圖所示:
第五篇:E1總結(jié)和CISCO E1配置
E1總結(jié)和CISCO E1配置
E1知識點總結(jié)
1、一條E1是2.048M的鏈路,用PCM編碼。
2、一個E1的幀長為256個bit,分為32個時隙,一個時隙為8個bit。
3、每秒有8k個E1的幀通過接口,即8K*256=2048kbps。
4、每個時隙在E1幀中占8bit,8*8k=64k,即一條E1中含有32個64K。
E1幀結(jié)構(gòu)
E1有成幀,成復(fù)幀與不成幀三種方式,在成幀的E1中第0時隙用于傳輸幀同步數(shù)據(jù),其余31個時隙可以用于傳輸有效數(shù)據(jù);在成復(fù)幀的E1中,除了第0時隙外,第16時隙是用于傳輸信令的,只有第1到15,第17到第31共30個時隙可用于傳輸有效數(shù)據(jù);而在不成幀的E1中,所有32個時隙都可用于傳輸有效數(shù)據(jù).一. E1基礎(chǔ)知識
E1信道的幀結(jié)構(gòu)簡述
在E1信道中,8bit組成一個時隙(TS),由32個時隙組成了一個幀(F),16個 幀組成一個復(fù)幀(MF)。在一個幀中,TS0主要用于傳送幀定位信號(FAS)、CRC-4(循環(huán)冗余校驗)和對端告警指示,TS16主要傳送隨路信令(CAS)、復(fù)幀定 位信號和復(fù)幀對端告警指示,TS1至TS15和TS17至TS31共30個時隙傳送話音或數(shù)據(jù) 等信息。我們稱TS1至TS15和TS17至TS31為“凈荷”,TS0和TS16為“開銷”。如果采用帶外公共信道信令(CCS),TS16就失去了傳送信令的用途,該時隙也可用來傳送信息信號,這時幀結(jié)構(gòu)的凈荷為TS1至TS31,開銷只有TS0了。
由PCM編碼介紹E1:
由PCM編碼中E1的時隙特征可知,E1共分32個時隙TS0-TS31。每 個時隙為64K,其中TS0為被幀同步碼,Si, Sa4, Sa5, Sa6,Sa7 ,A比特占用, 若系統(tǒng)運用了CRC校驗,則Si比特位置改傳CRC校驗 碼。TS16為信令時隙, 當(dāng)使用到信令(共路信令或隨路信令)時,該 時隙用來傳輸信令, 用戶不可用來傳輸數(shù)據(jù)。所以2M的PCM碼型有
① PCM30 : PCM30用戶可用時隙為30個, TS1-TS15, TS17-TS31。TS16傳送信令,無CRC校驗。
② PCM31: PCM30用戶可用時隙為31個, TS1-TS15, TS16-TS31。TS16不傳送信令,無CRC校驗。③ PCM30C: PCM30用戶可用時隙為30個, TS1-TS15, TS17-TS31。TS16傳送信令,有CRC校驗。
④ PCM31C: PCM30用戶可用時隙為31個, TS1-TS15, TS16-TS31。TS16不傳送信令,有CRC校驗。
CE1,就是把2M的傳輸分成了30個64K的時隙,一般寫成N*64,你可以利用其中的幾個時隙,也就是只利用n個64K,必須接在ce1/pri上。
CE1----最多可有31個信道承載數(shù)據(jù) timeslots 1----31 timeslots 0 傳同步
二. 接口
G.703非平衡的75 ohm,平衡的120 ohm2種接口
三. 使用E1有三種方法,1,將整個2M用作一條鏈路,如DDN 2M;
2,將2M用作若干個64k及其組合,如128K,256K等,這就是CE1;
3,在用作語音交換機(jī)的數(shù)字中繼時,這也是E1最本來的用法,是把一條E1作為32個64K來用,但是時隙0和時隙15是用作signaling即信令的,所以一條E1可以傳30路話音。PRI就是其中的最常用的一種接入方式,標(biāo)準(zhǔn)叫PRA信令。
用2611等的廣域網(wǎng)接口卡,經(jīng)V.35-G.703轉(zhuǎn)換器接E1線。這樣的成本應(yīng)該比E1卡低的
目前DDN的2M速率線路通常是經(jīng)HDSL線路拉至用戶側(cè).E1可由傳輸設(shè)備出的光纖拉至用戶側(cè)的光端機(jī)提供E1服務(wù).四. 使用注意事項
E1接口對接時,雙方的E1不能有信號丟失/幀失步/復(fù)幀失步/滑碼告警,但是雙方在E1接口參數(shù)上必須完全一致,因為個別特性參數(shù)的不一致,不會在指示燈或者告警臺上有任何告警,但是會造成數(shù)據(jù)通道的不通/誤碼/滑碼/失步等情況。這些特性參數(shù)主要有;阻抗/ 幀結(jié)構(gòu)/CRC4校驗,阻有75ohm和120ohm兩種,幀結(jié)構(gòu)有PCM31/PCM30/不成幀三種;在新橋節(jié)點機(jī)中將PCM31和PCM30分別描述為CCS和CAS,對接時要告訴網(wǎng)管人員選擇CCS,是否進(jìn)行CRC校驗可以靈活選擇,關(guān)鍵要雙方一致,這樣采可保證物理層的正常。
五.問題
: 1.E1 與 CE1是由誰控制,電信還是互連的兩側(cè)的用戶設(shè)備?用戶側(cè)肯定要求支持他們 :,電信又是如何 分別實現(xiàn)的。
首先由電信決定,電信可提供E1和CE1兩種線路,但一般用戶的E1線路都是 CE1,除非你特別要只用E1,然后才由你的設(shè)備所決定,CE1可以當(dāng)E1用,但 E1卻不可以作CE1。
: 2.CE1 是32個時隙都可用是吧?
CE1的0和16時隙不用,0是傳送同步號,16傳送控制命令,實際能用的只有30個 時隙1-15,16-30
: 3.E1/CE1/PRI又是如何區(qū)分的和通常說的2M的關(guān)系。和DDN的2M又如何關(guān)聯(lián)?。?E1 和CE1 都是E1線路標(biāo)準(zhǔn),PRI是ISDN主干線咱,30B+D,DDN的2M是透明線路 你可以他上面跑任何協(xié)議。
E1和CE1的區(qū)別,當(dāng)然可不可分時隙了。
: 4.E1/CE1/PRI與信令、時隙的關(guān)系
E1,CE1,都是32時隙,30時隙,0、16分別傳送同步信號和控制信今,PRI采用 30B+D,30B傳數(shù)據(jù),D信道傳送信令,E1都是CAS結(jié)構(gòu),叫帶內(nèi)信令,PRI信令與 數(shù)據(jù)分開傳送,即帶外信令。
: 5.CE1可否接E1。
CE1 和E1 當(dāng)然可以互聯(lián)。但CE1必需當(dāng)E1用,即不可分時隙使用。
: 6.為實現(xiàn)利用CE1實現(xiàn)一點對多點互連,此時中心肯定是2M了,各分支速率是 N*64K<2M,分支物理上怎么接呢? 電信如何控制電路的上下和分開不同地點呢?
在你設(shè)備上劃分時隙,然到在電信的節(jié)點上也劃分一樣同樣的時隙順序,電信 只需要按照你提供的時隙順序和分支地點,將每個對應(yīng)的時隙用DDN線路傳到對應(yīng) 分支點就行了。
: 7.CE1端口能否直接連接E1電纜,與對端路由器的E1端口連通 :.................(以下省略)不行
8.Cisco 7000系列上的ME1與Cisco 2600/3600上的E1、CE1有什么區(qū)別? 答 : Cisco 7000上的ME1可配置為E1、CE1,而Cisco 2600/3600上的E1、CE1僅支持自己的功能。
六. 配置 補充: 光端機(jī)用法:
光纖---光端機(jī)--同軸線---G703轉(zhuǎn)v35轉(zhuǎn)換器--同步串口 or BNC-DB15,BNC-RJ45 --- CE1
● 業(yè)務(wù)配置
1、使用下面命令使E1線路實現(xiàn)多個64K專線連接.任務(wù) 命令
進(jìn)入controller配置模式 controller {t1 | e1} number
選擇幀類型
framing {crc4 | no-crc4}
選擇line-code類型
linecode {ami | b8zs | hdb3}
建立邏輯通道組與時隙的映射 channel-group number timeslots range1
顯示controllers接口狀態(tài) show controllers e1 <2 o:p>
2、鏈路為E1時, channel-group編號為0-30, Timeslot范圍1-31.3、使用show controllers e1觀察controller狀態(tài),以下為幀類型為crc4時controllers正常的狀態(tài)
Router# show controllers e1 E1 2/0 is up.Applique type is Channelized E1-balanced
Deion: To DiWang Office
No alarms detected.alarm-trigger is not set
Framing is NO-CRC4, Line Code is HDB3, Clock Source is Line.Data in current interval(492 seconds elapsed):
0 Line Code Violations, 0 Path Code Violations
0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins
0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs
Total Data(last 24 hours)
0 Line Code Violations, 0 Path Code Violations,0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins,0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs
4、以下配置為E1連3條64K專線, 幀類型為NO-CRC4,非平衡鏈路,路由器具體配置如下:
Router# Building configuration...Current configuration:!version 11.2 no service udp-small-servers no service tcp-small-servers!hostname Router!enable secret 5 $1$XN08$Ttr8nfLoP9.2RgZhcBzkk/ enable password Router!ip subnet-zero!controller E1 0 framing NO-CRC4 channel-group 0 timeslots 1 channel-group 1 timeslots 2 channel-group 2 timeslots 3!interface Ethernet0 ip address 133.118.40.1 255.255.0.0 media-type 10BaseT!interface Ethernet1 no ip address shutdown!interface Serial0:0 ip address 202.119.96.1 255.255.255.252 no ip mroute-cache!interface Serial0:1 ip address 202.119.96.5 255.255.255.252 no ip mroute-cache!interface Serial0:2 ip address 202.119.96.9 255.255.255.252 no ip mroute-cache!no ip classless ip route 133.210.40.0 255.255.255.0 Serial0:0 ip route 133.210.41.0 255.255.255.0 Serial0:1 ip route 133.210.42.0 255.255.255.0 Serial0:2!line con 0 line aux 0 line vty 0 4 password Router login!end----談?wù)凜isco IOS的E1端口配置技巧
在Cisco 4500,4700,7000和7500系列里面均支持E1(2.048Mbps)數(shù)率的接口。每一個E1端口可以按時隙分成30路64K數(shù)據(jù)線路和2路信號線路。這30個64K數(shù)據(jù)線路每一路均可以當(dāng)作一條64K的專線。
功 能 命 令
在配置模式下,定義Controller E1 controller e1 slot/port
定義line code linecode {ami |hdb3}
定義字符幀 framing {crc4 |no-crc4}
定義E1組 channel-group number timeslots range [speed {48| 56| 64}]
指定串口屬于那一個channel-group組 interface serial slot/port:channel-group
注:
slot/port——是針對7000或7500系列的,故區(qū)分槽口號和端口號。
linecode——默認(rèn)是HDB3.framing——默認(rèn)是crc4,要與電信局參數(shù)匹配。
channel-group——每個E1可以分成30個channel-group,把channel-group和時間
槽對應(yīng)起來。channel-group是0-30,timeslots是1-31.interface serial——在定義完E1 channel-group后,我們把group賦予成一個虛擬串口------------------E1配置(轉(zhuǎn)貼)E1接口介紹
E1接口可有兩種配置:
l 作為信道化(Channelized)E1接口使用。
接口在物理上分為31個時隙,可以任意地將全部時隙分成若干組,每組時隙捆綁以后作為一個接口使用,其邏輯特性與同步串口相同,支持PPP、幀中繼、LAPB和X.25等鏈路層協(xié)議。
l 作為非信道化(Unchannelized)E1接口使用。
接口在物理上作為一個2M速率的G.703同步串口,支持PPP、幀中繼、LAPB和X.25等鏈路層協(xié)議。
E1接口配置
配置E1接口,首先必須在全局配置態(tài)下輸入controller E1命令。
命令 作用
controller E1
slot為E1控制器所在的槽號,group為E1控制器的鏈路號。
注: 3700系列路由器中E1控制器為“controller E1 0/0”,5000系列路由器中對于一口E1控制器,鏈路號范圍為0-0,對于四口E1控制器,鏈路號范圍為0-3。E1控制器槽號為1-4。
舉例:
Router_config#controller E1 0/0
Router_config_controller_E1_0/0#
E1接口的配置任務(wù)包括:
l 配置E1接口的物理參數(shù),包括幀校驗方式、線路編解碼格式和線路時鐘、回環(huán)傳輸模式等。一般采用缺省參數(shù)即可。
l 信道化(Channelized)E1接口要求配置channel-group參數(shù),確定時隙捆綁方式。
l 非信道化(Unchannelized)E1接口不需配置channel-group參數(shù)。
l 配置接口(Interface)參數(shù),配置E1接口的工作方式
E1接口缺省為信道化(Channelized)方式??赏ㄟ^unframed命令設(shè)置為非信道化(Unchannelized)方式。
命令 作用
unframed 配置為非信道化(Unchannelized)方式
no unframed 配置為信道化(Channelized)方式
舉例:
Router_config#controller E1 0/0
Router_config_controller_E1_0/0# unframed
Router_config_controller_E1_0/0# no unframed
配置E1接口的幀校驗方式
E1接口支持對物理幀進(jìn)行CRC32校驗,缺省為不校驗。
命令 作用 framing crc4 配置E1接口的幀校驗方式為4字節(jié)CRC校驗
no framing 或
framing no-crc4 配置E1接口的不進(jìn)行幀校驗
配置E1接口的線路編解碼格式
E1接口支持兩種線路編解碼格式:AMI格式和HDB3格式
缺省為HDB3格式。
命令 作用
linecode ami 配置E1接口的線路編解碼格式為AMI格式
no linecode 或
linecode hdb3 配置E1接口的線路編解碼格式為HDB3格式
配置E1接口的時鐘方式
當(dāng)E1作為同步接口使用時,同樣有DTE和DCE兩種工作方式,也需要選擇線路時鐘。當(dāng)兩臺路由器的E1接口直接相連時,必需使兩端分別工作在DTE和DCE方式;當(dāng)路由器的E1接口與交換機(jī)連接時,交換機(jī)為DCE設(shè)備,而路由器的E1接口需工作在DTE方式。
E1接口缺省工作在DTE方式。
命令 作用
clock internal 配置E1接口工作在DCE方式,使用芯片內(nèi)部同步信號
clock external
no clock 配置E1接口工作在DTE方式,使用線路同步信號
配置E1接口的回環(huán)傳輸模式
在遠(yuǎn)端回環(huán)傳輸模式下,E1將端口上收到的報文從收到的通道上送回。
命令 作用
loopback local 配置E1接口工作在遠(yuǎn)端回環(huán)方式
no loop 取消遠(yuǎn)端回環(huán)設(shè)置
配置E1的發(fā)送脈沖模式
選擇發(fā)送脈沖模式。當(dāng)電纜類型為120Ω雙絞線時,應(yīng)執(zhí)行Cable 120時。缺省時,默認(rèn)為75Ω銅軸電纜(no cable),遵守ITU-T G.703標(biāo)準(zhǔn)。兩者發(fā)送脈沖不同。
命令 作用
Cable 120 配置E1接口電纜類型為120Ω雙絞線
No cable 缺省為75Ω同軸電纜。
禁止E1接口鏈路
可以禁止某個E1接口的使用。使端口上所有interface的line的狀態(tài)均為down。
命令 作用
Shutdown 禁止該E1接口鏈路
No shutdown 恢復(fù)E1接口鏈路的使用
舉例:
Router_config#controller E1 0/0
Router_config_controller_E1_0/0#shutdown
Router_config_controller_E1_0/0#no shutdown
配置E1接口的channel-group參數(shù)
channel-group為E1通道號,范圍為0-30,timeslot為E1時隙號,范圍為1-31。通道可以占用任何未分配的時隙,并能夠任意組合時隙。E1通道配置成功后產(chǎn)生新的interface。
no channel-group清除channel-group的時隙捆綁,相應(yīng)的interface也被刪除。
命令 作用
channel-group channel-group timeslots { number | number1-number2 } [,number | number1-number2...] 將E1接口的時隙捆綁為channel-group
no channel-group channel-group 取消channel-group時隙捆綁
舉例:
Router_config#controller E1 0/0
Router_config_controller_E1_0/0#channel 5 timeslots 18,11-13,20,22,30-28,24-25
Router_config_controller_E1_0/0#interface s0/0:5
Router_config_interface_s0/0:5#
配置E1接口的interface參數(shù)
E1接口在信道化(Channelized)方式下,當(dāng)配置的channel-group參數(shù)后,系統(tǒng)產(chǎn)生新的interface。其邏輯特性與同步串口相同。名字為serial
可在該interface上封裝PPP、幀中繼、HDLC和X.25等 鏈路層協(xié)議。
舉例:
信道化(Channelized)方式下:
Router_config#controller E1 0/0
Router_config_controller_E1_0/0#channel 1 timeslots 1-31
Router_config_controller_E1_0/0#int s0/0:1
Router_config_controller_s0/0:1#enca fr
Router_config_controller_s0/0:1#ip add 130.130.0.1 255.255.255.0
非信道化(Unchannelized)方式下:
Router_config#controller E1 0/0
Router_config_controller_E1_0/0#unframed
Router_config_controller_E1_0/0#int s0/0:0
Router_config_controller_s0/0:0#enca fr
Router_config_controller_s0/0:0#ip add 130.130.0.1 255.255.255.0