CISICO 路由器和交换机的基本配置命令
Configure terminal
功能:進入全局配置模式
條件:特權模式
格式:configure terminal
Hostname
功能:設置主機名
條件:全局配置模式
格式:hostname hostname
Interface vlan vlan-id
Ip address address netmask
功能:配置管理IP
條件:全局配置模式
格式:interface vlan vlan-id
Ip address address netmask
備注:vlan-id代表要選擇配置的VLAN號
Address 為要設置的管理IP地址,netmask為子網掩碼
Ip domain-lookup/ no ip domain-lookup?
功能:啟用與禁止DNS服務器
條件:端口配置模式
格式:ip domain-lookup
Ip name-server serveraddress1 …serveraddress6
功能:指定DNS服務器地址
條件:端口配置模式
格式:ip name-server serveraddress1 serveraddress 2…
備注:交換機最多可指定6個DNS服務器地址,各地址間用空格分隔
Ip http server / no ip http server
功能:啟用與禁用HTTP服務
條件:端口配置模式
格式:ip http server
Show version
功能:查看IOS版本
條件:特權模式
格式:show version
Show running-config
Show startup-config
功能:查看配置信息
條件:特權模式
格式:show running-config
show startup-config
備注:running-config顯示當前正在運行的配置
startup-config顯示保存在NVRAM中的啟動配置
Show interface type mod/port
功能:查看端口信息
條件:特權模式
格式:show interface type mod/port
備注:type代表端口類型,通常有Enthernet/Fastenthernet/Gigabitethernet/Tengigabit ethernet
Mod和Port代表端口所在的模塊和該模塊中的編號
Show mac-address-table dynamic|static vlan vlan-id
功能交換機模擬器:查看交換機的MAC地址
條件:特權模式
格式:show mac-address-table dynamic|static vlan vlan-id
備注:dynamic代表顯示動態學習到的MAC地址
static代表靜態指定的MAC地址
vlan vlan-id代表查看指定的VLAN學到的MAC地址
Show mac-address-table dynamic|static interface type mod/port
功能:查看從某個端口學到的MAC地址
條件:特權模式
格式:show mac-address-table dynamic|static interface type mod/port
Show mac-address-table address mac-address
功能:顯示和某個MAC地址相關聯的端口和VLAN信息
條件:特權模式
格式:show mac-address-table address mac-address
Interface type mod/port
功能:選擇端口
條件:全局配置模式
格式:interface type mod/port
Interface range type mod/startport-endport
功能:選擇多個端口
條件:全局配置模式
格式:interface range type mod/startport – endport
備注:連字符“-”兩端需要空格
Description port-description
功能:為端口指定一個描述性文字
條件:端口配置模式
格式:description port-description
備注:如果描述性文字里包含空格,則需要引號將描述性文字引起來
Speed speed
功能:設置端口通信速度
條件:端口配置模式
格式:speed 10/100/1000/auto
Duplex full/half/auto
功能:設置端口的單雙工模式
條件:端口配置模式
格式:duplex full/half/auto
Mtu
功能:配置MTU,指交換機能夠交換的最大幀的大小
條件:端口配置模式
格式:mtu 1500-9216B
Spanning-tree portfast
Switchport mode access
No channel-group
功能:優化端口
條件:端口配置模式
格式:Spanning-tree portfast
Switchport mode access
No channel-group
Shutdown
功能:啟用與禁用端口
條件:端口配置模式華為交換機模擬器
格式:shutdown(禁用)
no shutdown(啟用)
Port monitor type mod/port
功能:配置端口鏡像
條件:端口配置模式
格式:port monitor type mod/port
Show port monitor
功能:查看端口鏡像配置信息
條件:全局配置模式
格式:show port monitor
switchport
功能:端口的2層與3層選擇
條件:端口配置模式
格式:no switchport(3層)
switchport(2層)
IP address address netmask
功能:為3層端口配置IP地址
條件:端口配置模式
格式:ip address address netmask
備注:netmask為子網掩碼
Ip route network netmask network
功能:配置靜態路由
條件:全局配置模式
格式:Ip route network netmask network
Ip route 0.0.0.0 0.0.0.0 ip-address
功能:定義默認路由
條件:全局配置模式
格式:ip route 0.0.0.0 0.0.0.0 ip-address
Show ip route
功能:查看路由信息
條件:特權模式
格式:show ip route
Clear ip route
功能:清除路由
條件:全局配置模式
格式:clear ip route network netmask/*
備注:network和netmask用于清楚指定的路由,若用*則代表清除全部路由
Vtp domain domain name
功能:創建VTP管理域
條件:VLAN管理模式
格式:vtp domain domain name
Vtp server/client/transparent
功能:設置VTP模式
條件:VLAN管理模式
格式:vtp server/client/transparent
Show vtp status
功能:查看VTP信息
條件:特權模式
格式:show vtp status
Switchport trunk encapsulation isl/dotlq
Switchport mode trunk
功能:選擇封裝協議和啟用trunk鏈路
條件:端口配置模式
格式:Switchport trunk encapsulation isl/dotlq
Switchport mode trunk
Vlan vlan-id name vlan-name
功能:創建VLAN
條件:VLAN管理模式
格式:Switchport access vlan vlan-id
Ip helper-address dhcp-server
功能:為虛擬子接口指定DHCP服務器地址
條件:端口配置模式
格式:ip helper-address dhcp-server
switchport trunk allowed vlan remove vlanlist
功能:設置不允許通過trunk鏈路模擬交換機的VLAN
條件:端口配置模式
格式:switchport trunk allowed vlan remove vlanlist
備注:當移除多個VLAN的時候,vlanlist里要加逗號
switchport trunk allowed vlan add vlanlist
功能:設置允許通過trunk鏈路的VLAN
條件:端口配置模式
格式:switchport trunk allowed vlan add vlanlist
轉載于:https://blog.51cto.com/4176338/750468
總結
以上是生活随笔為你收集整理的CISICO 路由器和交换机的基本配置命令的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java博文目录
- 下一篇: libsvm数据缩放方法