導航:首頁 > 程序命令 > 交換機與路由器的基本配套命令

交換機與路由器的基本配套命令

發布時間:2024-02-24 20:17:00

1. Cisco常用的路由器交換機配置命令

cisco製造的路由器設備、交換機和其他設備承載了全世界80%的互聯網通信,成為矽谷中新經濟的傳奇,那麼你了解Cisco常用的路由器交換機配置命令嗎?下面是我整理的一些關於Cisco常用的路由器交換機配置命令的相關資料,供你參考。

Cisco常用的路由器支持的命令:

路由器顯示命令:

router#show run ;顯示配置信息

router#show interface ;顯示介面信息

router#show ip route ;顯示路由信息

router#show cdp nei ;顯示鄰居信息

router#reload ;重新起動

路由器口令設置:

router>enable ;進入特權模式

router#config terminal ;進入全局配置模式

router(config)#hostname ;設置交換機的主機名

router(config)#enable secret xxx ;設置特權加密口令

router(config)#enable password xxb ;設置特權非密口令

router(config)#line console 0 ;進入控制台口

router(config-line)#line vty 0 4 ;進入虛擬終端

router(config-line)#login ;要求口令驗證

router(config-line)#password xx ;設置登錄口令xx

router(config)#(Ctrl+z) ; 返回特權模式

router#exit ;返回命令

路由器配置:

router(config)#int s0/0 ;進入Serail介面

router(config-if)#no shutdown ;激活當前介面

router(config-if)#clock rate 64000 ;設置同步時鍾

router(config-if)#ip address ;設置IP地址

router(config-if)#ip address second ;設置第二個IP

router(config-if)#int f0/0.1 ;進入子介面

router(config-subif.1)#ip address ;設置子介面IP

router(config-subif.1)#encapsulation dot1q ;綁定vlan中繼協議

router(config)#config-register 0x2142 ;跳過配置文件

router(config)#config-register 0x2102 ;正常使用配置文件

router#reload ;重新引導

路由器文件操作:

router# running-config startup-config ;保存配置

router# running-config tftp ;保存配置到tftp

router# startup-config tftp ;開機配置存到tftp

router# tftp flash: ;下傳文件到flash

router# tftp startup-config ;下載配置文件

ROM狀態:

Ctrl+Break ;進入ROM監控狀態

rommon>confreg 0x2142 ;跳過配置文件

rommon>confreg 0x2102 ;恢復配置文件

rommon>reset ;重新引導

rommon> xmodem: flash: ;從console傳輸文件

rommon>IP_ADDRESS=10.65.1.2 ;設置路由器IP

rommon>IP_SUBNET_MASK=255.255.0.0 ;設置路由器掩碼

rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP伺服器IP

rommon>TFTP_FILE=c2600.bin ;指定下載的文件

rommon>tftpdnld ;從tftp下載

rommon>dir flash: ;查看快閃記憶體內容

rommon>boot ;引導IOS

靜態路由:

ip route ;命令格式

router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;靜態路由舉例

router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默認路由舉例

動態路由:

router(config)#ip routing ;啟動路由轉發

router(config)#router rip ;啟動RIP路由協議。

router(config-router)#network ;設置發布路由

router(config-router)#negihbor ;點對點幀中繼用。

幀中繼命令:

router(config)#frame-relay switching ;使能幀中繼交換

router(config-s0)#encapsulation frame-relay ;使能幀中繼

router(config-s0)#fram-relay lmi-type cisco ;設置管理類型

router(config-s0)#frame-relay intf-type DCE ;設置為DCE

router(config-s0)#frame-relay dlci 16 ;

router(config-s0)#frame-relay local-dlci 20 ;設置虛電路號

router(config-s0)#frame-relay interface-dlci 16 ;

router(config)#log-adjacency-changes ;記錄鄰接變化

router(config)#int s0/0.1 point-to-point ;設置子介面點對點

router#show frame pvc ;顯示永久虛電路

router#show frame map ;顯示映射

基本訪問控制列表:

router(config)#access-list permit|deny

router(config)#interface ;default:deny any

router(config-if)#ip access-group in|out ;defaultut

例1:

router(config)#access-list 4 permit 10.8.1.1

router(config)#access-list 4 deny 10.8.1.0 0.0.0.255

router(config)#access-list 4 permit 10.8.0.0 0.0.255.255

router(config)#access-list 4 deny 10.0.0.0 0.255.255.255

router(config)#access-list 4 permit any

router(config)#int f0/0

router(config-if)#ip access-group 4 in

擴展訪問控制列表:

access-list permit|deny icmp [type]

access-list permit|deny tcp [port]

例3:

router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo

router(config)#access-list 101 permit ip any any

router(config)#int s0/0

router(config-if)#ip access-group 101 in

例3:

router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80

router(config)#access-list 102 permit ip any any

router(config)#interface s0/1

router(config-if)#ip access-group 102 out

刪除訪問控制例表:

router(config)#no access-list 102

router(config-if)#no ip access-group 101 in

路由器的nat配置

Router(config-if)#ip nat inside ;當前介面指定為內部介面

Router(config-if)#ip nat outside ;當前介面指定為外部介面

Router(config)#ip nat inside source static [p] [port]

Router(config)#ip nat inside source static 10.65.1.2 60.1.1.1

Router(config)#ip nat inside source static tcp 10.65.1.3 80 60.1.1.1 80

Router(config)#ip nat pool p1 60.1.1.1 60.1.1.20 255.255.255.0

Router(config)#ip nat inside source list 1 pool p1

Router(config)#ip nat inside destination list 2 pool p2

Router(config)#ip nat inside source list 2 interface s0/0 overload

Router(config)#ip nat pool p2 10.65.1.2 10.65.1.4 255.255.255.0 type rotary

Router#show ip nat translation

rotary 參數是輪流的意思,地址池中的IP輪流與NAT分配的地址匹配。

