【网工】华为设备命令学习(综合实验一)

实验要求和实验成果如图所示。

LSW2不需要其他配置,其下就一台设备,不需要区分。

LSW3配置如下:

<Huawei>sy    
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en        //关闭系统提示信息
Info: Information center is disabled.
[Huawei]vlan 20        //创建vlan20
[Huawei-vlan20]q
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type access     
[Huawei-Ethernet0/0/2]q
[Huawei]vlan 30        //创建vlan30
[Huawei-vlan30]q
[Huawei]int e0/0/2    
[Huawei-Ethernet0/0/2]port default vlan 20     //将vlan 20划分进2号端口
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]port link-type access 
[Huawei-Ethernet0/0/3]port default vlan 20
[Huawei-Ethernet0/0/3]port default vlan 30
[Huawei-Ethernet0/0/3]dis this         //展示当前配置了什么
#        
interface Ethernet0/0/3
 port link-type access
 port default vlan 30
#
return
[Huawei-Ethernet0/0/3]q
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type trunk     //配置trunk模式
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan all

LSW1配置如下:

<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]vlan batch 10 20 30 40        //批量创建 vlan
/*10 20 30 为pc1-3 vlan40为服务器*/
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int vlan 10
[Huawei-Vlanif10]ip add 192.168.10.254 24    //充当网关
[Huawei-Vlanif10]int vlan 20
[Huawei-Vlanif20]ip add 192.168.20.254 24
[Huawei-Vlanif20]int vlan 30
[Huawei-Vlanif30]ip add 192.168.30.254 24
[Huawei-Vlanif30]int vlan 40
[Huawei-Vlanif40]ip add 172.16.100.254 24
[Huawei-Vlanif40]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type access 
[Huawei-GigabitEthernet0/0/1]port default vlan 40
[Huawei-GigabitEthernet0/0/1]int g0/0/2    
[Huawei-GigabitEthernet0/0/2]port link-type access 
[Huawei-GigabitEthernet0/0/2]port default vlan 10
[Huawei-GigabitEthernet0/0/2]int g0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type trunk     
[Huawei-GigabitEthernet0/0/3]port trunk allow-pass vlan all
[Huawei-GigabitEthernet0/0/3]q
[Huawei]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]int vlan 10    //为01端口配置dhcp服务器地址
[Huawei-Vlanif10]dhcp select interface     
[Huawei-Vlanif10]dhcp server dns-list 172.16.100.1 
[Huawei-Vlanif10]dis this 
#
interface Vlanif10
 ip address 192.168.10.254 255.255.255.0
 dhcp select interface
 dhcp server dns-list 172.16.100.1
#
return
[Huawei-Vlanif10]int vlan 20
[Huawei-Vlanif20] dhcp select interface        
[Huawei-Vlanif20] dhcp server dns-list 172.16.100.1
[Huawei-Vlanif20]int vlan 30
[Huawei-Vlanif30] dhcp select interface
[Huawei-Vlanif30] dhcp server dns-list 172.16.100.1
[Huawei-Vlanif30]q

[Huawei]dis ip int brief 

[Huawei]vlan 100        //创建vlan100与路由器连接
[Huawei-vlan100]q
[Huawei]int g0/0/4
[Huawei-GigabitEthernet0/0/4]port link-type access 
[Huawei-GigabitEthernet0/0/4]port default vlan 100    
[Huawei-GigabitEthernet0/0/4]q
[Huawei]int vlan 100
[Huawei-Vlanif100]ip add 10.10.10.2 24
[Huawei-Vlanif100]q
[Huawei]ping 10.10.10.1
  PING 10.10.10.1: 56  data bytes, press CTRL_C to break
    Reply from 10.10.10.1: bytes=56 Sequence=1 ttl=255 time=70 ms
    Reply from 10.10.10.1: bytes=56 Sequence=2 ttl=255 time=50 ms
    Reply from 10.10.10.1: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 10.10.10.1: bytes=56 Sequence=4 ttl=255 time=10 ms
    Reply from 10.10.10.1: bytes=56 Sequence=5 ttl=255 time=50 ms

  --- 10.10.10.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/40/70 ms
[Huawei]ip route-static 0.0.0.0 0.0.0.0 10.10.10.1        //告诉交换机出去的数据的下一跳

AR1的配置如下:

<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 10.10.10.1 24
[Huawei-GigabitEthernet0/0/0]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 64.1.1.1 24
[Huawei-GigabitEthernet0/0/1]q
[Huawei]ip route-static 0.0.0.0 0.0.0.0 64.1.1.10    //配置静态路由告诉设备出去的下一跳
[Huawei]ip route-static 192.168.0.0 255.255.0.0 10.10.10.2    //告诉设备进来的下一跳
[Huawei]ip route-static 172.16.100.0 255.255.0.0 10.10.10.2    //同上
Info: The destination address and mask of the configured static route mismatched
, and the static route 172.16.0.0/16 was generated.
[Huawei]acl 2000    //配置输入输出规则 名称    
[Huawei-acl-basic-2000]rule permit  source 192.168.0.0 0.0.255.255
[Huawei-acl-basic-2000]q
[Huawei]nat address-group 1 64.1.1.5 64.1.1.5    //nat地址组名称为1
[Huawei]int g0/0/1    
[Huawei-GigabitEthernet0/0/1]nat outbound 2000 address-group 1    //将规则作用于2000出去的数据使用地址组里的IP
[Huawei-GigabitEthernet0/0/1]q
[Huawei]acl 2001
[Huawei-acl-basic-2001]rule deny source 192.168.10.0 0.0.0.255
[Huawei-acl-basic-2001]rule permit source any
[Huawei-acl-basic-2001]int g0/0/0
[Huawei-GigabitEthernet0/0/0]traffic-filter inbound acl 2001    //将2001作用于内部所有数据
[Huawei-GigabitEthernet0/0/0]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]nat server global 64.1.1.3  inside 172.16.100.1    将内部IP转换为外部IP

其余设备为基础配置,只需要看图配置就可以完成本次实验。

相关推荐

  1. 2024【华南大学综合评价招生】解读

    2024-02-14 06:22:02       29 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-02-14 06:22:02       106 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-02-14 06:22:02       116 阅读
  3. 在Django里面运行非项目文件

    2024-02-14 06:22:02       95 阅读
  4. Python语言-面向对象

    2024-02-14 06:22:02       103 阅读

热门阅读

  1. libevent

    2024-02-14 06:22:02       41 阅读
  2. ubuntu22.04下使用conda安装pytorch(cpu及gpu版本)

    2024-02-14 06:22:02       48 阅读
  3. 适应力和应变力是智能的重要组成部分

    2024-02-14 06:22:02       50 阅读
  4. git将给远程地址配置别名

    2024-02-14 06:22:02       52 阅读
  5. bugku 1

    bugku 1

    2024-02-14 06:22:02      49 阅读
  6. jvm类加载器

    2024-02-14 06:22:02       50 阅读
  7. 【生产实测可用】Redis修改集群弱口令

    2024-02-14 06:22:02       45 阅读
  8. Python学习之路-爬虫提高:selenium

    2024-02-14 06:22:02       56 阅读
  9. django中查询优化

    2024-02-14 06:22:02       59 阅读
  10. django中的复杂查询

    2024-02-14 06:22:02       49 阅读
  11. 分布式认证JWT

    2024-02-14 06:22:02       48 阅读
  12. Windows平台git clone文件路径太长报错

    2024-02-14 06:22:02       51 阅读
  13. leetcode算法-位运算

    2024-02-14 06:22:02       53 阅读