华为交换机基础学习命令(ensp)
1、修改系统时间(在<hw>下输⼊):clock datetime 12:00:00 2018-01-01
2、sysname SW 设备命名
[SW]header shell information(添加登录说明)
3、[SW]user-interface console 0(进⼊console配置模式)
[SW-ui-console0]authentication-mode password
[SW-ui-console0]set authentication password cipher huawei@123(设置console密码为密⽂形式huawei@123)[*CE6800-ui-console0]idle-timeout 20 0(设置超时时间为20min)
4、建⼀个⽤于telnet的vlanx,并在interface vlanifx⾥⾯加上ip address 0.0.0.0 24
5、
[SW]telnet server enable(开通telnet)
6、
[SW]user-interface vty 0 4
[SW-ui-vty0-4]protocol inbound telnet
[SW-ui-vty0-4]authentication-mode aaa
[SW-ui-vty0-4]user privilege level 15(访问权限)
[SW-ui-vty0-4]idle-timeout 5(设置超时时间)
[SW-ui-vty0-4]q
7、
[SW]aaa
[SW-aaa]local-user huawei password cipheer huawei@123
[SW-aaa]local-user huawei service-type telnet
[SW-aaa]local-user huawei privilege level 15
[SW-aaa]quit
8、[SW]vlan 10(建⽴vlan)
[SW]vlan batch 2 to 1000(同时创建多个vlan)
9、description xxx(在端⼝或vlan中添加描述的命令)
10、interface Vlanif 2(进⼊vlanif2,三层交换机才可以)
[SW-Vlanif2]ip address 10.6.0.1 24(在vlan⾥添加IP地址和掩码)
11、[SW]interface GigabitEthernet 0/0/2(进⼊端⼝)
[SW-GigabitEthernet0/0/2]undo shutdown
[SW-GigabitEthernet0/0/2]port link-type trunk
[SW-GigabitEthernet0/0/2]port trunk allow-pass vlan all(all可以选择替换为单个vlan)
当连接电脑或其它⽹络设备可以⽤:
[SW-GigabitEthernet0/0/2]port link-type access
[SW-GigabitEthernet0/0/2]port default vlan xx
[SW-GigabitEthernet0/0/2]dhcp snooping enable (dhcp服务,交换机端⼝分配ip)
交换机端⼝要分配ip地址vlanxx⾥⾯的命令(交换机要开启dhcp服务):
[SW]interface Vlanifxx
ip address 10.2.22.129 255.255.255.240
dhcp select interface
dhcp server dns-list 61.139.2.69
也可以使⽤地址池:
[SW]ip pool 1
gateway-list 10.3.5.1
network 10.3.5.0 mask 255.255.255.0
dns-list 61.139.2.69
[SW]interface Vlanif 20
ip address 10.0.0.1 24
dhcp select global (选择全局的地址池)
12、[SW]dhcp enable(开启dhcp)
[SW]dhcp snooping enable
13、[SW]ip route-static 0.0.0.0 0.0.0.0 10.(默认路由:所有的ip地址都指向10.)
[SW]ip route-static 8.0.10.0 24 10.(静态路由)
14、同时改多个端⼝,⽅法⼀:
cipher命令[SW]interface range GE 1/0/2 to GE 1/0/10
[SW-core-port-group]undo shutdown
⽅法⼆:
[SW]port-group 1(建⽴端⼝组,可以同时改多个端⼝)
[SW-port-group-1]group-member GigabitEthernet 0/0/2 to GigabitEthernet 0/0/20
[SW-port-group-1]port default vlan 20
15、打开告警信息命令(退出视图才可以操作)
terminal logging(undo terminal logging关闭命令)
terminal monitor
terminal trapping
16、团体名设置:
snmp-agent
snmp-agent community read admin123
snmp-agent community write admin112
snmp-agent sys-info version v2c
17、华为交换机,当把dhcp snooping开启之后,所有端⼝的in⽅向都是⾮信任端⼝,也就是dhcp不能通过任何端⼝的in⽅向,所以需要把上连⼝⽤dhcp snooping trusted 配置能信任端⼝,否则其它端⼝⽆法获取到dhcp
18、interface Vlanif10
ip address 10.3.1.1 255.255.255.0
dhcp select interface 选择接⼝的地址池
dhcp server excluded-ip-address 10.3.1.20 10.3.1.100(指定⽹段设备共享)
dhcp server dns-list 61.139.2.69 10.3.1.10
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论