overload參數用於PAT 將內部IP映射到一個公網IP不同的埠上。

外部網關協議配置

routerA(config)#router bgp 100

routerA(config-router)#network 19.0.0.0

routerA(config-router)#neighbor 8.1.1.2 remote-as 200

配置PPP驗證:

RouterA(config)#username password

RouterA(config)#int s0

RouterA(config-if)#ppp authentication {chap|pap}

3.PIX防火牆命令

Pix525(config)#nameif ethernet0 outside security0 ;命名介面和級別

Pix525(config)#interface ethernet0 auto ;設置介面方式

Pix525(config)#interface ethernet1 100full ;設置介面方式

Pix525(config)#interface ethernet1 100full shutdown

Pix525(config)#ip address inside 192.168.0.1 255.255.255.0

Pix525(config)#ip address outside 133.0.0.1 255.255.255.252

Pix525(config)#global (if_name) natid ip-ip ;定義公網IP區間

Pix525(config)#global (outside) 1 7.0.0.1-7.0.0.15 ;例句

Pix525(config)#global (outside) 1 133.0.0.1 ;例句

Pix525(config)#no global (outside) 1 133.0.0.1 ;去掉設置

Pix525(config)#nat (if_name) nat_id local_ip [netmark]

Pix525(config)#nat (inside) 1 0 0

內網所有主機(0代表0.0.0.0)可以訪問global 1指定的外網。

Pix525(config)#nat (inside) 1 172.16.5.0 255.255.0.0

內網172.16.5.0/16網段的主機可以訪問global 1指定的外網。

Pix525(config)#route if_name 0 0 gateway_ip [metric] ;命令格式

Pix525(config)#route outside 0 0 133.0.0.1 1 ;例句

Pix525(config)#route inside 10.1.0.0 255.255.0.0 10.8.0.1 1 ;例句

Pix525(config)#static (inside, outside) 133.0.0.1 192.168.0.8

表示內部ip地址192.168.0.8,訪問外部時被翻譯成133.0.0.1全局地址。

Pix525(config)#static (dmz, outside) 133.0.0.1 172.16.0.8

中間區域ip地址172.16.0.8,訪問外部時被翻譯成133.0.0.1全局地址。

Cisco常用的交換機支持的命令:

交換機基本狀態:

switch: ;ROM狀態, 路由器是rommon>

hostname> ;用戶模式

hostname# ;特權模式

hostname(config)# ;全局配置模式

hostname(config-if)# ;介面狀態

交換機口令設置:

switch>enable ;進入特權模式

switch#config terminal ;進入全局配置模式

switch(config)#hostname ;設置交換機的主機名

switch(config)#enable secret xxx ;設置特權加密口令

switch(config)#enable password xxa ;設置特權非密口令

switch(config)#line console 0 ;進入控制台口

switch(config-line)#line vty 0 4 ;進入虛擬終端

switch(config-line)#login ;允許登錄

switch(config-line)#password xx ;設置登錄口令xx

switch#exit ;返回命令

交換機VLAN設置:

switch#vlan database ;進入VLAN設置

switch(vlan)#vlan 2 ;建VLAN 2

switch(vlan)#no vlan 2 ;刪vlan 2

switch(config)#int f0/1 ;進入埠1

switch(config-if)#switchport access vlan 2 ;當前埠加入vlan 2

switch(config-if)#switchport mode trunk ;設置為干線

switch(config-if)#switchport trunk allowed vlan 1,2 ;設置允許的vlan

switch(config-if)#switchport trunk encap dot1q ;設置vlan 中繼

switch(config)#vtp domain ;設置發vtp域名

switch(config)#vtp password ;設置發vtp密碼

switch(config)#vtp mode server ;設置發vtp模式

switch(config)#vtp mode client ;設置發vtp模式

交換機設置IP地址:

switch(config)#interface vlan 1 ;進入vlan 1

switch(config-if)#ip address ;設置IP地址

switch(config)#ip default-gateway ;設置默認網關

switch#dir flash: ;查看快閃記憶體

交換機顯示命令:

switch#write ;保存配置信息

switch#show vtp ;查看vtp配置信息

switch#show run ;查看當前配置信息

switch#show vlan ;查看vlan配置信息

switch#show interface ;查看埠信息

switch#show int f0/0 ;查看指定埠信息

2. 15分求路由器和交換機的配置命令!詳細!

