于交换机和路由器的配置在教大家的时候要是用硬件是不可能的 没哪个条件今天带给大家的是我做个一个小的实验 大家可以下一个华为MA5200G模拟器进行实验 07
E9[U[
具体的命令和解释我全写出来了希望和我一样菜的朋友和我一起做! pP|LSrY!
A6S|pO1)3
首先给大家收集了一些交换机的基本命令具体命令解释我已经给出了 4NK{RN3
通常命令: ]8o[&50y
PCA login: root ;使用root用户 l>D!@`><I
password: linux ;口令是linux "K)ue@?
# shutdown -h now ;关机 U32&"&";c
# init 0 ;关机 wSPwa,)7s
# logout 7;rf$\-&
# login x\K9|_!
# ifconfig ;显示IP地址 . UaLP
# ifconfig eth0 <ip address> netmask <netmask> ;设置IP地址 'UFPQ
# ifconfig eht0 <ip address> netmask <netmask> down ; 删除IP地址 a<CJ#B2K
# route add 0.0.0.0 gw <ip> NK!#K>AO
# route del 0.0.0.0 gw <ip> Y'U]!c9
# route add default gw <ip> ;设置网关 n4A#T#D!t3
# route del default gw <ip> ;删除网关 /RBIZ_
# route ;显示网关 +@mgb4_
# ping <ip> *|*6q/
# telnet <ip> ;建议telnet之前先ping一下 \$Q?
--------------------------------------- qBDhCE
交换机命令 vxZ :l
~~~~~~~~~~ }}X<e
[Quidway]super password 修改特权用户密码 N@x5h8
[Quidway]sysname 交换机命名 :pw6#yi8`
[Quidway]interface ethernet 0/1 进入接口视图 /r?EY&9G
[Quidway]interface vlan x 进入接口视图 A$1Gc>C
[Quidway-Vlan-interfacex]ip address 10.65.1.1 255.255.0.0 tO~o-R
[Quidway]ip route-static 0.0.0.0 0.0.0.0 10.65.1.2 静态路由=网关 g^)8a;/c
c`s ]ciC
[Quidway]user-interface vty 0 4 (yO8G-Z0
[S3026-ui-vty0-4]authentication-mode password lU8X{SV!
[S3026-ui-vty0-4]set authentication-mode password simple 222 N_o|2
[S3026-ui-vty0-4]user privilege level 3 u5I#5
Q&`if
O
[Quidway-Ethernet0/1]duplex {half|full|auto} 配置端口双工工作状态 Vg^,Ky,
[Quidway-Ethernet0/1]speed {10|100|auto} 配置端口工作速率 ,sZ)@?e
[Quidway-Ethernet0/1]flow-control 配置端口流控 rp_Aw
[Quidway-Ethernet0/1]mdi {across|auto|normal} 配置端口MDI/MDIX状态平接或扭接 E oh{+>:6
[Quidway-Ethernet0/1]port link-type {trunk|access|hybrid} 设置接口工作模式 q Oyo+hu
[Quidway-Ethernet0/1]shutdown 关闭/重起接口 "?Yf3G: \0
[Quidway-Ethernet0/2]quit 退出系统视图 iPK:gK3Q
!.cno&
[Quidway]vlan 3 创建/删除一个VLAN/进入VLAN模式 &]S\GnqlU]
[Quidway-vlan3]port ethernet 0/1 to ethernet 0/4 在当前VLAN增加/删除以太网接口 La8 D%N
[Quidway-Ethernet0/2]port access vlan 3 将当前接口加入到指定VLAN YgR}y+q^6
[Quidway-Ethernet0/2]port trunk permit vlan {ID|All} 设trunk允许的VLAN !V27ln KP+
[Quidway-Ethernet0/2]port trunk pvid vlan 3 设置trunk端口的PVID _%@ri]u{ov
[Quidway]monitor-port <interface_type interface_num> 指定和清除镜像端口 |y DaFv
[Quidway]port mirror <interface_type interface_num> 指定和清除被镜像端口 Wu@v%!0
[Quidway]port mirror int_list observing-port int_type int_num 指定镜像和被镜像 #v\o@ArX
V]W-**j<
[Quidway]description string 指定VLAN描述字符 i-M<_62c
[Quidway]description 删除VLAN描述字符 (_n U}<y_i
[Quidway]display vlan [vlan_id] 查看VLAN设置 &pFP=|Pq
%d^ =$Q
[Quidway]stp {enable|disable} 开启/关闭生成树,默认关闭 Z" N}f
,
[Quidway]stp priority 4096 设置交换机的优先级 jn._4TQ*}
[Quidway]stp root {primary|secondary} 设置交换机为根或根的备份 d
Z P;f^^
[Quidway-Ethernet0/1]stp cost 200 设置交换机端口的花费 FB }8
8Y
P7'Fz
[SwitchA-vlanx]isolate-user-vlan enable 设置主vlan c+N\uG4
[SwitchA]Isolate-user-vlan <x> secondary <list> 设置主vlan包括的子vlan hOR1RB
[Quidway-Ethernet0/2]port hybrid pvid vlan <id> 设置vlan的pvid xY@<