小王同学
小王同学
发布于 2024-07-04 / 158 阅读
0

网络地址转换综合实验

综合实验要求

  1. 按拓扑配置基本IP地址

  2. 内网交换机和接入层交换机配置以太网链路聚合,并使用lacp模式

  3. 所有PC.STA的网关都在核心交换机,核心交换机配置DHCP给地下PC.STA自动下发地址,基于接口下发

  4. 配置WLAN

  5. 配置PPPoE,并设置认证模式为chap认证,认证账号密码为huawei

  6. 配置NAT easy ip及ACL,让除管理部以外的部门都能访问外网设备

  7. 配置NAT server,让外网设备能够通过访问100.0.12.3地址访问内网研发部服务器FTP服务.

  8. 配置ACL,让访客中心的用户无法访问内部各个部门,只能访问外网.

要求一:配置基本IP地址

服务器配置

客户端配置

为AR1、AR2分配IP

AR1:

[R1-GigabitEthernet0/0/0]ip add 192.168.11.1 24

AR2:

[R2-GigabitEthernet0/0/1]ip add 9.9.9.254 24 //客户端网关

要求二:链路聚合

研发部

  1. 创建vlan10

  2. 配置g0/0/2和g0/0/3

    port link-type access port default vlan 10

  3. 链路聚合:

    1. 创建逻辑接口 [yf-sw]interface Eth-Trunk 1

    2. 将聚合模式改为lacp [js-sw-Eth-Trunk1]mode lacp-static

    3. 将物理接口放入 [js-sw-Eth-Trunk1]trunkport GigabitEthernet 0/0/5 to 0/0/6

    4. 配置如下

      interface Eth-Trunk1 port
      link-type trunk port trunk allow-passvlan 10 
      mode lacp-static

技术部

  1. 创建vlan20

  2. 配置g0/0/2和g0/0/1

    port link-type access port default vlan 20

  3. 链路聚合:

    1. 创建逻辑接口 [yf-sw]interface Eth-Trunk 2

    2. 将聚合模式改为lacp [js-sw-Eth-Trunk2]mode lacp-static

    3. 将物理接口放入 [js-sw-Eth-Trunk2]trunkport GigabitEthernet 0/0/4 to 0/0/5

    4. 配置如下

      interface Eth-Trunk2 
      port link-type trunk 
      port trunk allow-pass vlan 20 
      mode lacp-static

管理部

  1. 创建vlan200

  2. 配置g0/0/1

    port link-type access port default vlan 200

  3. 链路聚合:

    1. 创建逻辑接口 [yf-sw]interface Eth-Trunk 3

    2. 将聚合模式改为lacp [js-sw-Eth-Trunk3]mode lacp-static

    3. 将物理接口放入 [js-sw-Eth-Trunk3]trunkport GigabitEthernet 0/0/3 to 0/0/4

    4. 配置如下

      interface Eth-Trunk3 
      port link-type trunk 
      port trunk allow-pass vlan 200 
      mode lacp-static

访客中心

  1. 全局创建vlan [fk-sw]vlan batch 100 101

  2. 配置g0/0/1 和 g0/0/2

    port link-type trunk 
    port trunk pvid vlan 100 
    port trunk allow-pass vlan 100 to 101
  3. 链路聚合:

    1. 创建逻辑接口 [yf-sw]interface Eth-Trunk 4

    2. 将聚合模式改为lacp [js-sw-Eth-Trunk2]mode lacp-static

    3. 将物理接口放入 [js-sw-Eth-Trunk2]trunkport GigabitEthernet 0/0/4 to 0/0/5

    4. 配置如下

      interface Eth-Trunk4 
      port link-type trunk 
      port trunk allow-pass vlan 100 101 
      mode lacp-static

核心交换机

tips :检查聚合链路是否正确配置:[main-sw]dis int e 4(聚合链路id)

  1. 创建vlan [main-sw]vlan batch 10 20 200 11 101 100

  2. 链路聚合 访客及三个部门操作相同

    1. 将聚合模式改为lacp

    2. 将物理接口放入

    3. 配置如下

      port link-type trunk port trunk allow-pass vlan ???

要求三:配置DHCP

tips : 访客以及三个部门的网关均在核心交换机

  1. 将PC机全部设置为DHCP

  2. 全局开启 dhcp [main-sw]dhcp enable

  3. 分别创建三个部门逻辑接口,设置 ip 作为网关设备(4-7在核心交换机上配置)

  4. 研发部:

    interface Vlanif10 
    ip address 192.168.1.254 255.255.255.0 
    dhcp select interface
  5. 技术部:

    interface Vlanif20 ip 
    address 192.168.2.254 255.255.255.0 
    dhcp select interface
  6. 管理部:

    interface Vlanif200 
    ip address 192.168.200.254 255.255.255.0 
    dhcp select interface
  7. 访客中心 (暂时没有定义业务vlan,所以设置了不会生效,暂定业务vlan为101,这里是为连接wlan的设备配置dhcp)

    interface Vlanif101 
    ip address 192.168.101.254 255.255.255.0 
    dhcp select interface
  8. 访客中心管理业务(在AC1上配置)

    1. 创建vlan101 100

    2. 配置物理接口

      interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 100 to 101

    3. 创建逻辑接口 vlanif100 , 配置如下

      interface Vlanif100 ip address 192.168.100.254 255.255.255.0 dhcp select interface

    4. 配置核心交换机物理接口g0/0/1

      interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 100 to 101

    5. 在ap上使用 [Huawei]display ip interface brief 查看ip是否获取成功,若ip为169.xxx则获取失败

  9. 使用ipconfig检查是否配置正确

