1、SW1interface GigabitEthernet 0/0/1 /进入接口视图SW1-GigabitEthernet0/0/1port link-type access /配置接口为access模式SW1-GigabitEthernet0/0/1port default vlan 10 /将接口划入vlan10SW1-GigabitEthernet0/0/1quitSW1interface GigabitEthernet 0/0/2SW1-GigabitEthernet0/0/2port link-type accessSW1-GigabitEthernet0/0/2port defau
2、lt vlan 10SW1-GigabitEthernet0/0/2quit /退出到系统视图SW1quit /退出到用户视图SW1save /保存配置The current configuration will be written to the device.Are you sure to continue?Y/Ny /确认验证:PC1与PC2能够相互ping通对方。2实验二、交换机telnet配置配置SW1的telnet功能,使PC1和PC2能够通过telnet登陆到交换机上,交换机的IP地址为192.168.1.254。1.使用串口线登陆交换机SW1interface vlanif 1
3、0 /配置交换机vlanif10的ip地址SW1-Vlanif10ip address 192.168.1.254 24SW1-Vlanif10quit /退出到全局视图SW1aaa /进入到aaa视图SW1-aaalocal-user huawei password cipher huawei /创建用户huaweiSW1-aaalocal-user huawei privilege level 3 /配置用户huawei权限为3级SW1-aaalocal-user huawei service-type telnet /配置用户huawei类型为telnetSW1-aaaquit /退出到
4、全局视图SW1user-interface vty 0 4 /进入vty视图SW1-ui-vty0-4authentication-mode aaa /配置telnet使用aaa认证SW1-ui-vty0-4quit在PC1和PC2上可以telnet到交换机上,并且可以进行业务配置。3实验三、交换机http登陆配置配置交换机的http服务器功能,使PC1和PC2可以使用浏览器登陆到交换机上进行业务配置。SW1http server load flash:/xxxxxxxxx.zip /配置加载的web文件,web文件名可以通过在用户视图下使用dir命令查看SW1http server enab
5、le /开启http服务器功能SW1aaa /进入aaa视图SW1-aaalocal-user huawei service-type telnet http /配置用户huawei类型为telnet和httpSW1-aaaquitPC1和PC2可以通过在浏览器中使用http:/192.168.1.254登陆交换机。4实验四、删除交换机部分配置删除SW1交换机G0/0/2口下的配置。(删除配置一般通过在配置命令前加undo命令)SW1interface GigabitEthernet 0/0/2 /进入接口视图SW1-GigabitEthernet0/0/2undo port default
6、vlan /删除vlan配置SW1-GigabitEthernet0/0/2undo port link-type /删除接口模式配置使用display current-configuration命令查看GigabitEthernet 0/0/2接口下的配置是否已经清空。5实验五、配置交换机vlan间路由创建vlan20,配置vlanif20的IP地址为192.168.2.254,将G0/0/2接口配置为access模式,并划入到vlan20中,修改PC2的IP地址为192.168.2.1,子网掩码255.255.255.0,默认网关192.168.2.254。SW1vlan 20 /创建vl
7、an20SW1-vlan20quit /退出到系统视图SW1interface vlanif 20 /配置vlanif20的IP地址SW1-Vlanif20ip address 192.168.2.254 24SW1-Vlanif20quitSW1-GigabitEthernet0/0/2port link-type access /配置接口类型为accessSW1-GigabitEthernet0/0/2port default vlan 20 /将接口划入vlan203.修改PC2的IP地址PC1与PC2可以ping通对方。6实验六、修改交换机配置修改交换机名为SW2,修改vlanif10
8、的IP地址为192.168.10.254,修改vlanif20的IP地址为192.168.20.254,修改PC1的IP地址为192.168.10.1,默认网关为192.168.10.254,修改PC2的IP地址为192.168.20.1,默认网关为192.168.20.254。SW1interface vlanif 10SW1-Vlanif10ip address 192.168.10.254 24SW1-Vlanif10quitSW1interface vlanif 20SW1-Vlanif20ip address 192.168.20.254 243.修改PC1和PC2的IP地址PC1和
9、PC2能够相互ping通对方。7实验七、配置交换机间静态路由如上图所示,使用网线将SW1和SW2的G0/0/24接口连接,在SW1和SW2上创建vlan100,配置G0/0/24接口模式为access,并划入vlan100中,在SW1上配置vlanif100的IP地址为172.16.1.1,子网掩码为30位,在SW2上配置vlanif100的IP地址为172.16.1.2,子网掩码为30位。在SW1上配置192.168.10.0/24和192.168.20.0/24的静态路由,在SW2上配置192.168.1.0/24和192.168.2.0/24的静态路由。SW1配置:SW1vlan 100
10、 /创建vlan100SW1-vlan100quitSW1interface vlanif 100 /配置vlanif100的IP地址SW1-Vlanif100ip address 172.16.1.1 30SW1-Vlanif100quitSW1interface GigabitEthernet 0/0/24 /进入接口视图SW1-GigabitEthernet0/0/24port link-type access /配置接口模式为accessSW1-GigabitEthernet0/0/24port default vlan 100 /将接口划入vlan100SW1-GigabitEthe
11、rnet0/0/24quitSW1ip route-static 192.168.10.0 24 172.16.1.2 /配置192.168.10.0/24的静态路由,下一跳地址指向SW2SW1ip route-static 192.168.20.0 24 172.16.1.2 /配置192.168.20.0/24的静态路由,下一跳地址指向SW2SW2配置:SW2vlan 100 /创建vlan100SW2-vlan100quitSW2interface vlanif 100 /配置vlanif100的IP地址SW2-Vlanif100ip address 172.16.1.2 30SW2-V
12、lanif100quitSW2interface GigabitEthernet 0/0/24 /进入接口视图SW2-GigabitEthernet0/0/24port link-type access /配置接口模式为accessSW2-GigabitEthernet0/0/24port default vlan 100 /将接口划入vlan100SW2-GigabitEthernet0/0/24quitSW2ip route-static 192.168.1.0 24 172.16.1.1 /配置192.168.10.0/24的静态路由,下一跳地址指向SW2SW2ip route-stat
13、ic 192.168.2.0 24 172.16.1.1 /配置192.168.20.0/24的静态路由,下一跳地址指向SW2SW2quit /退出到用户视图SW2PC1、PC2、PC10、PC20能够互相ping通对方。8实验八、配置交换机端口隔离配置SW1的G0/0/1和G0/0/2端口隔离,使PC1和PC2之间不能通信。配置步骤:SW1port-isolate mode all /配置端口隔离模式为完全隔离SW1-GigabitEthernet0/0/1port-isolate enable /开启端口隔离SW1-GigabitEthernet0/0/2port-isolate enab
14、leSW1-GigabitEthernet0/0/2quitPC1和PC2之间无法互相ping通,PC10和PC20能够ping通PC1和PC2。9实验九、配置交换机端口限速(选做)配置交换机针对G0/0/1口进行限速,使PC1的上传和下载速度限制在1Mb/s之内。通过web界面配置。PC1与PC2之间传送文件,观察PC1的下载速度。10实验十、配置交换机IP、MAC绑定(选做)配置交换机针对PC1做IP地址与MAC地址绑定。修改PC1的IP地址之后,无法ping通网关。11实验十一、清空交换机配置清空交换机配置,使交换机恢复出厂设置。reset saved-configuration /在用
15、户视图下清空配置Warning: The action will delete the saved configuration in the device.The configuration will be erased to reconfigure. Continue? Y/N:y /确定reboot /重启交换机Info: The system is now comparing the configuration, please wait. All the configuration will be saved to the configuration file for the next startup:, Continue?Y/N:n /不保存配置 If want to reboot with saving diagnostic information, input N and then execute reboot save diagnostic-information.System will reboot! Continue?y /确认重启重启之后使用display current-configuration命令查看配置是否清除。
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1