cisco網絡設備基本命令

部署與網絡規劃 命令
三層交換  
開啓路由功能 ip routing
開啓路由接口 no switchport
生成樹STP  
開啓生成樹 spanning-tree vlan vlan-list
指定根網橋 spanning-tree vlan vlan-list root {primary/secondary}
指定根網橋(優先級) spanning-tree vlan vlan-list priority 0-65535
修改端口成本 spanning-tree vlan vlan-list cost cost
修改端口優先級 spanning-tree vlan vlan-list port-priority 0-255
配置速端口 spanning-tree portfast
熱備份路由HSRP  
配置爲HSRP組成員 standby group-number ip 虛擬ip
配置HSRP優先級 standby group-number priority 0-255
配置HSRP佔先權 standby group-number preempt
配置HSRP端口跟蹤 standby group-number track f0/0 interface-priority
IP地址跟蹤 tracert ip
ACL  
標準acl access-list 表號 permit/deny 源ip 反碼
擴展acl access-list 表號 permit/deny 協議 源ip 反碼 目的ip 反碼 eq 端口號
應用到接口 ip access-group 表號 in/out
刪除acl no access-list 表號;no ip access-group 表號;no 序列號;;no acl語句
命名acl ip access-list standard/extended access-list-name
  命名標準 【序列號】permit/deny 源ip 反碼
  命名擴展 【序列號】permit/deny 協議 源ip 反碼 目的ip 反碼 eq 端口號
acl 應用到vty                                             line vty 0 4
                                        access-class 表號 In/out
acl應用到虛接口                                              int vlan vlan-id
                                      ip access-group 表號 in/out
NAT  
建立靜態NAT ip nat inside source static 內部局部ip 內部全局ip
NAT端口映射 ip nat inside source static 協議 內部局部ip 端口號 內部全局ip 端口號 【extendable】
建立動態NAT 1.定義合法ip地址池  ip nat pool pool-name start-ip end-ip netmask mask
  2.實現地址轉換  ip nat inside source list acl表號 pool pool-name
建立PAT 1.定義合法ip地址池  ip nat pool pool-name start-ip end-ip netmask mask
  2.設置PAT地址轉換 ip nat inside source list acl表號 pool pool-name overload
     設置端口複用PAT地址轉換 ip nat inside source list acl表號 int f0/0 overload
接口啓用NAT ip nat inside/outside
部署全部查看命令  
查看stp配置 show spanning-tree 
查看某個vlan生成樹配置 show spanning-tree vlan vlan-id detail
查看hsrp配置 show standby (brief)
查看acl show access-lists
顯示當前存在的轉換 show ip nat translations
顯示nat統計信息 show ip nat statistics
刪除nat全部條目 clear ip nat tanslation *
調試nat debug ip nat 
   
   
路由進階與安全 命令
動態路協議  
配置RIPv1 router rip
  network 直連網段
配置RIPv2 router rip
  version 2
  network 直連網段
  no auto-summary
OSPF路由協議  
配置ospf router ospf 進程號
  network 直連網段 反碼 area area-id
修改接口優先級 ip ospf priority 0-255
修改接口cost值 ip ospf cost 1-65535
OSPF多區域原理與配置  
末梢區域配置 area area-id stub
徹底末梢區域配置 area area-id stub no-summary
OSPF高級配置  
路由重分發 redistribute 協議 metric 度量值 metric-type 1or2 subnets
默認路由重分發 default-information originate metric 度量值 metric-type 1or2
nssa區域配置 area area-id nssa (no-summary)
區域間路由彙總 area area-id range 彙總後ip 子網掩碼
外部路由彙總 summary-address 彙總後ip 子網掩碼
虛鏈路配置 area area-id virtual-link 目的routerid
QOS  
GTS基本配置 traffic-shape rate cir,bc,be buffer-limit
GTS基於acl的配置 traffic-shape group 組號  cir,bc,be 
GTS的第二種配置 class-map 名字
  match access-group 組號
  policy-map 名字
  class  名字
  shape average cir,bc,be
CAR基本配置 rate-limit output/input cir,bc,be conform-action {transmit,drop} exceed-action {transmit,drop}
CAR基於acl的配置 rate-limit output/input access-group 組號 cir,bc,be conform-action {transmit,drop} exceed-action {transmit,drop}
CAR的第二種配置 class-map 名字
  match access-group 組號
  policy-map 名字
  class  名字
  police cir bc be  conform-action {transmit,drop} exceed-action {transmit,drop} violate-action {transmit,drop}
接口上應用協議 service-policy input/output policy-name
SNMP  
啓用snmp,設置共同體名 snmp-server community public ro
  snmp-server community private rw
指定管理主機 snmp-server host ip public
啓用trap消息 snmo-server enable traps 
cisco asa 基礎  
配置ASA主機名 hostname 名字
配置特權密碼 enable password 密碼
配置遠程密碼 passwd 密碼
配置接口 nameif {dmz,inside,outside}
  security-level 0-100
保存配置 write memory
清空running-config配置 clear configure all
清空running-config指定配置 clear configure 要清空的配置
清空startup-config配置 write erase
telnet接入 telnet ip 子網 inside
  telnet timetout minutes
ssh接入 crypto key generate rsa modulus 1024
  ssh ip 子網 outside/inside
  ssh timeout minutes
  ssh version 1or2
  domian-name 域名
配置靜態路由 route interface-name 未知網段 子網掩碼 下一跳
標準acl access-list acl-name [standard] permit/deny ip 子網掩碼
擴展acl access-list acl-name [extended] permit/deny 協議 源ip 子網掩碼 目的ip 子網掩碼 
acl應用到接口 access-group acl-name in/out int interface-name
cisco ASA 應用NAT  
動態NAT nat (interface-name) nat-id ip mask
  global (interface-name) nat-id 地址池
爲該接口任何網段實施動態NAT nat (interface-name) nat-id 0 0
動態PAT nat (interface-name) nat-id ip mask
  global (interface-name) nat-id 映射地址
動態PAT映射接口ip global (interface-name) nat-id interface
靜態NAT static (local-if-name,global-if-name)global-ip locla-ip
靜態PAT static (local-if-name,global-if-name)協議 global-ip global-port local-ip local-port
開啓nat控制 nat-control
nat豁免 nat (interface-name) 0 access-list acl-name
cisco asa 高級配置  
開啓透明模式 firewall transparent
禁止ip分片 fragment chain 1
管理ip ip address ip 子網
路由進階與安全全部查看命令  
查看路由表 show ip route
只查看ospf學到的路由 show ip route ospf
查看路由協議配置 show ip protocol
查看ospf配置 show ip ospf
查看LSDB內全部LSA show ip ospf datebase
查看接口上ospf配置 show ip ospf interface
查看ospf的鄰居信息 show ip ospf neighbor 
查看路由器整個鄰接過程 debug ip ospf adj
查看每一個ospf數據包信息 debug ip ospf packet
清空路由表 clear ip route
查看策略配置 show policy-map
查看GTS配置信息 show traffic-shape f0/0
查看CAR配置信息 show int f0/0 rate-limit
查看conn表 show conn detail
查看nat表 show xlate detail
清空nat表 clear xlate
查看當前工做模式 show firewall 
   
   
網絡TCP/IP 命令
交換機的基本原理與配置  
配置主機名 hostname 
修改雙工模式 depulex{full/half/auto}
修改速率 speed {10/100/1000/auto}
從特權返回用戶 disable
從接口返回特權 end、ctrl+z
ip地址概述與應用  
查看ip地址 ipconfig
測試網絡連通性 ping
常規配置 en 
  conf t
  no ip domain-lookup
  line con 0
  logg sync
  exec-t 0 0
給路由器配ip int f0/0
  ip address ip 子網掩碼
  no shutdown
給交換機配ip int vlan 1
  ip addresss ip 子網掩碼
  no shutdown
網絡層協議與應用  
ping後可加的參數 ping -l(ping包大小)/-a(返回主機名)/-n(發從次數)/-t(一直ping )
windows 10 中查看你arp arp -a
windows 10 中清楚arp arp -d
windows 10 中綁定arp arp -s ip mac
cisco中查看arp show arp
cisco中清除arp clear arp-cache
cisco中綁定arp arp ip mac arpa
靜態路由  
配置靜態路由 ip route 未知網段 子網掩碼 下一跳
配置默認路由 ip route 0.0.0.0 0.0.0.0 下一跳
刪除靜態路由 no ip route 未知網段 子網掩碼 下一跳
設備管理  
保存配置 write;copy running-config startup-config
刪除配置 erase nvram
配置特權密碼明文 enable password
配置特權密碼密文 enable secret
加密明文密碼 service password-encryption
配置con口密碼 line con 0
  password 密碼
  login
配置vty密碼 line vty 0 4
  password 密碼
  login
路由器密碼恢復 重啓ctrl+pause break
  conferg 0x2142
  reset
  copy startup-config running-config
  修改密碼
  config-register 0x2102
  write
交換機密碼恢復 按住mode鍵
  flash_init
  rename flash:config.text flash:config.old
  boot
  rename flash:config.old flash:config.text
  copy flash:config.text system:running-config
  修改密碼並保存
交換機配置默認網關 ip default-gateway 網關ip
遠程設備 telnet ip
虛擬局域網  
全局模式下建立vlan vlan vlan-id
  name
數據庫模式下建立vlan vlan database
  vlan vlan-id name
將交換機的端口加入vlan switchport mode access
  switchport access vlan vlan-id
選擇封裝類型 switchport trunk encapsulation {isl/dot1q/auto}
選擇封裝模式 switchport mode {trunk/access}
指定native vlan switchport trunk native vlan vlan-id
從trunk中刪除vlan switchport trunk allowed vlan remove vlan-id
在trunk中添加vlan switchport trunk allowed vlan add vlan-id
trunk擴展及單臂路由  
配置子接口ip int f0/0.1
  ip address ip 子網掩碼
配置vlan標識的封裝結構  encapsulation dot1q vlan-id
定義地址池 ip dhcp pool pool-name
動態分配ip地址段 network 網段 子網
設置網關 default-router 網關 
配置dns dns-server dns-ip
設置地址租期 lease days
預留靜態分配ip ip dhcp excluded-address low-add high-add
VTP技術  
以太網通道配置 channel-group 1 mode on
建立vtp域名 vtp domain domain-name
配置vtp模式 vtp mode {server、client、transparent}
配置vtp口令 vtp password
配置vtp修建 vtp pruning
配置vtp版本 vtp version 1or2
網絡tcp/ip全部查看命令  
查看ios名稱及版本信息 show version
查看mac地址表 show mac-address-table
查看接口狀態 show int f0/24
查看接口ip show ip int brief
更改接口ip default int f0/0
查看路由表 show ip route
查看當前配置 show running-config
查看已保存配置 show startup-config
查看指定mac地址 show mac-address-table 指定的mac
查看vlan show vlan brief
查看接口模式 show int f0/0 swtichport
查看以太網通道配置 show entherchannel 1 summary
查看vtp配置信息 show vtp status
相關文章
相關標籤/搜索