tft每日頭條

 > 生活

 > 思科路由器交換機參數

思科路由器交換機參數

生活 更新时间:2024-08-31 12:19:12

幾種常見模式

Router>用戶模式

Router# 特權模式 (在用戶模式輸入enable進入特權模式)

Router(config)# 全局配置模式 (在特權模式輸入config termina)

Router(config-if)# 接口模式

常用命令

Router(config)# hostname 名字 (更改主機名)

Router(config)# interface fastEthernet 0/0 進入fastEthernet 0/0接口

Router(config-if)# ip address 192.168.1.10 255.255.255.0 給fastEthernet 0/0接口配置IP地址

Route(config-if)#description 描述 給該接口添加描述

Router(config-if)# no shutdown 激活這個接口

查看命令

Router# show **** 查看命令

Router# show running-config 查看當前設備已經配置但還未保存的配置

Router# show startup-config 查看當前設備已經保存過生效的配置啟動配置文件

Router# reload 重啟設備

Router# copy running-config startup-config 或者 Router#write 保存運行的配置文件到啟動配置文件

備份還原

需要先在本地開啟TFTP服務器

備份:

Switch#copy running-config tftp:

Address or name of remote host []? TFTP備份服務器地址

Destination filename [Switch-confg]? 備份文件名


還原:

Switch#copy tftp running-config:

Address or name of remote host []? TFTP備份服務器地址

Source filename []? 備份文件名

配置密碼

R(config)#enable password 密碼 配置進入特權模式的明文密碼

R(config)#enable sercret 密碼 配置進入特權模式的加密密碼

當明文密碼和加密密碼同時配置的時候,隻能夠是加密的密碼生效。

明文密碼可以在show running-config下看到,而加密的密碼在show running-conifg下看到的卻隻是經過MD5加密後出現的一長串的字母。

配置遠程登錄

Switch(config)#line vty 0 15

Switch(config-line)#password 密碼

Switch(config-line)#login

Switch(config-line)#exit

Switch# show version 查看當前交換機的版本

Switch # show mac-address-table 查看當前交換機的mac地址表

vlan配置


1.創建VLAN

switch(config)#vlan 2

switch(config-vlan)#name 名字 vlan名字

如果是switch(config)#interface vlan 2 則是進入vlan 2的接口模式,而接口模式下面可以配置很多東西。

會變成switch(config-if)#

如果是直接輸入vlan 2則是進入到vlan,然後是【name改名、exit退回上一級、no删除】

隻有這三個命令(for packet tracer)

2.把相應的端口加入到相應vlan

switch(config-if)#intf0/4

switch(config-if)#switchport mode access 将端口變為access端口

switch(config-if)#switchport access vlan 2 加入vlan2

批量将端口加入vlan的方法:

Switch(config)#interface range f0/1,f0/3,f0/4-8

Switch(config-if-range)#switchport mode access 将端口變為access端口

Switch(config-if-range)#switchport access vlan 2 加入vlan2

Switch(config-if-range)#end

這樣就可以同時加入到valn(無論是單個的端口、不連續的端口、連續的端口都可以。)

3.驗證

switch@show vlan

switch@show vlan brief

vlan間路由

switch(config)#ip routing 啟用路由功能

switch(config)#int vlan 2 進入vlan2接口

switch(config-if)#ip address 192.168.2.1 255.255.255.0 給VLAN2 配置IP地址 注意這個IP是vlan2的網關


思科路由器交換機參數(交換機基礎配置)1

switch(config)#ip routing 啟用路由功能

switch(config)#int f0/1

switch(config-if)#no switchport 不是交換端口就是路由端口

switch(config-if)#ipaddress 192.168.2.1 255.255.255.0

switch(config-if)#no shutdown

設置turnk口

Switch(config)#interface f0/24 進入f0/24口

Switch(config-if)#switchport mode trunk 将該口設置為trunk口

Switch(config-if)#switchport trunk allowed vlan all 允許所有vlan通過

Switch(config-if)#switchport trunk allowed vlan 2 允許所有vlan2 通過


DHCP配置

Switch(config)#ip dhcp pool test01 建立名為 test01 的地址池

Switch(dhcp-config)#network 192.168.1.0 255.255.255.0 網絡地址

Switch(dhcp-config)#dns-server dns1 dns2 配置DNS 地址 dns1 dns2

Switch(dhcp-config)#default-router 192.168.1.1 默認網關

Switch(dhcp-config)#lease 3 租約期限3天

Switch(dhcp-config)#netbios-name-server 192.168.1.5 為客戶機配置 wins 服務器(不一定要配置)

netbios-node-type h-node (為客戶機配置節點模式:影響名稱解釋的順利 如 h-node=先通過 wins 服務器解釋) ;不一定要配置

Switch(dhcp-config)#ip dhcp pool vlan1_john 單獨為 MAC地址為的機器分配地址 ;不一定要配置

Switch(dhcp-config)#host 10.1.1.21 255.255.255.0

Switch(dhcp-config)#client-identifier 0050.bade.6384 (client-identifier=01加上客戶機網卡地址)

Switch(config)#ip dhcp excluded-address 192.168.0.2 192.168.0.20 配置保留不分配的IP地址

Switch(config)#no service dhcp 停止 DHCP服務,默認為啟用 DHCP服務

查看命令:

Switch#sh ip dhcp binding 顯示地址分配情況

Switch#show ip dhcp conflict 顯示地址沖突情況

Switch#debug ip dhcp server {events | packets | linkage} 觀察DHCP服務器工作情況

Switch#show ip dhcp pool 查看 dhcp pool 的信息。

Switch#sh ip dhcp server statistics 查看狀态

Switch#show dhcp lease 查看租約期


破解路由器密碼

路由器的啟動順序:

1. 加電自檢

2. 從Flash裡面查找和裝載ISO

3. 從NVRAM裡面查找和裝載啟動配置文件

那麼破解的思路就是跳過第三步,因為配置的密碼都保存在NVRAM的配置文件裡面。

1. 把路由器重啟

2. 在重新啟動的30秒内過程中出現[memory]的同時按住CTRL Break鍵,

這樣路由器就會進入到監控模式"rommon"

3. 改寄存器的參數值confreg 為 0x2142

即:rommon 2 > confreg0x2142

4. 改好後重啟。

即:rommon 3 > reload

5. 這樣重啟的時候就會跳過啟動順序裡面的第三步。

6. 進入後,把原來的啟動配置文件COPY回來。

即:copy startup-config running-config

Copy回來以後,以前的配置都會存在了。

7. 然後再手動更改以前的enable加密密碼,這樣就可以替換以前的舊密碼。

即:R1(config)#enable secret cisco

8. 替換掉舊密碼以後,需要把改動過的寄存器的值更改回來,否則以後都會跳過第三步而直接啟動。

即:R1(config)#config-register 0x2102

通過查看路由器版本可以看到當前路由器寄存器的值是多少。

即:R1#show version

在最後一行"configuration register is 0x2142"

原本路由器默認的寄存器的值是0x2102的,這樣的話啟動順序就不會繞過啟動順序的第三步。

,

更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!

查看全部

相关生活资讯推荐

热门生活资讯推荐

网友关注

Copyright 2023-2024 - www.tftnews.com All Rights Reserved