用户视图模式切换至系统视图模式[Huawei]
system-view
[Huawei] display history-command
system-view
[Huawei] sysname Router1
display version ####查看VRP版本
display users ####查看用户终端信息
sys
[Huawei]int e0/0/1
[Huawei-GigabitEthernet0/0/1]dis this ####查看当前视图下的配置信息
[Huawei]display saved-configuration ###查看设备保存的信息
[Huawei]display current-configuration ###查看设备当前配置的信息
reset saved-configuration ###擦除存储设备中的配置文件
compare configuration ###比较当前配置信息与存储设备中的保存文件是否一致
[Huawei]undo info-center enable
或者
undo terminal monitor
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
sys
[Huawei]int g0/0/1
[SW1-Ethernet0/0/1]undo negotiation auto ###关闭自动协商
[SW1-Ethernet0/0/1]speed 100 ###调至速率100M
[SW1-Ethernet0/0/1]duplex full ###调至全双工模式, 解释:full:Full-Duplex(全双工模式) half:Half-Duplex(半双工模式)
save
10、设置远程登录密码
[Huawei]user-interface vty 0 4 #0是初始值,4是结束值。表示可同时打开5个会话进入交换机去配置命令
[Huawei-ui-vty0-4]authentication-mode password
[Huawei-ui-vty0-4]set authentication password simple 222
[Huawei-ui-vty0-4]user privilege level 3
[Huawei-ui-vty0-4]dis this
●双击打开某台设备有【视图】和【配置】,打开【配置】—窗口配置:串口号:2000 ###这个是端口号
●打开SecureCRT 点击【链接】—【Protocol】Telnet----【Hostname】127.0.0.1----【Prot】2000
●当前终端被打开—断开【disconnect】----会话【session options】-----强制每次一个字符模式【Force charater at atime mode】—保存【OK】
●右击当前终端—链接【reconnect】
交换机连接方式
接口模式
1.接入模式 access (电脑) 一个接口只能划分一个vlan
2.主干链路模式 trunk (交换机) 默认一个vlan,其他手动放行
3.混合模式 hysrid (电脑或交换机)
sw1(数据+vlan标签)
sw2(分析vlan标签发送vlan)
trunk(带标签数据传输)
需求:使13 24互通
LSW1
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]vlan batch 2 3
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type access
[Huawei-Ethernet0/0/1]port default vlan 2
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port default vlan 3
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]port link-type trunk
[Huawei-Ethernet0/0/3]port trunk allow-pass vlan 2 3
[Huawei-Ethernet0/0/3]q
LSW2
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]vlan batch 2 3
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/1]port link-type access
[Huawei-Ethernet0/0/1]port default vlan 2
[Huawei-Ethernet0/0/1]int e0/0/3
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port default vlan 3
[Huawei-Ethernet0/0/2]int e0/0/1
[Huawei-Ethernet0/0/3]port link-type trunk
[Huawei-Ethernet0/0/3]port trunk allow-pass vlan 2 3
[Huawei-Ethernet0/0/3]q
同一vlan 1和3互通切与2.4不通
增加路由器使12互通(网关)
LSW1
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]vlan batch 2 3
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type access
[Huawei-Ethernet0/0/1]port default vlan 2
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port default vlan 3
[Huawei-Ethernet0/0/2]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass 2 3
[ Huawei-GigabitEthernet0/0/1]q
R1
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]undo shutdown
Info: Interface Gigabi tEthernet0/0/0 is not shutdown.
[Huawei-GigabitEthernet0/0/0] int g0/0/0.1
[Huawei-GigabitEthernet0/0/0.1]vlan-type dot1q 2 default
[Huawei-GigabitEthernet0/0/0.1]ip add 192.168.2.1 24
[Huawei-GigabitEthernet0/0/0.1] int g0/0/0.2
[Huawei-GigabitEthernet0/0/0.2]vlan-type dot1q 3 default
[Huawei-GigabitEthernet0/0/0.2]ip add 192.168.3.1 24
[Huawei-GigabitEthernet0/0/0.2]q
1ping自己的网关以及2的ip和网关都能通
通过三层交换机使1和2能互通(网关)
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]vlan bat 2 3
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type access
[Huawei-GigabitEthernet0/0/1]port default vlan 2
[Huawei-GigabitEthernet0/0/1]q
[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type access
[Huawei-GigabitEthernet0/0/2]port default vlan 3
[Huawei-GigabitEthernet0/0/2]q
[Huawei]int vlan 2
[Huawei-Vlanif2]ip add 192.168.2.1 24
[Huawei-Vlanif2]q
[Huawei]int vlan 3
[Huawei-Vlanif3]ip add 192.168.3.1 24
[Huawei-Vlanif3]q
1ping自己的网关以及2的ip和网关都能通
通过hybrid端口可以使13 23相通
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]vlan bat 2 3 99
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port hybrid pvid vlan 2
[Huawei-Ethernet0/0/1]port hybrid untagged vlan 2
[Huawei-Ethernet0/0/1]q
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]port hybrid pvid vlan 3
[Huawei-Ethernet0/0/2]port hybrid untagged vlan 3
[Huawei-Ethernet0/0/2]q
[Huawei]int e0/0/3
[Huawei-Ethernet0/0/3]port hybrid pvid vlan 99
[Huawei-Ethernet0/0/3]port hybrid untagged vlan 99
[Huawei-Ethernet0/0/3]q
[Huawei]int e0/0/3
[Huawei-Ethernet0/0/3]port hybrid untagged vlan 2 99
[Huawei-Ethernet0/0/3]q
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port hybrid untagged vlan 2 99
[Huawei-Ethernet0/0/1]q
1ping3的ip能通 2ping3的ip能通
使135 245互通切能在5下载上传文件
LSW1
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]vlan bat 10 20 100
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port hybrid pvid vlan 10
[Huawei-Ethernet0/0/1]port hybrid untagged vlan 10 100
[Huawei-Ethernet0/0/1]q
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]port hybrid pvid vlan 20
[Huawei-Ethernet0/0/2]port hybrid untagged vlan 20 100
[Huawei-Ethernet0/0/2]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port hybrid tagged vlan 10 20 100
[Huawei-GigabitEthernet0/0/1]q
LSW2
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]vlan bat 10 20 100
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port hybrid pvid vlan 10
[Huawei-Ethernet0/0/1]port hybrid untagged vlan 10 100
[Huawei-Ethernet0/0/1]q
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]port hybrid pvid vlan 20
[Huawei-Ethernet0/0/2]port hybrid untagged vlan 20 100
[Huawei-Ethernet0/0/2]q
[Huawei]int e0/0/3
[Huawei-Ethernet0/0/3]port hybrid pvid vlan 100
[Huawei-Ethernet0/0/3]port hybrid untagged vlan 10 20 100
[Huawei-Ethernet0/0/3]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port hybrid tagged vlan 10 20 100
[Huawei-GigabitEthernet0/0/1]q
同一vlan互通且与5也通 与2.4不通
使12互通切增加带宽
LSW1
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]vlan 2
[Huawei-vlan2]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type access
[Huawei-Ethernet0/0/1]port default vlan 2
[Huawei-Ethernet0/0/1]q
[Huawei]int Eth-trunk 1
[Huawei-Eth-Trunk1]port link-type trunk
[Huawei-Eth-Trunk1]port trunk allow-pass vlan all
[Huawei-Eth-Trunk1]q
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-Ethernet0/0/2]q
[Huawei]int e0/0/3
[Huawei-Ethernet0/0/3]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-Ethernet0/0/3]q
LSW2
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]q
[Huawei]vlan 2
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type access
[Huawei-Ethernet0/0/1]port default vlan 2
[Huawei-Ethernet0/0/1]q
[Huawei]int Eth-Trunk 2
[Huawei-Eth-Trunk2]port link-type trunk
[Huawei-Eth-Trunk2]port trunk allow-pass vlan all
[Huawei-Eth-Trunk2]q
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]eth-trunk 2
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-Ethernet0/0/2]q
[Huawei]int e0/0/3
[Huawei-Ethernet0/0/3]eth-trunk 2
Info: This operation may take a few seconds. Please wait for a moment…done.
[Huawei-Ethernet0/0/3]q
1和2的ip在两条通道上相通
CE1
u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with return command.
[~HUAWEI]int eth-trunk 1
[*HUAWEI-Eth-Trunk1]undo portswitch
[*HUAWEI-Eth-Trunk1]ip add 10.1.1.1 24
[*HUAWEI-Eth-Trunk1]int g1/0/0
[*HUAWEI-GE1/0/0]eth-trunk 1
[*HUAWEI-GE1/0/0]un sh
[*HUAWEI-GE1/0/0]int g1/0/1
[*HUAWEI-GE1/0/1]eth-trunk 1
[*HUAWEI-GE1/0/1]un sh
[*HUAWEI-GE1/0/1]int loop0
[*HUAWEI-LoopBack0]ip add 192.168.1.100 32
[*HUAWEI-LoopBack0]q
[*HUAWEI]ip route-static 192.168.2.100 32 10.1.1.2
CE2
u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with return command.
[~HUAWEI]int eth-Trunk 2
[*HUAWEI-Eth-Trunk2]undo portswitch
[*HUAWEI-Eth-Trunk2]ip add 10.1.1.2 24
[*HUAWEI-Eth-Trunk2]int g1/0/1
[*HUAWEI-GE1/0/1]eth-trunk 2
[*HUAWEI-GE1/0/1]un sh
[*HUAWEI-GE1/0/1]int g1/0/0
[*HUAWEI-GE1/0/0]eth-trunk 2
[*HUAWEI-GE1/0/0]un sh
[*HUAWEI-GE1/0/0]int loop0
[*HUAWEI-LoopBack0]ip add 192.168.2.100 32
[*HUAWEI-LoopBack0]q
[*HUAWEI]ip route-static 192.168.1.100 32 10.1.1.1