不同品牌的都不一樣啊
銳捷網路 配置命令 和CISCO 基本一樣 自己總結的
交換機
密碼
1234(config)#enable secret level 1 0 100
1234(config)#enable secret level 15 0 100
遠程登入密碼
1234(config)#line vty 0 4
1234(config-line)#password 100
1234(config-line)#end
交換機管理IP
1234(config)#interface vlan 1
1234(config-if)#ip address 192.168.1.10 255.255.255.0
1234(config-if)#no shutdown
修改交換機老化時間
1234(config)#mac-address-table aging-time 20
1234(config)#end
添刪vlan
1234(config)#vlan 888
1234(config-vlan)#name a888
1234(config)#no vlan 888
添加access口
1234(config)#interface gigabitEthernet 0/10
1234(config-if)#switchport mode access
1234(config-if)#switchport access vlan 10
切換assess trunk
1234(config-if)#switchport mode access
1234(config-if)#switchport mode trunk
指定特定一個native vlan
1234(config-if)#switchport trunk native vlan 10
配置trunk口的許可vlan列表
1234(config-if)#switchport trunk allowed vlan ?
add Add VLANs to the current list
all All VLANs
except All VLANs except the following
remove Remove VLANs from the current list
速成樹協議
1234(config)#spanning-tree
1234(config)#spanning-tree mode rstp/stp
配置網關:
switch(config)#ip default-gateway 192.168.1.254
交換機基本配置-常見查看命令
查看CPU利用率
show cpu
查看交換機時鍾
show clock
查看交換機日誌
show logging
查看交換機動態學習到的MAC地址表
show mac-address-table dynamic
查看當前交換機運行的配置文件
show running-config
查看交換機硬體、軟體信息
show version
查看交換機的arp表
show arp
顯示介面詳細信息的命令
show interfaces gigabitEthernet 4/1 counters
介面配置
Switch(config)#interface gigabitethernet 0/1
把介面工作模式改為光口。
Switch(config-if)#medium-type fiber
把介面工作模式改為電口。
Switch(config-if)#medium-type copper
速度/雙工配置
進入介面配置模式。
Switch(config)#interface interface-id
設置介面的速率參數,或者設置為auto。
Switch(config-if)#speed {10 | 100 | 1000 | auto }
設置介面的雙工模式。
Switch(config-if)#plex {auto | full | half}
例子
Switch(config)#interface gigabitethernet 0/1
Switch(config-if)#speed 1000
Switch(config-if)#plex full
光口不能修改速度和雙工配置,只能auto。
在故障處理的時候,如果遇到規律性的時斷時續或掉包,在排除其他原因後,可以考慮是否和對端設備的速率和雙工模式不匹配,尤其是兩端設備為不同廠商的時候。
VLAN
建立VLAN 100
Switch (config)#vlan 100
該VLAN名稱為ruijie
Switch (config)#name ruijie
將交換機介面劃入VLAN 中:
range表示選取了系列埠1-48,這個對多個埠進行相同配置時非常有用。
Switch (config)#interface range f 0/1-48
將介面劃到VLAN 100中。
Switch (config-if-range)#switchport access vlan 100
將介面劃回到默認VLAN 1中,即埠初始配置。
Switch (config-if-range)#no switchport access vlan
Switch(config)#interface fastEthernet 0/1
該埠工作在access模式下
Switch(config-if)#switchport mode access
該埠工作在trunk模式下
Switch(config-if)#switchport mode trunk
Switch(config)#interface fastEthernet 0/2
設定VLAN要修剪的VLAN。
Switch(config-if)#switchport trunk allowed vlan remove 2-9,11-19,21-4094
取消埠下的VLAN修剪。
Switch(config-if)#no switchport trunk allowed vlan
生成樹
開啟生成樹協議。
Switch(config)#spanning-tree
禁止生成樹協議。
Switch(config)#no spanning-tree
配置生成樹優先順序:
配置設備優先順序為4096。
Switch(config)#spanning-tree priority 4096
數值越低,優先順序別越高。
埠鏡像
配置G0/2為鏡像埠。
Switch (config)# monitor session 1 destination interface G 0/2
配置G0/1為被鏡像埠,且出入雙向數據均被鏡像。
Switch (config)# monitor session 1 source interface G 0/1 both
去掉鏡像1。
Switch (config)# no monitor session 1
埠聚合
Switch(config)#interface fastEthernet 0/1
把埠f0/1加入到聚合組1中。
Switch (config-if)#port-group 1
把埠f0/1從聚合組1中去掉
Switch (config-if)#no port-group 1
建立ACL:
建立ACL訪問控制列表名為ruijie,extend表示建立的是擴展訪
Switch(config)# Ip access-list exten ruijie
問控制列表。
添加ACL的規則:
禁止PING IP地址為192.168.1.1的設備。
Switch (config-ext-nacl)#deny icmp any 192.168.1.1 255.255.255.0
禁止埠號為135的應用。
Switch (config-ext-nacl)# deny tcp any any eq 135
禁止協議為www的應用。
Switch (config-ext-nacl)#deny udp any any eq www
允許所有行為。
Switch(config-ext-nacl)# permit ip any any
將ACL應用到具體的介面上:
Switch (config)#interface range f 0/1
把名為ruijie的ACL應用到埠f 0/1上。
Switch (config-if)#ip access-group ruijie in
從介面去除ACL。
Switch (config-if)#no ip access-group ruijie in
刪除ACL:
刪除名為ruijie的ACL。
Switch(config)#no Ip access-list exten ruijie
增加ACE項後,是增加到ACL最後,不可以中間插入,如果要調整ACE的順序,必須整個刪除ACL後再重新配置。
埠安全
Switch (config)#interface range f 0/1
開啟埠安全。
Switch(config-if)# switchport port-security
關閉埠安全。
Switch(config-if)# no switchport port-security
設置埠能包含的最大安全地址數為8。
Switch(config-if)# switchport port-security maximum 8
在介面fastethernet0/1配置一個安全地址00d0.f800.073c,並為其綁定一個IP地址192.168.1.1
Switch(config-if)# switchport port-security mac-address 00d0.f800.073c ip-address 192.168.1.1
刪除介面上配置的安全地址。
Switch(config-if)#no switchport port-security mac-address 00d0.f800.073c ip-address 192.168.1.1
防ARP攻擊
IP和MAC地址的綁定
Switch(config)#arp ip-address hardware-address [type] interface-id
Switch(config)#arp 192.168.12.111 00d0.f800.073c arpa g 0/1
綁定網關
進入指定埠進行配置。
Switch(config)#Interface interface-id
配置防止ip-address的ARP欺騙。
Switch(config-if)#Anti-ARP-Spoofing ip ip-address
防STP攻擊
進入埠Fa0/1。
Switch(config)# inter fastEthernet 0/1
打開該埠的的BPDU guard功能。
Switch(config-if)# spanning-tree bpguard enable
關閉該埠的的BPDU guard功能。
Switch(config-if)# spanning-tree bpguard diaable
埠關閉後只能shutdown然後再no shutdown
或者重新啟動交換機才能恢復!
防DOS/DDOS攻擊
進入埠Fa0/1。
Switch(config)# inter fastEthernet 0/1
預防偽造源IP的DOS攻擊的入口過濾功能。
Switch(config-if)#ip deny spoofing-source
關閉入口過濾功能只能在三層介面上配置。
Switch(config-if)#no ip deny spoofing-source
和ACL不能同時存在。
埠關閉後只能shutdown然後再no shutdown
或者重新啟動交換機才能恢復!
防IP掃描攻擊配置:
打開系統保護。
Switch(config)#system-guard enable
關閉系統保護功能。
Switch(config)#no system-guard
DHCP配置
打開DHCP Relay Agent:
Switch(config)#service dhcp
配置DHCP Server的IP地址:
Switch(config)#ip helper-address address
VRRP配置
Switch(config)#Interface interface-id
Switch(config-if)#Standby [group-number] ip ip-address
設置虛擬機的優先順序。
standby [group-number] priority priority
三層交換機配置
SVI:
把VLAN 10配置成SVI。
switch (config)#interface vlan 10
給該SVI介面配置一個IP地址
switch (config-if)#ip address 192.168.1.1 255.255.255.0
Routed Port:
switch (config)#interface fa 0/1
把f 0/1變成路由口。
switch (config-if)#no switch
路由配置:
添加一條路由。
switch (config)#ip route 目的地址 掩碼 下一跳
switch (config)#ip route 210.10.10.0 255.255.255.0 218.8.8.8
WEB登錄口令(特權模式口令)
enable password 1234
telnet登錄口令
line vty 0 4
password 1234
重啟
reload
恢復出廠配置
del config.text
reload
埠監控
mirror master lan 2 slave lan 0 all
DHCP配置
ip dhcp pool ruijie
network 192.168.1.0 255.255.255.0
dns-sever 202.101.98.55
default-router 192.168.1.1
exit
exit
虛擬伺服器
ip nat in sou sta tcp 192.168.0.254 80 61.154.28.207 80 per
DNS中繼
ip nat ap so list 99 de udp 192.168.1.1 53 de 202.96.64.68 53
SNTP配置
sntp enable
sntp interval 600
sntp server 128.9.176.30
DNS配置
ip domain-lookup
ip name-server 202.101.98.55
線路檢測配置
int f1/0
keepalive dns 202.101.98.55
int f1/1
keepalive ping 61.154.28.193
VPN類型
PPTP
L2TP
IPSec
路由設置
一 電信網通雙線
ip route 0.0.0.0 0.0.0.0 61.154.28.193
ip route 58.16.0.0 255.255.0.0 61.134.96.1 網通路由表
二 雙線 內部劃分
access-list 3100 permit ip 192.168.1.2 192.168.1.15 any
access-list 3101 permit ip 192.168.1.16 192.168.1.254 any 定義類型
ip default-route list 3100 out-interface f1/0
ip default-route list 3101 out-interface f1/1 指定出口
vlan劃分
int fa0/0.1
encapsulation dot1q 1
ip address 192.168.10.1 255.255.255.0
vlan part 0
exit
int fa0/0.2
encapsulation dot1q 2
ip address 192.168.20.1 255.255.255.0
vlan port 1
日誌功能開啟
service timestamps log datetime
service sequence-numbers
防攻擊
security anti-wan-attack level high
security anti-lan-attack
限制NAT會話數
ip nat translation per-user 0.0.0.0 200
IP限速
ip nat translation rate-limit ip 0.0.0.0 in 500 out 1000
MAC/IP地址綁定
arp 192.168.0.254 00d0.f800.0001 arpa

