溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

路由器交換機(jī)命令總結(jié)

發(fā)布時(shí)間:2020-08-02 08:36:35 來源:網(wǎng)絡(luò) 閱讀:526 作者:稀世珍寶 欄目:網(wǎng)絡(luò)安全

特權(quán)模式:enable (en)

全局配置模式:config terminal (conf t)

接口模式:interface fastethernet 模塊號(hào)/端口號(hào) int f0/1

同時(shí)進(jìn)入多個(gè)接口 int range f0/0 – 4

終止域名解析:ctrl+shift+6

退出到特權(quán)模式:crtl+z  end

退出到上一層:exit

ctrl+A 光標(biāo)到命令行開始位置

ctrl+E 光標(biāo)到命令行結(jié)束位置

 

特權(quán)模式下命令

show version  顯示系統(tǒng)ios名稱及版本信息

查看當(dāng)前配置信息: show running-config  (sh run)

查看以保存的配置信息: show startup-config  (shstar)

保存當(dāng)前配置信息:copy running-config startup-config (copy run star ) = write

刪除已保存的配置信息:erase nvram  erasestartup-config

tracert 192.168.1.1  查看到192.168.1.1的過程

重啟:reload

查看vlanshow vlan brief

 

全局模式下命令:

host xx 修改主機(jī)名為xx

還原接口為默認(rèn)配置:default interface f0/1

配置雙工模式:deplex full|half|auto

配置接口速率:speed 10|100|100

永不超時(shí):

line con 0 

exec-timeout 0 0

信息同步:

line con 0

logging synchronous (logg syn)

禁用DNS查詢:no ip domain-lookup

 

交換機(jī):

查看mac地址表:show mac-address-table 

查看f0/1信息(包括雙工模式和速率):show int f0/1 

在三層交換機(jī)上啟用路由功能:ip routing

查看接口模式狀態(tài): show interface interface-id switchport

 

創(chuàng)建vlan :

1.vlan database

vlan vlan-id [name vlan-name]

exit

2.conf t

vlan vlan-id

name vlan-name

exit

將端口f0/1分配到vlan 2:

conf t

int f0/1

switchport mode access

switchport access vlan 2

exit

 

給交換機(jī)虛接口配置ip:

int vlan 1

ip add 192.168.1.1 255.255.255.0

no sh

配置默認(rèn)網(wǎng)關(guān): ip default-gateway 192.168.1.254

 

配置交換機(jī)console口密碼:

全局模式:

line console 0

password cisco

login

配置特權(quán)模式密碼:

全局模式下:

enable password cisco (明文) / enablesecret cisco (密文)

加密明文密碼:service password-encryption

 

配置vty密碼;

line vty 0 4

password cisco

login

設(shè)置好vty密碼和enable密碼,可以通過telnet遠(yuǎn)程管理交換機(jī)。遠(yuǎn)程管理不同網(wǎng)段的交換機(jī)時(shí),需要給交換機(jī)配置默認(rèn)網(wǎng)關(guān)

 

trunk配置:

int f0/1

switchport trunk encapsulation dot1q

switchport mode trunk

 

禁止trunk傳送某個(gè)vlan的數(shù)據(jù),刪除這個(gè)vlan: switchport trunk allowed vlan remove vlan-id

允許trunk傳送某個(gè)vlan的數(shù)據(jù),添加這個(gè)vlan: switchport trunk allowed vlan add vlan-id

 

配置以太網(wǎng)通道:

interface range f0/1 – 2

channel-group 1 mode on

查看以太網(wǎng)通道配置: show etherchannel 1 summary

VTP配置:

創(chuàng)建vtp域:Switch(config)# vtp domain domain-name

配置交換機(jī)的vtp模式:Switch(config)# vtp mode {server|client|transparent}

配置vtp口令:Switch(config)# vtp password password

配置vtp修剪: Switch(config)# vtp pruning

配置vtp版本:Switch(config)# vtp version 2 (默認(rèn)運(yùn)行版本1)

查看vtp配置信息:Switch# show vtp status

查看vtp口令:Switch# show vtp password

交換機(jī)密碼恢復(fù):

1.開機(jī)按mode

   2.初始化flash flash_init

   3.config.text修改為config.old

     rename flashconfig.text  flashconfig.old

   4.重啟:boot

   5.把配置文件名改回

     rename flashconfig.old  flashconfig.text

   6.手動(dòng)加載配置文件

     copy flashconfig.text  systemrunning-config

   7.查看配置并修改

8.保存:wr

 

路由器:

查看arp緩存表:show arp

清除arp緩存表:clear arp-cache

查看所有接口ip: sh ip int brief

查看路由表:show ip route (c-直連路由,s-靜態(tài)路由,s*-默認(rèn)路由)

配置靜態(tài)路由: ip route 目的網(wǎng)段子網(wǎng)掩碼 address(到達(dá)目的網(wǎng)絡(luò)經(jīng)過的下一跳路由器的接口地址)

配置默認(rèn)路由: ip route 0.0.0.0 0.0.0.0 address(下一跳地址)

no ip routing : 把路由器路由功能關(guān)了,模擬交換機(jī)

 

配置ip:

int f0/0

ip add 10.0.0.10 255.255.255.0

no shut down

 

配置單臂路由:需要配置子接口的封裝結(jié)構(gòu),vlanip

int f0/0.1

encapsulatation dot1q 10vlan-id

ip add 10.0.0.1 255.255.255.0

int f0/0.2

配置DHCP

定義ip地址池:Router(config)#  ip dhcp pool pool-name

動(dòng)態(tài)分配ip地址段: Router(dhcp-config)# network 網(wǎng)段掩碼

設(shè)定網(wǎng)關(guān)地址:Router(dhcp-config)# default-router 網(wǎng)關(guān)地址

為客戶端配置DNS地址:Router(dhcp-config)# dns-server  dns-ip

設(shè)定地址租期:Router(dhcp-config)# lease days

預(yù)留靜態(tài)分配的ip地址: Router(dhcp-config)# ip dhcp excluded-address low-address[high-address]

路由器密碼恢復(fù):

1.中斷開機(jī):ctrl+break

    2.修改寄存器的值:confreg0x2142

    3.重啟:reset

   4.手動(dòng)加載配置文件:copy startup-confg running-config

   5.查看配置并修改

   6.恢復(fù)寄存器的值:config-register 0x2102

   7.保存配置:copy run star

 


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI