Cisco-CCNA實驗筆記

CCNA實驗筆記

 

基礎:

1、修改名稱 hostname **

2、準備工作 no ip domain-lookup 關閉域名解析

            no exec-timeout     關閉退出時間

            logging synchronous 日誌同步

密碼設置:

1enable password ***

   service password-encryption (啓動明文密碼加密)

2enable secret ***

 

登錄設備:

1console

   line console 0

      no exec-timeout

      logging synchronous

      login

      password *** (配置登錄密碼)

2telnet

    line vty 0 4

       login

       password ***

3SSH

   username *** password ***

      line vty 0 4

      login local

      transport input ssh (all是默認的、 none)

   ip domain-name ***

      crypto key generate rsa

   登錄:特 ssh  -l ***(username) *** (IP地址)

            password ***

 

CDP 思科發現協議 (數據鏈路層協議)

show cdp neighbors

show cdp entry *

no cdp run (關閉全部)

no cdp enable (關閉某個接口的CDP)

 

密碼恢復:

1Router:重啓router & Ctrl+break ——miniIOS ——confreg 0x2142——reload

——copy start run ——改密碼——config-register 0x2102——copy run start

2Switch: 重啓按mode——改config.text 其他後綴文件 (rename flash:config.text flash:config.***)

重啓——rename flash:config.*** flash:config.text——copy flash:config.text running-config ——改密碼+保存

DHCP

ip dhcp pool ***(name)

   network 192.168.1.0 255.255.255.0(任意可用網段和子網掩碼)

   default-router 192.168.1.1 (網段裏的默認路由的IP地址)

   dns-server 8.8.8.8         (DNS服務器的IP地址 )

ip dhcp excluded-address 192.168.1.2(起始地址) 192.168.1.10(終點地址)

ip dhcp excluded-addess 192.168.1.1  (除去網關IP地址)

 

VLAN:

1、創建一個VLan

   vlan **(ID 1-4096)

      name ***

 

2、將接口放入Vlan

   switchport mode access

      switchport access vlan **(ID)

  

   注:將多個連續的接口加入VLan 可以用 range

       interface range f 0/11 - 15

 

3Vlan間的通信——將接口配爲trunk

   switchport mode trunk

 

4VTP 用於傳遞Vlan配置信息 工作在trunk 鏈路上

  vtp domain ***(域名)

     vtp password ***(密碼)

     vtp mode server/client/transparent (server是默認的)

     vtp pruning (vtp 修剪)

 

  show vtp status

  show vtp password

注:接口不屬於VTP,要自己去分配

 

STP:

switchport mode access

   spanning-tree portfast

 

爲路由器接口設置trunk

     interface f 0/0.2(進入子接口)

子接口 encapsulation dot1q  **(Vlan ID)

子接口 ip address 192.168.1.1 255.255.255.0(子接口IP)

交換機安全:

SwitchX(config-if)#switchport port-security [mac-address mac-address

|mac-address sticky [mac-address]|maximum value | violation {restrict | shutdown}]

 

SwitchX(config)#interface fa0/5

SwitchX(config-if)#switchport mode access

SwitchX(config-if)#switchport port-security

SwitchX(config-if)#switchport port-security maximum 1

SwitchX(config-if)#switchport port-security mac-address sticky

SwitchX(config-if)#switchport port-security violation shutdown

 

靜態路由:

  ip route 192.168.23.0 255.255.255.0(目的網段IP地址和子網掩碼) 192.168.1.12(下一跳IP地址)

  ip route 192.168.23.0 255.255.255.0(目的網段IP地址和子網掩碼) f 0/0 (接口號  這種多用於點對點的情況)

默認路由:

  ip route 0.0.0.0 0.0.0.0 192.2.3.1(嚇一跳IP地址)

環回口:

  interface loopback (這和其他接口一樣 但是是默認打開的)

 

RIP

  router rip(打開rip 協議)

     version 1/2 (默認是v1)

     network 192.168.2.0 (申明網段 可以申明多個網段)

 

EIGRP

  router eigrp 100(自治系統號1-65535)

    network 192.168.2.0(申明路由器上的網段 可以申明多個)

    no auto-summary (關閉自動彙總)

 

show ip eigrp neighbors

show ip eigrp topology

 

OSPF

  router ospf 1(路由進程號 本地有效)

**  network 192.168.2.0 0.0.0.255(通配符) area 0(區域號)   (申明路由上的網段 可以申明多個)

  

show ip ospf neighbors

show ip protocols

clear ip route(重新運算協議)

no router rip/eigrp/ospf(刪除某個路由協議的全部配置

 

 

 

 

ACL

1、標準

  access-list **(ID 1-99 1300-1999) permit/deny 源地址+通配符(0表示匹配)

  ip access-group **(ID) in/out

  no access-list **(ID) (表示刪除整個IDACL)

注:在所有列表中 有隱含拒絕全部的語句(access-list **ID deny any)

 

2、擴展

  access-list **(ID 100-199 2000-2699) permit/deny pro(協議) 源地址+通配符 目的地址+通配符 eq 端口號/共識協議

  ip access-group ID in/out

 

3、命名

  ip access-list standard/extended ***(name)

 進入列表 接着原來的命令繼續寫

 

 

 

NAT

1、靜態 nat

  ip nat inside source static 內網IP 外網IP

  ip nat inside/outside

2、動態 nat

  access-list **(ID) permit 內網段+通配符

  ip nat pool ***(name) 外網IP起始地址 外網IP終止地址 netmask 子網掩碼

  ip nat insde source list **(ID) pool **(name)

3PAT

  access-list **(ID) permit 內網段+通配符

  ip nat pool ***(name) 外網IP起始地址 外網IP終止地址 netmask 子網掩碼

  ip nat insde source list **(ID) pool **(name) overload

 

4、特 clear ip nat translation *(星號)

   show ip nat translations

 

5、刪除一個NAT

  no ip nat inside source list **(ID) pool **(name) overload (清除映射關係)

  no ip nat pool **(name)                                    (刪除地址池)

  no access-list **(ID) 

 

 

 

 

 

 

PPP

1PAP (R1是客戶端 R2是服務端)

R2 username **(name) password ***  (R2上創建用戶名數據)

   PPP authentication pap

R1 ppp pap sent-username **(name) password *** (啓用pap認證)

 

2CHAP

R1R2 username ***(對端的主機名) password ***

R1R2 ppp authentication chap      (對應的接口下封裝chap)

 

接口默認的封裝是dhlc 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章