arp scan 192.68.1.2 192.168.1.254 int f0/0
arp convert int f0/0
定時發送免費ARP
int f0/0
arp gratuious-send interval 1 10
exit
int f1/0
arp gratuious-send interval 1 10
智能防ARP欺騙功能
security anti-arp-spoof

3. 華為路由器配置命令

華為路由器配置命令大全

學習華為交換機,就要記得配置基本命令,下面為大家分享的是華為路由器基本配置命令,希望對大家學習華為有所幫助!

一、計算機命令

PCAlogin:root;使用root用戶

password:linux;口令是linux

#shutdown-hnow;關機

#init0;關機

#logout;用戶注銷

#login;用戶登錄

#ifconfig;顯示IP地址

#ifconfigeth0netmask;設置IP地址

#ifconfigeht0netmaskdown;禁用IP地址

#routeadd0.0.0.0gw;設置網關

#routedel0.0.0.0gw;刪除網關

#routeadddefaultgw;設置網關

#routedeldefaultgw;刪除網關

#route;顯示網關

#ping;發ECHO包

#telnet;遠程登錄

二、華為路由器交換機配置命令:交換機命令

[Quidway]discur;顯示當前配置

[Quidway]displaycurrent-configuration;顯示當前配置

[Quidway]displayinterfaces;顯示介面信息

[Quidway]displayvlanall;顯示路由信息

[Quidway]displayversion;顯示版本信息

[Quidway]superpassword;修改特權用戶密碼

[Quidway]sysname;交換機命名

[Quidway]interfaceethernet0/1;進入介面視圖

[Quidway]interfacevlanx;進入介面視圖

[Quidway-Vlan-interfacex]ipaddress10.65.1.1255.255.0.0;配置VLAN的IP地址

[Quidway]iproute-static0.0.0.00.0.0.010.65.1.2;靜態路由=網關

[Quidway]rip;三層交換支持

[Quidway]local-userftp

[Quidway]user-interfacevty04;進入虛擬終端

[S3026-ui-vty0-4]authentication-modepassword;設置口令模式

[S3026-ui-vty0-4]setauthentication-modepasswordsimple222;設置口令

[S3026-ui-vty0-4]userprivilegelevel3;用戶級別

[Quidway]interfaceethernet0/1;進入埠模式

[Quidway]inte0/1;進入埠模式

[Quidway-Ethernet0/1]plex{half|full|auto};配置埠工作狀態

[Quidway-Ethernet0/1]speed{10|100|auto};配置埠工作速率

[Quidway-Ethernet0/1]flow-control;配置埠流控

[Quidway-Ethernet0/1]mdi{across|auto|normal};配置埠平接扭接

[Quidway-Ethernet0/1]portlink-type{trunk|access|hybrid};設置埠工作模式

[Quidway-Ethernet0/1]portaccessvlan3;當前埠加入到VLAN

[Quidway-Ethernet0/2]porttrunkpermitvlan{ID|All};設trunk允許的VLAN

[Quidway-Ethernet0/3]porttrunkpvidvlan3;設置trunk埠的PVID

[Quidway-Ethernet0/1]undoshutdown;激活埠

[Quidway-Ethernet0/1]shutdown;關閉埠

[Quidway-Ethernet0/1]quit;返回

[Quidway]vlan3;創建VLAN

[Quidway-vlan3]portethernet0/1;在VLAN中增加埠

[Quidway-vlan3]porte0/1;簡寫方式

[Quidway-vlan3]portethernet0/1toethernet0/4;在VLAN中增加埠

[Quidway-vlan3]porte0/1toe0/4;簡寫方式

[Quidway]monitor-port;指定鏡像埠

[Quidway]portmirror;指定被鏡像埠

[Quidway]portmirrorint_listobserving-portint_typeint_num;指定鏡像和被鏡像

[Quidway]descriptionstring;指定VLAN描述字元

[Quidway]description;刪除VLAN描述字元

[Quidway]displayvlan[vlan_id];查看VLAN設置

[Quidway]stp{enable|disable};設置生成樹,默認關閉

[Quidway]stppriority4096;設置交換機的優先順序

[Quidway]stproot{primary|secondary};設置為根或根的備份

[Quidway-Ethernet0/1]stpcost200;設置交換機埠的`花費

[Quidway]link-aggregatione0/1toe0/4ingress|both;埠的聚合

[Quidway]undolink-aggregatione0/1|all;始埠為通道號

[SwitchA-vlanx]isolate-user-vlanenable;設置主vlan

[SwitchA]isolate-user-vlansecondary;設置主vlan包括的子vlan

[Quidway-Ethernet0/2]porthybridpvidvlan;設置vlan的pvid

[Quidway-Ethernet0/2]porthybridpvid;刪除vlan的pvid

[Quidway-Ethernet0/2]porthybridvlanvlan_id_listuntagged;設置無標識的vlan

如果包的vlanid與PVId一致,則去掉vlan信息.默認PVID=1。

所以設置PVID為所屬vlanid,設置可以互通的vlan為untagged.

三、華為路由器交換機配置命令:路由器命令

[Quidway]displayversion;顯示版本信息

[Quidway]displaycurrent-configuration;顯示當前配置

[Quidway]displayinterfaces;顯示介面信息

[Quidway]displayiproute;顯示路由信息

[Quidway]sysnameaabbcc;更改主機名

[Quidway]superpasswrod123456;設置口令

[Quidway]interfaceserial0;進入介面

[Quidway-serial0]ipaddress;配置埠IP地址

[Quidway-serial0]undoshutdown;激活埠

[Quidway]link-protocolhdlc;綁定hdlc協議

[Quidway]user-interfacevty04

[Quidway-ui-vty0-4]authentication-modepassword

[Quidway-ui-vty0-4]setauthentication-modepasswordsimple222

[Quidway-ui-vty0-4]userprivilegelevel3

4. 華為路由器交換機配置命令大全

你還在為而煩惱么?不用擔心,接下來是我為大家收集的,歡迎大家閱讀:
的方法
一、計算機命令





#shutdown-hnow;關機

#init0;關機

#logout;使用者登出

#login;使用者登入

#ifconfig;顯示IP地址

#ifconfigeth0netmask;設定IP地址

#ifconfigeht0netmaskdown;禁用IP地址

#routeadd0.0.0.0gw;設定閘道器

#routedel0.0.0.0gw;刪除閘道器

#routeadddefaultgw;設定閘道器

#routedeldefaultgw;刪除閘道器

#route;顯示閘道器

#ping;發ECHO包

#telnet;遠端登入

二、華為路由器交換機配置命令:交換機命令

[Quidway]discur;顯示當前配置

[Quidway]displaycurrent-configuration;顯示當前配置

[Quidway]displayinterfaces;顯示介面資訊

[Quidway]displayvl *** l;顯示路由資訊

[Quidway]displayversion;顯示版本資訊

[Quidway]superpassword;修改特權使用者密碼

[Quidway]sysname;交換機命名

[Quidway]interfaceethernet0/1;進入介面檢視

[Quidway]interfacevlanx;進入介面檢視

[Quidway-Vlan-interfacex]ipaddress10.65.1.1255.255.0.0;配置VLAN的IP地址

[Quidway]iproute-static0.0.0.00.0.0.010.65.1.2;靜態路由=閘道器

[Quidway]rip;三層交換支援

[Quidway]local-userftp

[Quidway]user-interfacevty04;進入虛擬終端

[S3026-ui-vty0-4]authentication-modepassword;設定口令模式

[S3026-ui-vty0-4]setauthentication-modepasswordsimple222;設定口令

[S3026-ui-vty0-4]userprivilegelevel3;使用者級別

[Quidway]interfaceethernet0/1;進入埠模式

[Quidway]inte0/1;進入埠模式

[Quidway-Ethernet0/1]plex{half|full|auto};配置埠工作狀態

[Quidway-Ethernet0/1]speed{10|100|auto};配置埠工作速率

[Quidway-Ethernet0/1]flow-control;配置埠流控

[Quidway-Ethernet0/1]mdi{across|auto|normal};配置埠平接扭接

[Quidway-Ethernet0/1]portlink-type{trunk|access|hybrid};設定埠工作模式

[Quidway-Ethernet0/1]portaccessvlan3;當前埠加入到VLAN

[Quidway-Ethernet0/2]porttrunkpermitvlan{ID|All};設trunk允許的VLAN

[Quidway-Ethernet0/3]porttrunkpvidvlan3;設定trunk埠的PVID

[Quidway-Ethernet0/1]undoshutdown;啟用埠

[Quidway-Ethernet0/1]shutdown;關閉埠

[Quidway-Ethernet0/1]quit;返回

[Quidway]vlan3;建立VLAN

[Quidway-vlan3]portethernet0/1;在VLAN中增加埠

[Quidway-vlan3]porte0/1;簡寫方式

[Quidway-vlan3]portethernet0/1toethernet0/4;在VLAN中增加埠

[Quidway-vlan3]porte0/1toe0/4;簡寫方式

[Quidway]monitor-port;指定映象埠

[Quidway]portmirror;指定被映象埠

[Quidway]portmirrorint_listobserving-portint_typeint_num;指定映象和被映象

[Quidway]descriptionstring;指定VLAN描述字元

[Quidway]description;刪除VLAN描述字元

[Quidway]displayvlan[vlan_id];檢視VLAN設定

[Quidway]stp{enable|disable};設定生成樹,預設關閉

[Quidway]stppriority4096;設定交換機的優先順序

[Quidway]stproot{primary|secondary};設定為根或根的備份

[Quidway-Ethernet0/1]stpcost200;設定交換機埠的花費

[Quidway]link-aggregatione0/1toe0/4ingress|both;埠的聚合

[Quidway]undolink-aggregatione0/1|all;始埠為通道號

[SwitchA-vlanx]isolate-user-vlanenable;設定主vlan

[SwitchA]isolate-user-vlansecondary;設定主vlan包括的子vlan

[Quidway-Ethernet0/2]porthybridpvidvlan;設定vlan的pvid

[Quidway-Ethernet0/2]porthybridpvid;刪除vlan的pvid

[Quidway-Ethernet0/2]porthybridvlanvlan_id_listuntagged;設定無標識的vlan

如果包的vlanid與PVId一致,則去掉vlan資訊.預設PVID=1。

所以設定PVID為所屬vlanid,設定可以互通的vlan為untagged.

三、華為路由器交換機配置命令:路由器命令

[Quidway]displayversion;顯示版本資訊

[Quidway]displaycurrent-configuration;顯示當前配置

[Quidway]displayinterfaces;顯示介面資訊

[Quidway]displayiproute;顯示路由資訊

[Quidway]sysnameaabbcc;更改主機名

[Quidway]superpasswrod123456;設定口令

[Quidway]interfaceserial0;進入介面

[Quidway-serial0]ipaddress;配置埠IP地址

[Quidway-serial0]undoshutdown;啟用埠

[Quidway]link-protocolhdlc;系結hdlc協議

[Quidway]user-interfacevty04

[Quidway-ui-vty0-4]authentication-modepassword

[Quidway-ui-vty0-4]setauthentication-modepasswordsimple222

[Quidway-ui-vty0-4]userprivilegelevel3

[Quidway-ui-vty0-4]quit

[Quidway]debugginghdlcallserial0;顯示所有資訊

[Quidway]debugginghdlceventserial0;除錯事件資訊

[Quidway]debugginghdlcpacketserial0;顯示包的資訊

四、華為路由器交換機配置命令:靜態路由:

[Quidway]iproute-static{interfacenumber|nexthop}[value][reject|blackhole]

例如:[Quidway]iproute-static129.1.0.01610.0.0.2

[Quidway]iproute-static129.1.0.0255.255.0.010.0.0.2

[Quidway]iproute-static129.1.0.016Serial2

[Quidway]iproute-static0.0.0.00.0.0.010.0.0.2

五、華為路由器交換機配置命令:動態路由:

[Quidway]rip;設定動態路由

[Quidway]ripwork;設定工作允許

[Quidway]ripinput;設定允許

[Quidway]ripoutput;設定出口允許

[Quidway-rip]network1.0.0.0;設定交換路由網路

[Quidway-rip]networkall;設定與所有網路交換

[Quidway-rip]peerip-address;

[Quidway-rip]summary;路由聚合

[Quidway]ripversion1;設定工作在版本1

[Quidway]ripversion2multicast;設版本2,多播方式

[Quidway-Ethernet0]ripsplit-horizon;水平分隔

[Quidway]routeridA.B.C.D;配置路由器的ID

[Quidway]ospfenable;啟動OSPF協議

[Quidway-ospf]import-routedirect;引入直聯路由

[Quidway-Serial0]ospfenablearea;配置OSPF區域

六、華為路由器交換機配置命令:標准訪問列表命令格式如下:

acl[match-orderconfig|auto];預設前者順序匹配。

rule[normal|special]{permit|deny}[sourcesource-addrsource-wildcard|any]

例:[Quidway]acl10

[Quidway-acl-10]rulenormalpermitsource10.0.0.00.0.0.255

[Quidway-acl-10]rulenormaldenysourceany

七、華為路由器交換機配置命令:擴充套件訪問控制列表配置命令

配置TCP/UDP協議的擴充套件訪問列表:

rule{normal|special}{permit|deny}{tcp|udp}source{|any}destination|any}

[operate]

配置ICMP協議的擴充套件訪問列表:

rule{normal|special}{permit|deny}icmpsource{|any]destination{|any]

[icmp-code][logging]

八、華為路由器交換機配置命令:擴充套件訪問控制列表操作符的含義

equalportnumber;等於

greater-thanportnumber;大於

less-thanportnumber;小於

not-equalportnumber;不等

rangeportnumber1portnumber2;區間

九、華為路由器交換機配置命令:擴充套件訪問控制列表舉例

[Quidway]acl101

[Quidway-acl-101]

[Quidway-acl-101]-typeecho

[Quidway-acl-101]-typeecho-reply

[Quidway]acl102

[Quidway-acl-102]rulepermitipsource10.0.0.10.0.0.0destination202.0.0.10.0.0.0

[Quidway-acl-102]

[Quidway]acl103

[Quidway-acl-103].0.0.10.0.0.0destination-portequalftp

[Quidway-acl-103].0.0.20.0.0.0destination-portequal

[Quidway]firewallenable

[Quidway]firewalldefaultpermit|deny

[Quidway]inte0

[Quidway-Ethernet0]firewallpacket-filter101inbound|outbound

十、華為路由器交換機配置命令:地址轉換配置舉例

[Quidway]firewallenable

[Quidway]firewalldefaultpermit

[Quidway]acl101;內部指定主機可以進入e0

[Quidway-acl-101]

[Quidway-acl-101]rulepermitipsource129.38.1.10destinationany

[Quidway-acl-101]rulepermitipsource129.38.1.20destinationany

[Quidway-acl-101]rulepermitipsource129.38.1.30destinationany

[Quidway-acl-101]rulepermitipsource129.38.1.40destinationany

[Quidway-acl-101]quit

[Quidway]inte0

[Quidway-Ethernet0]firewallpacket-filter101inbound

[Quidway]acl102;外部特定主機和大於1024埠的資料包允許進入S0

[Quidway-acl-102]

[Quidway-acl-102]rulepermittcpsource202.39.2.30destination202.38.160.10

[Quidway-acl-102].38.160.10destination-portgreat-than

1024

[Quidway-acl-102]quit

[Quidway]ints0

[Quidway-Serial0]firewallpacket-filter102inbound;設202.38.160.1是路由器出口IP。

[Quidway-Serial0]natoutbound101interface;是Easyip,將acl101允許的IP從本介面出時變換源地址。

十一、華為路由器交換機配置命令:內部伺服器地址轉換配置命令靜態nat:

natserverglobal[port]insideport[protocol];global_port不寫時使用inside_port

[Quidway-Serial0]natserverglobal202.38.160.1inside129.38.1.1ftptcp

[Quidway-Serial0]natserverglobal202.38.160.1inside129.38.1.2telnettcp

[Quidway-Serial0]natserverglobal202.38.160.1inside129.38.1.3tcp

設有公網IP:202.38.160.101~202.38.160.103可以使用。;對外訪問原例題

[Quidway]nataddress-group202.38.160.101202.38.160.103pool1;建立地址池

[Quidway]acl1

[Quidway-acl-1]rulepermitsource10.110.10.00.0.0.255;指定允許的內部網路

[Quidway-acl-1]ruledenysourceany

[Quidway-acl-1]intserial0

[Quidway-Serial0]natoutbound1address-grouppool1;在s0口從地址池取出IP對外訪問

[Quidway-Serial0]natserverglobal202.38.160.101inside10.110.10.1ftptcp

[Quidway-Serial0]natserverglobal202.38.160.102inside10.110.10.2tcp

[Quidway-Serial0]natserverglobal202.38.160.1028080inside10.110.10.3tcp

[Quidway-Serial0]natserverglobal202.38.160.103inside10.110.10.4 *** tpudp

華為路由器交換機配置命令:PPP設定:[Quidway-s0]link-protocolppp;預設的協議

十二、華為路由器交換機配置命令:PPP驗證:

主驗方:pap|chap

[Quidway]local-userq2password{simple|cipher}hello;路由器1

[Quidway]interfaceserial0

[Quidway-serial0]pppauthentication-mode{pap|chap}

[Quidway-serial0]pppchapuserq1;pap時,沒有此句

十三、華為路由交換機配置命令:pap被驗方:

[Quidway]interfaceserial0;路由器2

[Quidway-serial0]ppppaplocal-userq2password{simple|cipher}hello

十四、華為路由器交換機配置命令:chap被驗方:

[Quidway]interfaceserial0;路由器2

[Quidway-serial0]pppchapuserq2;自己路由器名

[Quidway-serial0]local-userq1password{simple|cipher}hello;對方路由器名

幀中繼frame-relay二分冊6-61

[q1]frswitching

[q1]ints1

[q1-Serial1]ipaddress192.168.34.51255.255.255.0

[q1-Serial1]link-protocolfr;封裝幀中繼協議

[q1-Serial1]frinterface-typedce

[q1-Serial1]frdlci100

[q1-Serial1]frinarp

[q1-Serial1]frmapip192.168.34.52dlci100

[q2]ints1

[q2-Serial1]ipaddress192.168.34.52255.255.255.0

[q2-Serial1]link-protocolfr

[q2-Serial1]frinterface-typedte

[q2-Serial1]frdlci100

[q2-Serial1]frinarp

[q2-Serial1]frmapip192.168.34.51dlci100

十五、華為路由器交換機配置命令:幀中繼監測

[q1]displayfrlmi-info[]interfacetypenumber]

[q1]displayfrmap

[q1]displayfrpvc-info[serialinterface-number][dlcidlci-number]

[q1]displayfrdlci-switch

[q1]displayfrinterface

[q1]resetfrinarp-info

[q1]debuggingfrall[interfacetypenumber]

[q1]debuggingfrarp[interfacetypenumber]

[q1]debuggingfrevent[interfacetypenumber]

[q1]debuggingfrlmi[interfacetypenumber]

十六、華為路由器交換機配置命令:啟動ftp服務:

[Quidway]local-userftppassword{simple|cipher}aaaservice-typeftp

[Quidway]ftpserverenable

5. 華為交換機路由配置命令

華為路由器交換機配置命令:路由器命令

[Quidway]displayversion;顯示版本信息
[Quidway]displaycurrent-configuration;顯示當前配置
[Quidway]displayinterfaces;顯示介面信息
[Quidway]displayiproute;顯示路由信息
[Quidway]sysnameaabbcc;更改主機名
[Quidway]superpasswrod123456;設置口令
[Quidway]interfaceserial0;進入介面
[Quidway-serial0]ipaddress;配置埠IP地址
[Quidway-serial0]undoshutdown;激活埠
[Quidway]link-protocolhdlc;綁定hdlc協議
[Quidway]user-interfacevty04
[Quidway-ui-vty0-4]authentication-modepassword
[Quidway-ui-vty0-4]setauthentication-modepasswordsimple222
[Quidway-ui-vty0-4]userprivilegelevel3
[Quidway-ui-vty0-4]quit
[Quidway]debugginghdlcallserial0;顯示所有信息
[Quidway]debugginghdlceventserial0;調試事件信息
[Quidway]debugginghdlcpacketserial0;顯示包的信息

華為路由器交換機配置命令:靜態路由:
[Quidway]iproute-static{interfacenumber|nexthop}[value][reject|blackhole]
例如:[Quidway]iproute-static129.1.0.01610.0.0.2
[Quidway]iproute-static129.1.0.0255.255.0.010.0.0.2
[Quidway]iproute-static129.1.0.016Serial2
[Quidway]iproute-static0.0.0.00.0.0.010.0.0.2

華為路由器交換機配置命令:動態路由:
[Quidway]rip;設置動態路由
[Quidway]ripwork;設置工作允許
[Quidway]ripinput;設置入口允許
[Quidway]ripoutput;設置出口允許
[Quidway-rip]network1.0.0.0;設置交換路由網路
[Quidway-rip]networkall;設置與所有網路交換
[Quidway-rip]peerip-address;
[Quidway-rip]summary;路由聚合
[Quidway]ripversion1;設置工作在版本1
[Quidway]ripversion2multicast;設版本2,多播方式
[Quidway-Ethernet0]ripsplit-horizon;水平分隔
[Quidway]routeridA.B.C.D;配置路由器的ID
[Quidway]ospfenable;啟動OSPF協議
[Quidway-ospf]import-routedirect;引入直聯路由
[Quidway-Serial0]ospfenablearea;配置OSPF區域

華為路由器交換機配置命令:標准訪問列表命令格式如下:
acl[match-orderconfig|auto];默認前者順序匹配。
rule[normal|special]{permit|deny}[sourcesource-addrsource-wildcard|any]
例:[Quidway]acl10
[Quidway-acl-10]rulenormalpermitsource10.0.0.00.0.0.255
[Quidway-acl-10]rulenormaldenysourceany

華為路由器交換機配置命令:擴展訪問控制列表配置命令
配置TCP/UDP協議的擴展訪問列表:
rule{normal|special}{permit|deny}{tcp|udp}source{|any}destination|any}
[operate]
配置ICMP協議的擴展訪問列表:
rule{normal|special}{permit|deny}icmpsource{|any]destination{|any]
[icmp-code][logging]

華為路由器交換機配置命令:擴展訪問控制列表操作符的含義
equalportnumber;等於
greater-thanportnumber;大於
less-thanportnumber;小於
not-equalportnumber;不等
rangeportnumber1portnumber2;區間

6. 顯示路由器或交換機配置信息的命令是什麼

1.查看設備當前配置信息:sw1或R1#show running-config 簡寫:sh run
2.顯示已保存的配置信息:sw1或R1#show startup-config 簡寫: sh star(保存後才能查看) 保存配置信息:sw1或R1#wr(write)
3.刪除已保存的配置信息:erase star
4.配置Concole口密碼:sw1(config)#line console 0
sw1(config-line)#pass(password) 密碼
sw1(config-line)#login(載入)
//路由器同理
5.配置特權模式密碼:明文:sw1(config)#enable password 密碼 簡寫:ena p 密碼
密文:sw1(config)#enable secret 密碼 簡寫 :ena s 密碼
//路由器同理
6.配置加密密文密碼:sw1(config)#service password-encryption 簡寫:ser p
7.路由密碼恢復:(1)重啟路由(reload),使用Ctrl+Break中斷IOS載入
(2)rommom>confreg 0x2142
rommom>reset
(3)重啟路由
(4)手動載入配置文件
Router# star run
(5)使用sh run查看配置密碼,更改配置密碼
(6)修改並保存配置
Router(config)#con 0x2142
Router(config)#exit
Router# run star
8.配置VTY密碼:sw1(config)#line vty 0 4
sw1(config-line)#pass 密碼
sw1(config-line)#login
9.登陸:telnet 登陸主機IP
10.給交換機配網關: sw1(config-line)#ip def 網段IP地址
11.IOS的備份與恢復
TFTP:考入 sw1# star tftp
考出 sw1# tftp star
FTP:登陸用戶名:Router(config)#ip ftp username 用戶名
Router(config)#ip ftp password 密碼
考入 Router# star ftp
考出 Router# ftp star

閱讀全文

與交換機與路由器的基本配套命令相關的資料

熱點內容
日本男男影片 瀏覽:859
matlab實用教程pdf 瀏覽:769
伺服器加密方式哪種好 瀏覽:121
顯示加密服務超時 瀏覽:611
日語口譯pdf 瀏覽:433
外人如何評價身邊的程序員 瀏覽:105
霍夫曼編碼壓縮演算法 瀏覽:122
我想學習單片機 瀏覽:644
陳寶蓮拍過 瀏覽:336
遙調命令的設定命令實現過程 瀏覽:76
演算法中最壞情況都為多少 瀏覽:995
排序演算法圖形化展示 瀏覽:782
看電影免費網站入口 瀏覽:447
加密U盤啟動區和交換區格式化 瀏覽:247
求不需要下載播放器就能看的網站 瀏覽:828
日本重生電影在線 瀏覽:623
女的被一個小孩上了 瀏覽:948
macandroid找不到設備 瀏覽:514
漫威電影不能投屏了怎麼破 瀏覽:308
安卓qq最新版本怎麼解綁手機號 瀏覽:681