一 交換機配置
1.交換機的基本配置
Enable 進入特權模式
Config terminal 進入配置模式
Enable password cisco 設置enable password 爲 cisco
Enable secret cisco1 設置enable secret 爲 cisco1
Hostname SW1 設置主機名爲SW1
End 回到特權模式
Ip address 192.168.3.1 255.255.255.0 設置交換機的ip地址
Ip default-gateway 192.168.3.254 設置默認網關
Ip domain-name cisco.com 設置域名
Ip name-server 10.0.0.1 設置域名服務器
Interface f0/1 進入接口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的狀態
Mac-address-table aging-time 100 設置超時時間爲100s
Mac-address-table permanent 0000.0c01.bbcc f0/3 加入永久地址
Clear mac-address-table restricted static 清除限制地址
2.VLAN配置
Vlan database 進入vlan配置子模式
Vtp mode server 設置本交換機爲server模式
Vtp domain cisco 設置域名爲cisco
Vtp pruning 啓動修剪功能
Show vtp status 查看vtp設置信息
Vtp mode client 設置本交換機爲client模式
Switchport mode trunk 設置當前端口爲trunk模式
Switchport trunk allowed vlan all 設置允許從該端口交換數據的vlan
Switchport trunk allowed vlan remove 1 去掉vlan 1
Vlan 3 name vlan3 創建一個vlan3,命名爲vlan3
Switchport mode access 設置端口爲靜態vlan訪問模式
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生成樹路徑值爲30
二.路由器配置
1. 路由器的基本配置
Ip address 192.168.4.1 255.255.255.0 設置接口地址
No shutdown 激活接口
Show running-config 檢查配置結果
Line 1 8
No exec 禁止在line1到8這8條異步線路上產生exec進程,而只允許線路出境
1.交換機的基本配置
Enable 進入特權模式
Config terminal 進入配置模式
Enable password cisco 設置enable password 爲 cisco
Enable secret cisco1 設置enable secret 爲 cisco1
Hostname SW1 設置主機名爲SW1
End 回到特權模式
Ip address 192.168.3.1 255.255.255.0 設置交換機的ip地址
Ip default-gateway 192.168.3.254 設置默認網關
Ip domain-name cisco.com 設置域名
Ip name-server 10.0.0.1 設置域名服務器
Interface f0/1 進入接口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的狀態
Mac-address-table aging-time 100 設置超時時間爲100s
Mac-address-table permanent 0000.0c01.bbcc f0/3 加入永久地址
Clear mac-address-table restricted static 清除限制地址
2.VLAN配置
Vlan database 進入vlan配置子模式
Vtp mode server 設置本交換機爲server模式
Vtp domain cisco 設置域名爲cisco
Vtp pruning 啓動修剪功能
Show vtp status 查看vtp設置信息
Vtp mode client 設置本交換機爲client模式
Switchport mode trunk 設置當前端口爲trunk模式
Switchport trunk allowed vlan all 設置允許從該端口交換數據的vlan
Switchport trunk allowed vlan remove 1 去掉vlan 1
Vlan 3 name vlan3 創建一個vlan3,命名爲vlan3
Switchport mode access 設置端口爲靜態vlan訪問模式
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生成樹路徑值爲30
二.路由器配置
1. 路由器的基本配置
Ip address 192.168.4.1 255.255.255.0 設置接口地址
No shutdown 激活接口
Show running-config 檢查配置結果
Line 1 8
No exec 禁止在line1到8這8條異步線路上產生exec進程,而只允許線路出境
Ip route 192.168.1.0 255.255.255.0 10.1.1.1 加入靜態路由
Ip routing 啓動路由功能
2.路由協議的配置
RIP:
No logging console 停止向console 口發送log 信息,以免干擾你在控制檯的操作
Ip routing 允許路由選擇協議
Router rip 進入rip協議配置子模式
Network 192.168.5.0 聲明網絡192.68.5.0/24
IGRP:
Clockrate 500000 該接口時鐘頻率爲500khz
Bandwith 500 接口帶寬爲500Mb/s
Router igrp 100 創建igrp路由進程,自治系統號爲100
Nerwork 192.168.3.0 聲明網絡段192.168.3.0/24
OSPF:
Router ospf 120 啓用ospf協議,自治系統號爲120
Network 192.200.10.4 0.0.03 area 0 指定與該路由器相連的網絡192.200.10.4,它連接的是主幹網
EIGRP:
Router eigrp 90 啓用eigrp路由協議,它的進程號爲90
Network 192.200.10.0 0.0.0.3 指定與該路由器相連的網絡爲192.200.10.0
No auto-summary 關閉路由自動彙總功能
三.廣域網接入配置
1.ISDN配置
Isda switch-type basic.net3 設置交換機類型爲 basic.net
Interface bri 0 進入bri接口配置模式
Encapsulation ppp 設置封裝協議爲ppp
Dialer string 80000002 設置撥號串,R2的isdn號碼
Dialer-group 1 設置撥號組號爲1,把bri0接口與撥號列表1相關聯
Dialer-list 1 protocol ip permit 設置撥號列表1
2.PPP和DDR配置
Username R2 password 0 cisco 設置用戶名和密碼
Dialer idle-timeout 300 設置撥號空閒時間爲300s
Dialer map ip 192.168.5.2 name R2 broadcast 80000002 設置撥號映射,R1的映射爲ip地址192.168.5.2,主機名R2,ISDN號爲80000002.
Dialer load-threshold 128 PPP multilink
設置多鏈路,當設置爲1時,表示不論負載多大同時啓動2個B信道
No cdp enable 禁用CDP協議
PPP authentication chap 設置PPP認證方式爲CHAP
3.幀中繼配置
No ip address
Encapsulation frame-relay 設置frame-relay封裝
Frame-relay lmi-type cisco 設置frame-relay LMI類型爲cisco
Frame-relay lmi-type dce 設置frame-relay LMI 類型爲 dce
Frame-relay route 102 interface serial2 201
Frame-relay route 103 interface serial3 301
No frame-relay inverse-arp 關閉幀中繼逆向ARP
Frame map ip 192.168.5.2 cisco 映射協議地址與DLCI
四.L2TP配置
***d-group 1 創建vpdn組1,並進入vpdn組1的配置模式
Accept-dialin protocol l2tp virtual-template 1 terminate-from hostname host1 接受l2tp通道連接請求,並根據virtual- template1創建virtual-access接口,遠端的主機名爲host1
Local name mm 設置tunnel本端名稱爲mm
Lcp renegotiation always LCP再次協商
No l2tp authentication 設置不驗證通道對端
五IPSec配置
Crypto isakmp policy 10 創建標識爲“10”的IKE策略
Hash md5 採用MD5 散列算法
Authentication pre-share 採用預共享密鑰認證
Crypto isakmp key mcns address 172.17.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 配置加密圖,名稱:sharef,序號:10;指定用IKE來建立IPsec安全關聯,以保護由該加密圖條目所指定的數據流
Set peer 172.17.2.1 指定允許的IPsec對等體IP地址爲172.16.2.1
Set transform-set 1&2 此交換圖應用交換集1&2
Match address 162
Interface serial 0 配置接口
Ip address 172.17.1.1 255.255.255.252
Ip access-group 101 in
Crypto map sharef 此接口應用名爲sharef的加密圖進行加密
end
六.PIX防火牆配置
配置防火牆的網卡參數:
Interface Ethernet0 auto
配置防火牆內外網卡的IP地址
Ip address inside
Ip address outside
指定外部網卡的ip地址範圍
Global 1
指定要進行轉換的內部地址A
FW(config)#global (outside) 1 61.144.51.42-61.144.51.48
表示內網的主機通過pix防火牆要訪問外網時,pix防火牆將使用61.144.51.42-61.144.51.48這段ip地址池爲要訪問外網的主機分配一個全局ip地址。
1.ISDN配置
Isda switch-type basic.net3 設置交換機類型爲 basic.net
Interface bri 0 進入bri接口配置模式
Encapsulation ppp 設置封裝協議爲ppp
Dialer string 80000002 設置撥號串,R2的isdn號碼
Dialer-group 1 設置撥號組號爲1,把bri0接口與撥號列表1相關聯
Dialer-list 1 protocol ip permit 設置撥號列表1
2.PPP和DDR配置
Username R2 password 0 cisco 設置用戶名和密碼
Dialer idle-timeout 300 設置撥號空閒時間爲300s
Dialer map ip 192.168.5.2 name R2 broadcast 80000002 設置撥號映射,R1的映射爲ip地址192.168.5.2,主機名R2,ISDN號爲80000002.
Dialer load-threshold 128 PPP multilink
設置多鏈路,當設置爲1時,表示不論負載多大同時啓動2個B信道
No cdp enable 禁用CDP協議
PPP authentication chap 設置PPP認證方式爲CHAP
3.幀中繼配置
No ip address
Encapsulation frame-relay 設置frame-relay封裝
Frame-relay lmi-type cisco 設置frame-relay LMI類型爲cisco
Frame-relay lmi-type dce 設置frame-relay LMI 類型爲 dce
Frame-relay route 102 interface serial2 201
Frame-relay route 103 interface serial3 301
No frame-relay inverse-arp 關閉幀中繼逆向ARP
Frame map ip 192.168.5.2 cisco 映射協議地址與DLCI
四.L2TP配置
***d-group 1 創建vpdn組1,並進入vpdn組1的配置模式
Accept-dialin protocol l2tp virtual-template 1 terminate-from hostname host1 接受l2tp通道連接請求,並根據virtual- template1創建virtual-access接口,遠端的主機名爲host1
Local name mm 設置tunnel本端名稱爲mm
Lcp renegotiation always LCP再次協商
No l2tp authentication 設置不驗證通道對端
五IPSec配置
Crypto isakmp policy 10 創建標識爲“10”的IKE策略
Hash md5 採用MD5 散列算法
Authentication pre-share 採用預共享密鑰認證
Crypto isakmp key mcns address 172.17.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 配置加密圖,名稱:sharef,序號:10;指定用IKE來建立IPsec安全關聯,以保護由該加密圖條目所指定的數據流
Set peer 172.17.2.1 指定允許的IPsec對等體IP地址爲172.16.2.1
Set transform-set 1&2 此交換圖應用交換集1&2
Match address 162
Interface serial 0 配置接口
Ip address 172.17.1.1 255.255.255.252
Ip access-group 101 in
Crypto map sharef 此接口應用名爲sharef的加密圖進行加密
end
六.PIX防火牆配置
配置防火牆的網卡參數:
Interface Ethernet0 auto
配置防火牆內外網卡的IP地址
Ip address inside
Ip address outside
指定外部網卡的ip地址範圍
Global 1
指定要進行轉換的內部地址A
FW(config)#global (outside) 1 61.144.51.42-61.144.51.48
表示內網的主機通過pix防火牆要訪問外網時,pix防火牆將使用61.144.51.42-61.144.51.48這段ip地址池爲要訪問外網的主機分配一個全局ip地址。
FW(config)#conduit permit tcp host 192.168.0.8 eq www any
這個例子表示允許任何外部主機對全局地址192.168.0.8的這臺主機進行http訪問。其中使用eq和一個端口來允許或拒絕對這個端口的訪問。Eq ftp 就是指允許或拒絕只對ftp的訪問。
這個例子表示允許任何外部主機對全局地址192.168.0.8的這臺主機進行http訪問。其中使用eq和一個端口來允許或拒絕對這個端口的訪問。Eq ftp 就是指允許或拒絕只對ftp的訪問。