华为模拟器学习记录
<Huawei>sy //进入系统视图,命令:system-view 简写:sys 或 sy
<Huawei>dis cur //查看配置
[Huawei]sysname Switch //命名交换机为 Switch
[Switch]q //返回上一级,命令:quit 简写:q
[Switch]ret //直接返回用户视图,命令:return简写:ret
<Switch>sa //保存配置,命令:save 简写:sa
[Switch]reboot //重启设备
[Switch]reset saved-configuration //檫除旧的配置文件
[Switch]dis vlan //查看vlan状态
[Switch]vlan 10 //新建vlan 10
[Switch]undo vlan 10 //删除vlan 10
[Switch-vlan10]port g0/0/1 //端口放入vlan中,端口划入Vlan前,必须设置为access模式
[Switch-vlan10]undo port g0/0/1 //删除当前Vlan端口1
[Switch-vlan10]description wifi //命名Vlan
[Switch]int vlan 10 //进入Vlan
[Switch-vlanif10]ip address //配置Vlan管理地址
[Switch-Vlanif10]dhcp select global //DHCP获取范围从全局global获取
[Switch-vlan10]port GigabitEthernet 0/0/3 to 0/0/4 //批量把端口加入vlan
//端口批量加入Vlan
[Switch]port-group yewu
[Switch-port-group-yewu]group-member g0/0/4 to g0/0/6
[Switch-port-group-yewu]port link-type access
[Switch-port-group-yewu]port default vlan 10
[Switch-GigabitEthernet0/0/1]port link-type access //设置端口为access模式
[Switch-GigabitEthernet0/0/1]port default vlan 10 //把端口放入Vlan 10 中
[Switch-GigabitEthernet0/0/1]port link-type trunk //设置端口为trunk模式
[Switch- GigabitEthernet0/0/1]port trunk allow-pass vlan all //设置允许所有Vlan 的报文通过
[Switch-GigabitEthernet0/0/1]undo port link-type //删除端口配置
[Switch]int g0/0/1 //进入1口 ,同等:int GigabitEthernet 0/0/1
[Switch]dis int g0/0/1 //查看端口
DHCP自动获取IP设置:
[Switch]dhcp enable //开启dhcp服务
[Switch]int vlan 20 //进入vlan 20
[Switch-Vlanif20]ip add 192.168.20.1 24 //配置IP地址,24同等于255.255.255.0
[Switch-Vlanif20]dhcp select interface //选择接口
[Switch-Vlanif20]dhcp server dns-list 192.168.20.254 //配置DNS
[Switch-Vlanif20]dhcp server excluded-ip-address 192.168.20.254 //排除此IP不被获取
[Switch]int g0/0/9 //进入端口9
[Switch-GigabitEthernet0/0/9]port hybrid pvid vlan 20 //加入vlan 20
[Switch-GigabitEthernet0/0/9]port hybrid untagged vlan 20 //端口混合无标记VLAN 20
静态路由配置
<Huawei>sys
[Huawei]sysname R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.254 24
[R1]int s2/0/0
[R1-Serial2/0/0]ip add 202.196.1.1 24
[R1]ip route-static 192.168.2.0 255.255.255.0 202.196.2.1
<R1>sa
Rip协议
[Huawei]sys R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.254 24
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 202.196.1.1 24
[R1]rip 1
[R1-rip-1]ver 2
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 202.196.1.0
<R1>sa
bgp协议
[R1]bgp 100
[R1-bgp]router-id 10.0.0.1
[R1-bgp]peer 10.0.0.2 as-number 300
[R1-bgp]network 192.168.1.0
[R1-bgp]network 10.0.0.0
上一篇:华为交换机常用查询命令
下一篇:华为/H3C交换IP、MAC绑定和解绑,arp static绑定和am user-bind的区别
讨论数量:0