华为命令大全
一、配置交换机的名称和密文密码:
<Huawei> //用户视图
<Huawei>system-view //进入系统视图配置
[Huawei] //系统视图
[Huawei]quit或return //退出系统视图模式
[Huawei]sysname DTWLXY //设置主机名
[Huawei]ur-interface console 0 //进入控制台
[Huawei-ui-console0]authentication-mode password
[Huawei-ui-console0]t authentication password cipher huawei //配置密文密码二、配置交换机VLAN相关命令:
[Huawei]vlan 10或[Huawei]vlan 20 //创建VLAN
[Huawei-vlan10]deion dtwlxy //VLAN描述
[Huawei]vlan batch 30 40 //创建多个VLAN
[Huawei]int g0/0/1 //进入接口
[Huawei-g0/0/1]port link-type access //访问口
[Huawei-g0/0/1]port default vlan 10 //加入VLAN
[Huawei-g0/0/2]port link-type trunk //干道口
[Huawei-g0/0/2]port trunk allow-pass vlan 10 20允许
[Huawei-g0/0/2]port trunk allow-pass vlan all //所有
[Huawei]int e0/0/2 //进入接口
[Huawei-E0/0/2]port link-type hybrid //混合口模式
[Huawei-E0/0/2]undo port default vlan //删除默认vlan
[Huawei-E0/0/2]port hybrid untagged vlan 20//去标签
[Huawei-E0/0/2]port hybrid pvid vlan 2//设置默认vlan
featuring
[Huawei-E0/0/2]port trunk allow-pass vlan 10 to 100
[Huawei]dis port vlan //查看vlan
[Huawei]display vlan //查看vlanfdf
三、配置交换机VLAN一致性GVRP:
Normal模式:(类似cisco交换机服务器模式)
[Huawei]gvrp //开启gvrp也是默认模式
Fixed模式:(类似cisco交换机客户机模式)
[Huawei-g0/0/2]gvrp registration fixed
Forbidden模式:(类似cisco交换机透明模式)
[Huawei-g0/0/3]gvrp registration forbidden
dis vlan summary //查看vlan汇总
dis gvrp status //查看gvrp状态1
四、配置路由器RIP协议:RIPv1 RIPv2
[Huawei]rip //启用RIP默认v1
[Huawei-rip-1]network 192.168.1.0 //发布直连网段
[Huawei-rip-1]version 2 //配置v2版本
[Huawei]dis rip //查看rip队长英文
[Huawei]dis rip databa //查看rip数据库
[Huawei]dis ip routing-table //查看路由表
五、配置静态路由
[Huawei]ip route-static 192.168.50.0 24 10.0.12.2
[Huawei]ip route-static 192.168.10.0 24 rial 0/0/1
[Huawei]ip route-static 0.0.0.0 0 192.168.2.1 //默认
[Huawei]dispaly ip routing-table //查看路由表
六、配置路由器OSPF协议:
[Huawei]ospf 1 //启用OSPF默认是进程1
[Huawei-ospf-1]area 0 //进入区域0
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255 //发布直连网段[Huawei-ospf-1]silent-interface g0/0/2 //被动接口
[Huawei]dis ospf interface //查看ospf通告
[Huawei]dis ospf peer //查看ospf邻居
[Huawei]dis ip routing-table //查看路由表
[Huawei]dis ospf routing //查看ospf路由表
七、配置基于全局的DHCP协议:
[Huawei]dhcp enable //开启dhcp
[Huawei]ip pool dtwlxy //地址池名
[Huawei-ip-pool-dtwlxy]network 192.168.1.0 //地址池
[Huawei-ip-pool-dtwlxy]lea day 2 //租约默认1
[Huawei-ip-pool-dtwlxy]gateway-list 192.168.1.254 //网关
[Huawei-ip-pool-dtwlxy]excluded-ip-address192.168.1.250 192.168.1.253 //排除IP范围[Huawei-ip-pool-dtwlxy]dns-list 8.8.8.8 //DNS服务器
[Huawei-G0/0/0]dhcp lect global //基于全局
八、配置基于接口的DHCP协议:
[Huawei]dhcp enable //开启dhcp
[Huawei]int g0/0/1 //进入接口
[Huawei-G0/0/1]dhcp lect interface //基于接口
[Huawei-G0/0/1]dhcp rver lea day 2 //租约默认1
[Huawei-G0/0/1]dhcp rverexcluded-ip-address 192.168.1.1 192.168.1.10 //排除IP范围[Huawei-G0/0/1]dhcp rver dns-list 8.8.8.8 //DNS
[Huawei]dis ip pool //查看dhcp
九、配置路由器基本ACL:2000-2999
[Huawei]acl 2000 //配置基本acl
[Huawei-acl-basic-2000]rule 5 permit source 1.1.1.1 0 //允许源IP(注意反掩码0,默认步长5) [Huawei-acl-basic-2000]rule 10 deny any //拒绝任意
[Huawei]ur-interface vty 0 4 //进入接口
[Huawei-ui-vty0-4]acl 2000 inbound //应用acl
[Huawei]dis acl all //查看所有acl
[Huawei]dis acl 2000 //查看acl 2000
十、配置路由器高级ACL:3000-3999
[Huawei]acl 3000 //配置高级acl
[Huawei-acl-adv-3000]rule permit ip source 1.1.1.1 0 destination 4.4.4.4 0 //允许访问[Huawei]ur-interface vty 0 4 //进入虚拟接口
solenoidvalve[Huawei-ui-vty0-4]acl 3000 outbound //应用aclcover是什么意思
[Huawei]int g0/0/1 //进入接口
[Huawei-G0/0/1]traffic-filter inbound acl 3000 //应用
[Huawei]dis acl all //查看所有acl
十一、静态NAT配置:film是什么意思
oyster<huawei>system-view
gesundheit[huawei]interface Ethernet 0/0/1 //进入端口视图
教师资格证培训机构
[huawei-Ethernet0/0/1]ip address 192.1.1.1 30 //设置端口IP地址,网络号30位
[huawei-Ethernet0/0/1]nat static global 192.1.1.2 inside 10.1.1.2 //静态NAT映射,私有地址10.1.1.2和公有地址192.1.1.2建立映射关系动态NAT配置:
[huawei]nat address-group 1 192.1.1.2 192.1.1.4 //定义公有地址池
[huawei]acl 2000
[huawei-acl-basic-2000]rule permit source 10.1.1.0 0.0.0.255
[huawei-acl-basic-2000]quit
[huawei]interface Ethernet 0/0/1
[huawei-Ethernet0/0/1]nat outbound 2000 address-group 1 //实现ACL2000中定义的IP可以与地址池中的地址进行NAT转换,这里默认配置的是NAPT,是多对一的关系,要配置Basic NAT,则需要加选项no-pat
十二、配置三层交换机VLAN间路由:首先基本配置,IP、VLAN等。
[Huawei]int vlanif 10 //进入接口
[Huawei-Vlanif10]ip add 192.168.1.254 24 //配IP
[Huawei]int vlanif 20 //进入接口
[Huawei-Vlanif20]ip add 192.168.2.254 24 //配IP
[Huawei]dis ip interface brief //接口简略信息
[Huawei]dis port vlan //接口vlan信息
[Huawei]dis vlan //查看vlan信息
十三、配置单臂路由VLAN间通信:首先基本配置,IP、VLAN等。
[Huawei-G0/0/1.1]ip add 192.168.1.254 24 //配置IP
[Huawei-G0/0/1.1]dot1q termination vid 10 //封装
[Huawei-G0/0/1.1]arp broadcast enable //开启arp
[Huawei]dis ip interface brief //查看接口
[Huawei]dis ip routing-table //查看路由表
[Huawei]display current-configuration //查看配置
十四、配置交换机的远程管理IP地址:
[Huawei]interface Vlanif 1 //进入VLAN1
[Huawei-Vlanif1]ip add 192.168.1.254 24 //配置IP
[Huawei-Vlanif1]undo shutdown //开启接口
[Huawei]dns //设置域名
[Huawei]dns rver 192.168.254.254 //设置域名IP dis vlan显示vlan save保存配置dis curr显示当前配置reboot重启设备
<Huawei>undo terminal monitor //取消提示信息
十五、配置交换机端口速率、双工、ARP:
[Huawei]int g0/0/1 //进入接口
[Huawei-g0/0/1]deion dtwlxy //端口描述
[Huawei-g0/0/1]undo negotiation auto //取消协商
[Huawei-GigabitEthernet0/0/1]duplex full //全双工
[Huawei-GigabitEthernet0/0/1]auto duplex full //自动
[Huawei-GigabitEthernet0/0/1]speed 10 //速率10M
[Huawei-GigabitEthernet0/0/1]auto speed 100 //自动
[Huawei]arp static 192.168.1.8 5489-98cf-2603//绑定
[Huawei]dis arp [Huawei]dis arp all //查看ARP11
十六、配置路由器接口IP:
[Huawei]int g0/0/1 //进入接口
[Huawei-g0/0/1]ip add 192.168.1.6 24 //配IP地址embody
[Huawei-GigabitEthernet0/0/1]undo shutdown //开启
<Huawei>dis cur或[Huawei]dis cur //查看ARP
思科命令大全
一、常规配置
1.创建VLAN:S1(config)#vlan 100
2.给VLAN命名:S1(config-vlan)#name vlan100
3.删除VLAN:S1(config)#no vlan 100
4.分配端口到VLAN中:S1(config)#interface f0/1
S1(config-if)#switchport access vlan 100
5.VLAN TRAN的配置:
S1(config)#interface f0/2
S1(config-if)#switchport mode trunk //设置端口为trunk端口
S1(config-if)#switchport trunk allowed vlan100,2 //允许vlan 100和vlan 2通过