一、交換機配置
1. 交換機的基本配置
Enable 進(jìn)入特權模式
Config terminal 進(jìn)入配置模式
Enable password cisco 設置enable password 為 cisco
Enable secret cisco1 設置enable secret 為 cisco1
Hostname host1 設置主機名為host1
End 回到特權模式
Ip address 192.168.1.1 255.255.255.0 設置交換機的ip地址
Ip default-gateway 192.168.1.254 設置默認網(wǎng)關(guān)
Ip domain-name cisco.com 設置域名
Ip name-server 200.0.0.1 設置域名服務(wù)器
Interface f0/1 進(jìn)入接口f0/1的配置模式
Speed 100 設置該端口速率為100Mb/s
Duplex full 設置該端口為全雙工
Description to-pc1 設置該端口描述為to-pc1
Show interface fastethernet0/1 查看端口f0/1的配置結果
Show interface fastethernet0/1 status 查看端口f0/1的狀態(tài)
Mac-address-table aging-time 100 設置超時(shí)時(shí)間為100s
Mac-address-table permanent 0000.0c01.bbcc f0/3 加入永久地址
Mac-address-table restricted static 0000.0c02.bbcc f0/6 f0/7 加入靜態(tài)地址
Clear mac-address-table restricted static 清除限制地址
2.VLAN配置
Vlan database 進(jìn)入vlan配置子模式
Vtp server 設置本交換機為server模式
Vtp domain vtpserver 設置域名為vtpserver
Vtp pruning 啟動(dòng)修剪功能
Show vtp status 查看vtp設置信息
Vtp client 設置本交換機為client模式
Switchport mode trunk 設置當前端口為trunk模式
Switchport trunk allowed vlan all 設置允許從該端口交換數據的vlan
Switchport trunk allowed vlan remove vlan 1 去掉vlan 1
Vlan 3 name v3 創(chuàng )建一個(gè)vlan3,命名為v3
Switchport mode access 設置端口為靜態(tài)vlan訪(fǎng)問(wèn)模式
Switchport access vlan 2 把端口xx分配給vlan2
Show vlan 查看vlan配置信息
3.STP配置
Spanning-tree vlan 1 port-priority 10 將vlan 1 的端口權值設為10
Spanning-tree vlan 2 cost 30 設置vlan 2生成樹(shù)路徑值為30
二、路由器配置
1.路由器的基本配置
Ip address 192.168.1.11 255.255.255.0 設置接口地址
No shutdown 激活接口
Show running-config 檢查配置結果
Ip host router 主機表
Line 1 8
No exec 禁止在line1到8這8條異步線(xiàn)路上產(chǎn)生exec進(jìn)程,而只允許線(xiàn)路出境
Transport input all 所有協(xié)議可用于連接到指定的路由器線(xiàn)路
Show session 查看終端服務(wù)器的會(huì )話(huà)
Disconnect 2 斷開(kāi)會(huì )話(huà)2
Show line 1 查看線(xiàn)路1的狀態(tài)
Clear line 2 清除線(xiàn)路2
Ip route 192.168.1.0 255.255.255.0 10.1.1.1 加入靜態(tài)路由
Ip routing 啟動(dòng)路由功能
2.路由協(xié)議的配置
RIP:
No logging console 停止向console 口發(fā)送log 信息,以免干擾你在控制臺的操作
Ip routing 允許路由選擇協(xié)議
Router rip 進(jìn)入rip協(xié)議配置子模式
Network 192.168.5.0 聲明網(wǎng)絡(luò )192.68.1.0/24
IGRP:
No keeplive 此接口不檢測keeplive(存活)信號
Clockrate 500000 該接口時(shí)鐘頻率為500khz
Bandwith 500 接口帶寬為500Mb/s
Router igrp 100 創(chuàng )建igrp路由進(jìn)程,自治系統號為100
Nerwork 192.168.3.0 聲明網(wǎng)絡(luò )段192.168.3.0/24
OSPF:
Router ospf 120 啟用ospf協(xié)議,自治系統號為120
Network 192.200.10.4 0.0.03 area 0 指定與該路由器相連的網(wǎng)絡(luò )192.200.10.4,它連接的是主干網(wǎng)
EIGRP:
Router eigrp 90 啟用eigrp路由協(xié)議,它的進(jìn)程號為90
Network 192.200.10.0 0.0.0.3 指定與該路由器相連的網(wǎng)絡(luò )為192.200.10.0
No auto-summary 關(guān)閉路由自動(dòng)匯總功能
三、廣域網(wǎng)接入配置
1.ISDN配置
Isda switch-type basic.net3 設置交換機類(lèi)型為 basic.net
Interface bri 0 進(jìn)入bri接口配置模式
Encapsulation ppp 設置封裝協(xié)議為ppp
Dialer string 80000002 設置撥號串,R2的isdn號碼
Dialer-group 1 設置撥號組號為1,把bri0接口與撥號列表1相關(guān)聯(lián)
Dialer-list 1 protocol ip permit 設置撥號列表1
2.PPP和DDR配置
Username R2 password 0 cisco 設置用戶(hù)名和密碼
Dialer idle-timeout 300 設置撥號空閑時(shí)間為300s
Dialer map ip 192.168.1.2 name R2 broadcast 80000002 設置撥號映射,R1的映射為ip地址192.168.1.2,主機名R2,ISDN號為80000002.
Dialer load-threshold 128 PPP multilink
設置多鏈路,當設置為1時(shí),表示不論負載多大同時(shí)啟動(dòng)2個(gè)B信道
No cdp enable 禁用CDP協(xié)議
PPP authentication chap 設置PPP認證方式為CHAP
3.幀中繼配置
No ip address
Encapsulation frame-relay 設置frame-relay封裝
Frame-relay lmi-type cisco 設置frame-relay LMI類(lèi)型為cisco
Frame-relay lmi-type dce 設置frame-relay LMI 類(lèi)型為 dce
Frame-relay route 102 interface serial2 201
Frame-relay route 103 interface serial3 301
No frame-relay inverse-arp 關(guān)閉幀中繼逆向ARP
Frame map ip 192.168.1.2 cisco 映射協(xié)議地址與DLCI
四、L2TP配置
Vpnd-group 1 創(chuàng )建vpdn組1,并進(jìn)入vpdn組1的配置模式
Accept-dialin protocol l2tp virtual-template 1 terminate-from hostname host1 接受l2tp通道連接請求,并根據virtual-template1創(chuàng )建virtual-access接口,遠端的主機名為host1
Local name mm 設置tunnel本端名稱(chēng)為mm
Lcp renegotiation always LCP再次協(xié)商
No l2tp authentication 設置不驗證通道對端
五、IPSec配置
Crypto isakmp policy 100 創(chuàng )建標識為“100”的IKE策略
Hash md5 采用MD5 散列算法
Authentication pre-share 采用預共享密鑰認證
Crypto isakmp key mcns address 172.16.2.1 與遠端ip為172.16.2.1的對等體的共享密鑰為“mcns”
Crypto ipsec transform-set 1&2 esp-des eap-md5-hmac 配置名為1&2的交換集,指定esp-des和esp-md5-hmac這兩種變換
Crypto map sharef 10 ipsec-isakmp 配置加密圖,名稱(chēng):sharef,序號:10;指定用IKE來(lái)建立IPsec安全關(guān)聯(lián),以保護由該加密圖條目所指定的數據流
Set peer 172.6.2.1 指定允許的IPsec對等體IP地址為172.16.2.1
Set transform-set 1&2 此交換圖應用交換集1&2
Match address 162
Interface serial 0 配置接口
Ip address 172.16.1.1 255.255.255.252
Ip access-group 101 in
Crypto map sharef 此接口應用名為sharef的加密圖進(jìn)行加密
end
六、PIX防火墻配置
配置防火墻的網(wǎng)卡參數:
Interface Ethernet0 auto
配置防火墻內外網(wǎng)卡的IP地址
Ip address inside
Ip address outside
指定外部網(wǎng)卡的ip地址范圍
Global 1
指定要進(jìn)行轉換的內部地址
Nat 1
配置某些控制選項
Conduit