要求四:配置wlan

上线ap

  1. 配置 capwap 隧道建立连接 [AC6005]capwap source interface Vlanif 100

  2. 进入wlan视图

  3. 配置国家码

    1. [AC6005-wlan-view]regulatory-domain-profile name huawei 创建domain模版

    2. [AC6005-wlan-regulate-domain-huawei]country-code CN 配置国家码

  4. 设置ap组

    1. ap-group name huawei 创建并进入 huawei ap组

    2. [AC6005-wlan-ap-group-huawei]regulatory-domain-profile huawei 绑定domain模版

  5. 连接ap

    1. 在wlan视图下

      使用 ap-id 1 ap-mac 00e0-fcad-01b0 上线对应ap

      ap-max的获取方式 在对应ap下 使用 [Huawei]dis int v1 获取

      配置ap

      ap-name AP1 ap-group huawei

在对应ap cli中出现 ===== CAPWAP LINK IS UP!!! ===== 则表示上线成功

配置wlan

  1. 配置ssid

    1. 创建ssid模版[AC6005-wlan-view]ssid-profile name huawei

    2. 设置ssid[AC6005-wlan-ssid-prof-huawei]ssid huawei

  2. 配置安全模版

    1. 创建安全模版 [AC6005-wlan-view]security-profile name huawei

    2. 设置模版[AC6005-wlan-sec-prof-huawei]security wpa-wpa2 psk pass-phrase 12345678 aes

  3. 配置vap模版

    1. 创建vap模版 [AC6005-wlan-view]vap-profile name huawei\

    2. 设置模版

      service-vlan vlan-id 101 ssid-profile huawei security-profile huawei

  4. 在wlan视图中输入 [AC6005-wlan-view]ap-group name huawei进入ap组

  5. 绑定 vap 模版 [AC6005-wlan-ap-group-huawei]vap-profile huawei wlan 1 radio all

测试

  1. sta设备是否能够通过设置的密码连接对应wlan

  2. 测试设备是否可以ping通网关

要求五:配置pppoe

  1. 在公网路由器创建aaa账户

    local-user huawei password cipher %$%$N~Iu%~TspN"S1}YZ3ngIMtf[%$%$
    local-user huawei service-type ppp
  2. 在公网路由器设置

    interface Virtual-Template1
    ppp authentication-mode chap 
    remote address 10.0.1.1 
    ip address 10.0.1.2 255.255.255.0 

    在物理接口配置 [R2-GigabitEthernet0/0/0]pppoe-server bind virtual-template 1

  3. 在私网路由器设置 interface Dialer1

    link-protocol ppp 
    ppp chap user huawei 
    ppp chap password cipher ??? 
    ip address ppp-negotiate 
    dialer user huawei 
    dialer bundle 1 
    dialer-group 1
    nat outbound 2000

    在物理接口配置 [R1-GigabitEthernet0/0/1]pppoe-client dial-bundle-number 1

  4. 配置dialer1 规则 输入 dialer-rule 配置 dialer-rule 1 ip permit

要求六:除管理部门都能访问外网

  1. 配置核心交换机

    1. 创建vlanif11逻辑接口

      interface Vlanif11 ip address 192.168.11.1 255.255.255.0

    2. 配置上行接口

      interface GigabitEthernet0/0/2 port link-type access port default vlan 11

  2. 配置私网路由器

    1. 配置下行接口[R1-GigabitEthernet0/0/0]ip address 192.168.11.2 24

    2. 配置acl 2000 规则 达到要求

  3. 配置静态路由

    1. 在私网路由器新建静态路由

      ip route-static 0.0.0.0 0.0.0.0 Dialer1
      ip route-static 192.168.1.0 255.255.255.0 192.168.11.1 
      ip route-static 192.168.2.0 255.255.255.0 192.168.11.1 
      ip route-static 192.168.101.0 255.255.255.0 192.168.11.1

要求七:客户端通过公网地址访问服务器

在私网路由器连接公网的逻辑接口配置 nat server protocol tcp global 100.0.12.3 ftp inside 192.168.1.1 ftp

重启服务器,客户端配置如下

要求八:配置ACL

  1. 创建acl3000,因为涉及到源目地址

  2. 配置acl3000

    acl number 3000
     rule 5 deny ip source 192.168.101.0 0.0.0.255 destination 192.168.1.0 0.0.0.255
     rule 10 deny ip source 192.168.101.0 0.0.0.255 destination 192.168.2.0 0.0.0.255
     rule 15 deny ip source 192.168.101.0 0.0.0.255 destination 192.168.200.0 0.0.0.255
  3. 在逻辑接口上应用acl [main-sw-Eth-Trunk4]traffic-filter inbound acl 3000